#!/bin/sh

stdin="0"

while [ "$stdin" != "" ]
do
        read stdin
# if [ "$stdin" != EOF ]; then
# echo $stdin >> /tmp/agi_input_log.txt
# fi
done

# Test if given NPA-NXX in local.txt file
N="$(grep $1 /var/lib/asterisk/agi-bin/local.txt)"

if [ -z "$N" ];
then
        echo "SET VARIABLE IS_LOCAL FALSE"
        RES=0
else
        echo "SET VARIABLE IS_LOCAL TRUE"
        RES=1
fi
read response
# echo $response >> /tmp/agi_input_log.txt

exit $RES