I am able to get this script to dial, but I am unable to talk or hear anything. The script asks for the number to call and the the caller id to display (if user is not at their normal extension). Once submitted, the external extension receives a call, once answered the call is then placed to the dentition number.
<br><br>The script works as the call is place, but I cannot hear or say anything. Any one that is able to get this going I would be will to give $20 to (via paypal)<br><br><br><html><br><head><br><title>call</title>
<br></head><br><body><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>#specify the channel (extension) you want to receive the call requests with<br>#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc<br>$strChannel = "Local/15555555555@outrt-001-telasip";<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><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>#Shouldn't need to edit anything below this point to make this script work<br>#--------------------------------------------------------------------------------------------<br>#get the phone number from the posted form
<br>$strExten = $_POST['txtphonenumber'];<br><br>#specify the caller id for the call<br>$strCallerId = $_POST['txtcid'];<br><br>$length = strlen($strExten);<br><br>if ($length == 11 && 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: $strChannel\r\n");<br>fputs($oSocket, "WaitTime: $strWaitTime\r\n");
<br>fputs($oSocket, "CallerId: $strCallerId\r\n");<br>fputs($oSocket, "Exten: $strExten\r\n");<br>fputs($oSocket, "Context: $strContext\r\n");<br>fputs($oSocket, "Priority: $strPriority\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="#630000" cellpadding="3" cellspacing="0">
<br> <tr><td><br> <font size="2" face="verdana,georgia" color="#630000">We are currently trying to call you. Please be patient, and wait for<br> your phone to ring!<br>If your phone does not ring after 2 minutes, we apologize, but must either be out, or
<br>already on the<br> phone.<br><a href="<? echo $_SERVER['PHP_SELF'] ?>">Try Again</a></font><br> </td></tr><br></table><br></p><br><?<br>
}<br>else<br>{<br>?><br><br><br><div align="center"><br> <table width="300" border="1" bordercolor="#630000" cellpadding="3" cellspacing="0"><br>
<tr><br> <td><form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post"><br> <p align="left"><font size="2" face="verdana,arial,georgia" color="#630000">Enter number to call (11 Digits):</font></p>
<br> <p align="center"><br> <input type="text" size="20" maxlength="11" name="txtphonenumber"><br> </p><br> <p><font size="2" face="verdana,arial,georgia" color="#630000">Enter your caller ID</font>:</p>
<br> <p align="center"><br> <input type="text" size="20" maxlength="11" name="txtcid"><br> </p><br> <p><br> <input type="submit" value="Make Call">
<br> </p><br> </form> </td></tr><br> </table><br> </p><br> <?<br>}<br>?><br></div><br></body><br></html><br><br><br>