if [ "$1" = "" ]; then
	echo "Usage: ./setDialOutNum <channelIndex> <DialOutNum>"
	exit
fi


# Adding a new Entry. Modifying existing one is not handled by this.

PREV_INDEX=`expr $1 - 1`
if [ "$#" = 2 ]
then
    echo "/	ChannelDialOutNum\[$PREV_INDEX\]/ a \	ChannelDialOutNum[$1]=\"\"" > /tmp/dialoutnumadd 
    sed -i -f /tmp/dialoutnumadd $2
else
    echo "/	ChannelDialOutNum\[$PREV_INDEX\]/ a \	ChannelDialOutNum[$1]=\"$2\"" > /tmp/dialoutnumadd 
    sed -i -f /tmp/dialoutnumadd $3
fi
rm -f /tmp/dialoutnumadd

