#!/bin/sh

set -e

# Outgoing call were replaced by route in 2019.05.00
if [ "$XIVO_VERSION_INSTALLED" \> "2019.05.00" ]; then
	exit 0
fi

if xivo-dcomp logs -t --no-color db | grep '\[MIGRATE_OUTCALL\].*WARNING' > /dev/null; then
	cat <<-EOF
	
	*********************************************************************************
	*  WARNING: Outgoing calls were migrated to Routes and there were some problems *
	*                                                                               *
	*   You MUST check the upgrade log with the following command:                  *
	*   # xivo-dcomp logs -t db | grep '\[MIGRATE_OUTCALL\].*WARNING'               *
	*                                                                               *
	*   This will give you the outcall names that had problems.                     *
	*   Please follow the "Upgrade Boréalis to Callisto > After Upgrade" section    *
	*   of XiVO Callisto documentation.                                             *
	*********************************************************************************
	
	EOF
fi
