Can anyone see a problem with the below, except for the fact the HTML fields are not all there.
Here is the HTML Part (notice its has not been updated to match PHP.)
-- index.html --:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
<head> <title>Interactive Calling</title> <meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"> </head> <body>
<form name="calling" method="post" action="place-call.php">
<table>
<tr>
<td>Phone:</td>
<td><input name="caller" type="text" id="un">
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Call Me Now"></td>
</tr>
</table>
</form>
<br/>
</html>
And Here is the PHP part:
[code]<?php
error_reporting( E_ALL );
$caller = $_GET[ “caller” ];
if( $caller == “” )
{ $caller = $_POST[ “caller” ]; }
if( $caller == “” )
{ $caller = “15197777777”; }
$callee = $_GET[ “callee” ];
if( $callee == “” )
{ $callee = $_POST[ “callee” ]; }
if( $callee == “” )
{ $callee = “15198888888”; }
$station_to_call = “SIP/SIPPROVIDER/$calee”; $spool_dir =
"/var/spool/asterisk/outgoing"; $temp_dir = $spool_dir . “/tmp” .
$caller; $call_file = $temp_dir . “/$caller.call”;
mkdir( $temp_dir );
$file = fopen( $call_file, “w” );
fputs( $file, “Channel: $station_to_call\n” ); fputs( $file,
“Callerid: $caller\n” ); fputs( $file, “MaxRetries: 1\n” ); fputs(
$file, “RetryTime: 60\n” ); fputs( $file, “WaitTime: 30\n” ); fputs(
$file, “Context: dial_auto\n” ); fputs( $file, “Extension: $caller\n” ); fputs( $file, “Priority: 1\n” ); fclose( $file );
rename( $call_file, $spool_dir."/$caller.call" ); rmdir( $temp_dir );
Header( “302 Moved” );
Header( “Location: index.html” );
?>
[/code]