<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:asterisk-users@lists.digium.com"><br>Hi all!<br><br>Can anyone shed some light on a problem with a php to .call file. I am trying to input the number I would like to call, as well as the current phone number where im located. I am able to generate a call to each number, but I am unable to hear or say anything on either phone.....any ideas would be great!
<br><br>PHP File:<br><br><?php<br><br>error_reporting( E_ALL );<br><br>$caller = $_GET[ "caller" ];<br>if( $caller == "" )<br>{ $caller = $_POST[ "caller" ]; }<br>if( $caller == "" )
<br>{ $caller = "18005550000"; }<br><br>$CID = $_GET[ "CID" ];<br>if( $CID == "" )<br>{ $CID = $_POST[ "CID" ]; }<br>if( $CID == "" )<br>{ $CID = "18005551212"; }
<br><br><br>$station_to_call = "SIP/TelaSIP-gw4/15198821111";<br>$spool_dir = "/var/spool/asterisk/outgoing";<br>$temp_dir = $spool_dir . "/tmp" . $caller;<br>$call_file = $temp_dir . "/$caller.call";
<br><br>mkdir( $temp_dir );<br><br>$file = fopen( $call_file, "w" );<br>fputs( $file, "Channel: $station_to_call\n" );<br>fputs( $file, "Callerid: $CID\n" );<br>fputs( $file, "MaxRetries: 5\n" );
<br>fputs( $file, "RetryTime: 300\n" );<br>fputs( $file, "WaitTime: 45\n" );<br>fputs( $file, "Context: outbound-allroutes\n" );<br>fputs( $file, "Extension: $caller\n" );<br>fputs( $file, "Priority: 1\n" );
<br>fclose( $file );<br><br>rename( $call_file, $spool_dir."/$caller.call" );<br>rmdir( $temp_dir );<br><br>Header( "302 Moved" );<br>Header( "Location: index1.html" );<br><br>?><br><br>---Html file---
<br><br><body><br> <form name="calling" method="post" action="place-call.php"><br> <table><br> <tr><br> <td>Phone:</td><br> <td><input name="caller" type="text" id="un">
<br> </td><br> </tr><br> <br> <tr><br> <td>CID:</td><br> <td><input name="CID" type="text" id="un1"><br> </td><br>
</tr><br><br><br><tr><br> <td>&nbsp;</td><br> <td><input type="submit" name="Submit" value="Call Me Now"></td><br> </tr>
<br> </table><br> </form><br><br></body><br></html><br><br></a>