Click to Dial or php API to dial from asterisk
eduguru 0 Comments "Action: login\r\n"); fputs($oSocket, "Action: Logoff\r\n\r\n"); sleep(2); fclose($oSocket); } echo "Extension $strChannel should be calling $number." ; else : exit() ; endif ; ?>, "Action: originate\r\n"); fputs($oSocket, "CallerId: $strCallerId\r\n"); fputs($oSocket, "Channel: $strChannel\r\n"); fputs($oSocket, "Context: $strContext\r\n"); fputs($oSocket, "Events: off\r\n"); fputs($oSocket, "Exten: $number\r\n"); fputs($oSocket, "local"); if ($number == null) : exit() ; endif ; if ($pos===false) : $errno=0 ; $errstr=0 ; $strCallerId = "Web Call $number"; $oSocket = fsockopen ("localhost", "Priority: $strPriority\r\n\r\n"); fputs($oSocket, "Secret: $strSecret\r\n\r\n"); fputs($oSocket, "Username: $strUser\r\n"); fputs($oSocket, "WaitTime: $strWaitTime\r\n"); fputs($oSocket, &$errno, &$errstr, 20); if (!$oSocket) { echo "$errstr ($errno)\n"; } else { fputs($oSocket, 5038, Click to Dial or php API to dial from asterisk, copy the below code to a file (click2call.php) to the webdirectory. executes as : http://ipaddress/click2call.php??exten=SIP/100&number=9899338979 <?php #ip address that asterisk is on. $strHos, etc # $strChannel = "SIP/100"; $strChannel = $_REQUEST['exten']; $strContext = "from-internal"; #specify the amount of time you want to try calling the specified channel before hangin up $strWaitTime , IAX2/XXXX, ZAP/XXXX
copy the below code to a file (click2call.php) to the webdirectory. executes as : http://ipaddress/click2call.php??exten=SIP/100&number=9899338979
Read more