click to call from website

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

click to call from website

Postby Jitin » Fri Aug 30, 2019 2:45 am

Hello Sir

Asterisk version : 11.22.0
VERSION: 2.14-588a
BUILD: 170211-1041
OS : centos 6.9
It is a scratch install.

I want to use click to call on my website. Customer will fill his information(phone number) and then click "click to call" button.
As soon as the button is pressed, a call will be initiated on customer number and once he answers, he will be connected to call menu/ingroup in vicidial
it could be done with the help of DID number if required or directly to call menu/Ingroup.

Not able to go through that

Can you please help on the same.
Jitin
 
Posts: 40
Joined: Fri Feb 23, 2018 2:26 am

Re: click to call from website

Postby ambiorixg12 » Fri Aug 30, 2019 9:08 am

A very simple task I have done it many times, create a PHP script who will originate the call using the Asterisk's manager action originate

fputs($socket, "Action: Originate\r\n" );
ambiorixg12
 
Posts: 453
Joined: Tue Sep 17, 2013 10:35 pm

Re: click to call from website

Postby Jitin » Mon Sep 02, 2019 2:42 am

fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $number\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: $strPriority\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");


I have used this
but it connects number passed with extension

I want number to be connected directly with DID number(and not SIP extension)
Jitin
 
Posts: 40
Joined: Fri Feb 23, 2018 2:26 am

Re: click to call from website

Postby ambiorixg12 » Mon Sep 02, 2019 10:03 am

I dont know the values for the following variables : $strChannel , $strContext and $number but assuming are using the extension value as the one for dial to the agent, change the context to trunkinbound and extension value to a DID pointing to the ingroup

$strContext="trunkinbound";

$number ="DID WHO is ROUTED to the INGROUP";
ambiorixg12
 
Posts: 453
Joined: Tue Sep 17, 2013 10:35 pm

Re: click to call from website

Postby Jitin » Tue Sep 03, 2019 12:42 am

$strChannel = $_REQUEST['exten'];
$strContext = "trunkinbound";
#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "30";
#specify the priority you wish to place on making this call
$strPriority = "1";
#specify the maximum amount of retries
$strMaxRetry = "2";
$number=strtolower($_REQUEST['number']);
$pos=strpos ($number,"local");
if ($number == null) :
exit() ;
endif ;
if ($pos===false) :
$errno=0 ;
$errstr=0 ;
$strCallerId = "Web Call $number";
$oSocket = fsockopen ("localhost", 5038, $errno, $errstr, 20);
if (!$oSocket) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $number\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: $strPriority\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");

and in api I am passing : http://server_IP/call.php??exten=SIP/10 ... 9999999999

please let me know the exact changes
I want to use DID instead of exten and connect it with number entered by customer in website

please let me know the exact changes.
Jitin
 
Posts: 40
Joined: Fri Feb 23, 2018 2:26 am

Re: click to call from website

Postby ambiorixg12 » Tue Sep 03, 2019 8:06 pm

Instead of dial to the SIP device directly, send the call to a local channel pointing to the DID number

fputs($socket, "Channel: Local/$DIDNUMBER@trunkinbound\r\n" );
ambiorixg12
 
Posts: 453
Joined: Tue Sep 17, 2013 10:35 pm

Re: click to call from website

Postby Jitin » Wed Sep 04, 2019 3:16 am

fputs($socket, "Channel: Local/$DIDNUMBER@trunkinbound\r\n" );

It created a local channel. I should be able to create a SIP channel with DID
Otherwise it doesn't dial outbound number which we sending via api

Please check it again and let me know the correct solution.
Jitin
 
Posts: 40
Joined: Fri Feb 23, 2018 2:26 am

Re: click to call from website

Postby williamconley » Wed Sep 04, 2019 3:53 pm

local is how you dial any number initially through most vicidial systems. you are meant to invoke the dial pattern (dialplan entry) from your carrier. Alternately, you could dial the sip account for the carrier directly if you like.

But none of this should be happening in the first place. Vicidial already has a "click to dial" method in the non-agent API. Use the "Add lead" with the optional "add to hopper". This will put the lead directly into the hopper and if the campaign is LIVE the call will be dialed immediately.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 99 guests