http://65.11.11.20/edc/webcall.php?dest=18097143489&cid=18007142020&code=4563&ordernumber=12345678
///////////
<?php
$pbx="localhost";
$trunk="cpeak";
$dest=$_GET[dest];
$cid=$_GET[cid];
$code=$_GET[code];
$order=$_GET[ordernumber];
$socket = fsockopen($pbx,"5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n"); //
fputs($socket, "Secret: passr456\r\n\r\n"); //
//
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: SIP/$trunk/$dest\r\n" );
#fputs($socket, "Channel: SIP/100\r\n" );
fputs($socket, "Exten: s\r\n" );
fputs($socket, "Context: order\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: $cid\r\n" );
fputs($socket, "Variable: __code=$code\r\n" );
fputs($socket, "Variable: __order=$order\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
?>
/////////////
[order]
exten=>_x.,1,Goto(order,s,1)
exten=>s,1,Set(GLOBAL(LOOPCOUNT)=1)
same=>n,verbose(value of ${LOOPCOUNT})
same=>n,Answer()
same=>n,Playback(/var/lib/asterisk/sounds/edc/greeting)
same=>n,Saydigits(${order})
same=>n,Background(/var/lib/asterisk/sounds/edc/options)
same=>n,Waitexten(2)
;;;;1
exten =>1,1,Set(GLOBAL(COUNT)=1)
exten =>1,2(read),Read(confirm,/var/lib/asterisk/sounds/edc/code,4,,3,2)
same=>n,GotoIf($["${confirm}"!= "${code}"]?bad)
same=>n,Playback(/var/lib/asterisk/sounds/edc/confirmed)
;same=>n,System(curl http://obamacare-guide.org/obm-api/obm-api.php -G -d"username=htgambiorix&password=a123&phone=${var1}&answered=ANSWER")
same=>n,System(curl https://www.edcmeals.com/voip/confirmation.tpl -G -d"ordernumber=${order}&response=1")
same=>n,Hangup()
same=>n(bad),verbose(count value is ${COUNT})
same=>n,Playback(/var/lib/asterisk/sounds/edc/invalid)
same=>n,Set(COUNT=$[${COUNT} + 1])
same=>n,verbose(value of ${COUNT})
same=>n,GotoIf($[${COUNT} > 3]?order,hangup,1)
same=>n,Goto(read)
exten=>hangup,1,Playback(/var/lib/asterisk/sounds/edc/cb5)
same=>n,System(curl https://www.edcmeals.com/voip/confirmation.tpl -G -d"ordernumber=${order}&response=2")
same>n,Hangup()
;;;;2
exten=>2,1,Playback(/var/lib/asterisk/sounds/edc/tcb5)
same=>n,System(curl https://www.edcmeals.com/voip/confirmation.tpl -G -d"ordernumber=${order}&response=2")
same=>n,Hangup()
;;3
exten =>3,1,Goto(order,s,1)
;;4
exten=>4,1,Playback(/var/lib/asterisk/sounds/edc/tcb5)
same=>n,System(curl https://www.edcmeals.com/voip/confirmation.tpl -G -d"ordernumber=${order}&response=4")
same=>n,Hangup()
;;5
exten=>5,1,Dial(SIP/18097143489@cpeak)
same=>n,Hangup()
;;;invalid
exten =>i,1,Goto(order,s,1)
;;;;timeout
exten=>t,1,NoOp()
same=>n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
same=>n,verbose(value of ${LOOPCOUNT})
same=>n,GotoIf($[${LOOPCOUNT} > 2]?order,hangup,1)
same=>n,Goto(order,s,1)
No hay comentarios:
Publicar un comentario