DIAL PLAN
##########################
[india]
exten=>_x.,1,NoCDR()
same=>n,Set(CALLERID(num)=255411413792)
same=>n,Dial(SIP/+${EXTEN}@cpeak,5)
same=>n,hangup()
exten=>h,1,System(/bin/sed -i "s/${CDR(dst)}//g" /root/number_list)
exten=>h,2,Noop(${CDR(dst)} hangupcause ${HANGUPCAUSE} dialstatus ${DIALSTATUS})
exten=>h,3,System(echo Destination "${CDR(dst)} | hangupcause ${HANGUPCAUSE} | dialstatus ${DIALSTATUS} | date ${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}" >>/var/www/callstatus.txt)
[india2]
exten=>_x.,1,NoCDR()
exten=>_x.,2,hangup
exten=>h,1,System(/bin/sed -i "s/${CDR(dst)}//g" /root/number_list)
exten=>h,2,Noop(hangupcause ${HANGUPCAUSE} dialstatus ${DIALSTATUS})
##############
Calling Script
#############
#!/bin/bash
var=$(< number_list) ##take the numbes from a file called number_list
for i in $var
do
echo "calling to $i "
echo "calling to $i " > freecalls.logs
`asterisk -x "originate Local/$i@india extension $i@india2"`
sleep 2
done
exten=>_x.,1,NoCDR()
exten=>_x.,2,hangup
exten=>h,1,System(/bin/sed -i "s/${CDR(dst)}//g" /root/number_list)
exten=>h,2,Noop(hangupcause ${HANGUPCAUSE} dialstatus ${DIALSTATUS})
##############
Calling Script
#############
#!/bin/bash
var=$(< number_list) ##take the numbes from a file called number_list
for i in $var
do
echo "calling to $i "
echo "calling to $i " > freecalls.logs
`asterisk -x "originate Local/$i@india extension $i@india2"`
sleep 2
done
BASH SCRIPT to check if process is running
#####################################
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export DISPLAY=:0.0
T2=`pgrep calltxtfile.sh `
if [ "$T2" = "" ]; then
echo process not running
/root/calltxtfile.sh
else
echo process running fine
fi
#########################################
cronjob
#######################################
*/1 * * * * /root/checkpro.sh
No hay comentarios:
Publicar un comentario