Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

martes, 24 de noviembre de 2015

Web call queue


Asterisk part

nano /etc/asterisk/extensions_custom.conf

First call dial to the    freepbx inbound route pointing to  a queue

[webcall]
exten=>_x.,1,Set(CALLERID(all)=WEB LEAD<${dest}>))
same=>n,goto(from-trunk,${ext},1)

second call conect to the  customer phone

[from-web]
exten=>_x.,1,Set(CALLERID(all)=LEAD<${cid}>))
same=>n,dial(SIP/5417878877/${dest})


[state]
exten=>_x.,1,Wait(2)
exten=>_x.,n,Playback(demo-thanks)
exten=>_x.,n,ExecIf($["${DEVICE_STATE(SIP/${EXTEN})}"= "INUSE"]?Dial(SIP/${EXTEN}))
same=>n,goto(1)










PHP part

 nano /var/www/html/webcall/call.php






<?php
/*parameters */

$param= array("host"=>"localhost","port"=>5038,"trunk"=>"tw0","timeout"=>45,"message"=>"demo-thanks");

/*form variables */

$dest=$_GET['dest'];
$callerid=$_GET['cid'];
$ext=$_GET['ext'];

 $socket = fsockopen($param['host'],$param['port'], $errno, $errstr,$param['timeout']);
 fputs($socket, "Action: Login\r\n");
 fputs($socket, "UserName: admin\r\n");     //
 fputs($socket, "Secret:tf12200003\r\n\r\n");  //
               $wrets=fgets($socket,128);
              echo $wrets;
              fputs($socket, "Action: Originate\r\n" );
              fputs($socket, "Channel: Local/$dest@webcall\r\n" );
              fputs($socket, "Exten: $ext\r\n" );
               fputs($socket, "Context: from-web\r\n" );
               fputs($socket, "Priority: 1\r\n" );
               fputs($socket, "CallerID: $cid\r\n" );
                fputs($socket, "Variable: __ext=$ext\r\n" );
               fputs($socket, "Variable: __dest=$dest\r\n" );
               fputs($socket, "Variable: __cid=$callerid\r\n" );
             fputs($socket, "Async: yes\r\n\r\n" );
              fputs($socket, "Action: Logoff\r\n\r\n");
 sleep (1);
 $wrets=fgets($socket,128);

?>






asterisk  calling  url
http://168.18.77.15:9999/?dest=100&ext=999901&cid=45555


No hay comentarios:

Publicar un comentario