Using the php script below. I am able to enter my number and the number to call, however I get the following error:<br><br> <span style="font-style: italic;"> -- AGI Script cid-spoof.agi completed, returning 0</span><br style="font-style: italic;">
<span style="font-style: italic;"> == Parsing '/etc/asterisk/manager.conf': Found</span><br style="font-style: italic;"><span style="font-style: italic;"> == Parsing '/etc/asterisk/manager_custom.conf': Found
</span><br style="font-style: italic;"><span style="font-style: italic;"> == Manager 'admin' logged on from <a href="http://127.0.0.1">127.0.0.1</a></span><br style="font-style: italic;"><span style="font-style: italic;">
-- Executing Wait("OutgoingSpoolFailed", "4") in new stack</span><br style="font-style: italic;"><span style="font-style: italic;"> -- Executing BackGround("OutgoingSpoolFailed", "beep") in new stack
</span><br style="font-style: italic;"><span style="font-style: italic;"> == Spawn extension (custom-web-dial-both-called, failed, 2) exited non-zero on 'OutgoingSpoolFailed'</span><br style="font-style: italic;">
<span style="font-style: italic;"> -- Executing Hangup("OutgoingSpoolFailed", "") in new stack</span><br style="font-style: italic;"><span style="font-style: italic;"> == Spawn extension (custom-web-dial-both-called, h, 1) exited non-zero on 'OutgoingSpoolFailed'
</span><br style="font-style: italic;"><span style="font-style: italic;"> == Manager 'admin' logged off from <a href="http://127.0.0.1">127.0.0.1</a></span><br style="font-style: italic;"><br><br><br><br><span style="font-weight: bold;">
Here is the PHP:</span><br><html><br><head><br><title>Call From Web!</title><br></head><br><body><br><?<br><br><br><br>#------------------------------------------------------------------------------------------
<br>#edit the below variable values to reflect your system/information<br>#------------------------------------------------------------------------------------------<br><br>#specify the name/ip address of your asterisk box
<br>#if your are hosting this page on your asterisk box, then you can use<br>#127.0.0.1 as the host IP. Otherwise, you will need to edit the following<br>#line in manager.conf, under the Admin user section:<br>#permit=<a href="http://127.0.0.1/255.255.255.0">
127.0.0.1/255.255.255.0</a><br>#change to:<br>#permit=<a href="http://127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx">127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx</a> ;(the ip address of the server this page is running on)<br>$strHost = "
<a href="http://127.0.0.1">127.0.0.1</a>";<br><br>#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)<br>#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.
<br>$strUser = "admin";<br><br>#specify the password for the above user<br>$strSecret = "amp111";<br><br><br>####-----This block is not used in this script----###<br>#specify the channel (extension) you want to receive the call requests with
<br>#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc<br>#$strChannel = "IAX2/XXXXXX";<br><br>#specify the context to make the outgoing call from. By default, AAH uses from-internal<br>#Using from-internal will make you outgoing dialing rules apply
<br>#$strContext = "from-internal";<br>####---End of block---###<br><br>#specify the amount of time you want to try calling the specified channel before hangin up<br>$strWaitTime = "30";<br><br>#specify the priority you wish to place on making this call
<br>$strPriority = "1";<br><br>#specify the maximum amount of retries<br>$strMaxRetry = "2";<br><br>#--------------------------------------------------------------------------------------------<br>#Should edit some things below this point to make this script work
<br>#--------------------------------------------------------------------------------------------<br>#get the caller's number from the form<br>$strCallerNumber = $_POST['txtcallernumber'];<br>$strChannel = $strCallerNumber;
<br><br>$strCallerId = $strCallerNumber;<br><br>#get the phone number from the posted form<br>$strExten = $_POST['txtphonenumber'];<br><br><br>$callNumber = $strExten;<br>#specify the caller id for the call<br>$strCallerId = "Web will call <$callNumber>";
<br><br>$length = strlen($strExten);<br><br>if ($length == 10 && is_numeric($strExten))<br>{<br>$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");<br>fputs($oSocket, "Action: login\r\n");
<br>fputs($oSocket, "Events: off\r\n");<br>fputs($oSocket, "Username: $strUser\r\n");<br>fputs($oSocket, "Secret: $strSecret\r\n\r\n");<br>fputs($oSocket, "Action: originate\r\n");<br>
fputs($oSocket, "Channel: SIP/Telasip-gw4/$strChannel@custom-web-dial-both\r\n"); <br><br>fputs($oSocket, "WaitTime: $strWaitTime\r\n");<br>fputs($oSocket, "CallerId: $strCallerId\r\n");<br>fputs($oSocket, "Exten: $callNumber\r\n");
<br>fputs($oSocket, "Context: custom-web-dial-both-called\r\n"); <br><br>fputs($oSocket, "Priority: 1\r\n\r\n");<br>fputs($oSocket, "Action: Logoff\r\n\r\n");<br>fclose($oSocket);<br>?><br>
<p><br><table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0"><br> <tr><td><br> <font size="2" face="verdana,georgia"
<br>color="#000000">Processing call. Please wait.<br></font><br> </td></tr><br></table><br><br><br><?<br>}<br>else<br>{<br>?><br><p><br><table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0">
<br> <tr><td><br> <form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post"><br> <font size="2" face="verdana,arial,georgia" color="#000000">
<br> Enter the number you are calling from:</font><br> <input type="text" size="20" maxlength="10" name="txtcallernumber"><br> <br> <font size="2" face="verdana,arial,georgia" color="#000000">
<br> Enter the number where you want to call:</font><br> <input type="text" size="20" maxlength="10" name="txtphonenumber"><br> <br> <input type="submit" value="Make Call">
<br> </form><br> </td></tr><br></table><br></p><br><?<br>}<br>?><br></body><br></html><br><br><br><br><span style="font-weight: bold;">Here is the whats in my .confs</span>
<br><br>[custom-web-dial-both]<br>include => outbound-allroutes<br><br>[custom-web-dial-both-called]<br>exten => _.,1,Wait(4)<br>exten => _.,2,Background(beep)<br>include => outbound-allroutes<br>exten => h,1,Hangup
<br><br><br>