WEB Calling
From KlavoWiki
I have just completed creating a WEB based calling system. It is broken into three different sections.
Point to Point
This allows the ability to type in a source and destination phone number and the 2 calls are then connected together.
<html> <head> <meta http-equiv="Content-Language" content="en-au"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Klaverstyn call back portal</title> </head> <body> <p align="center"><img border="0" src="klaverstyn.jpg" width="521" height="249"></p> <div align="center"> <table border="1" width="500"> <tr> <td width="33%" align="center"><b><font color="#FF0000">Point to Point</font></b></td> <td width="33%" align="center"><a href="conferencing.htm">Conference</a></td> <td width="33%" align="center"><a href="call-back.htm">Call Back</a></td> </tr> </table> </div> <p>Point to Point Calling</p> <table border="0" width="500" cellspacing="0" cellpadding="0"> <tr> <td>By entering your phone number you will receive a phone call from our phone system. Once answered you will be prompted with a menu system allowing you to speed dial predefined people or access a dial tone.</td> </tr> </table> <form method="POST" action="connectme.php"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="120"> </td> <td align="right" width="210">Enter your Phone Number :</td> <td width="35"> </td> <td width="55"><select size="1" name="Source_Area_Code"> <option>02</option> <option>03</option> <option>04</option> <option selected>07</option> <option>08</option> </select></td> <td> <!--webbot bot="Validation" s-data-type="Integer" s-number-separators="x" b-value-required="TRUE" i-minimum-length="8" i-maximum-length="8" --><input type="text" name="Source_Phone_Number" size="8" maxlength="8"></td> <td width="35"> </td> <td> </td> </tr> <tr> <td> </td> <td align="right">Enter destination Number :</td> <td> </td> <td><select size="1" name="Dest_Area_Code"> <option>02</option> <option>03</option> <option>04</option> <option selected>07</option> <option>08</option> </select></td> <td> <!--webbot bot="Validation" s-data-type="Integer" s-number-separators="x" b-value-required="TRUE" i-minimum-length="8" i-maximum-length="8" --><input type="text" name="Dest_Phone_Number" size="8" maxlength="8"></td> <td> </td> <td><input type="submit" value="Submit" name="B3"><input type="reset" value="Reset" name="B4"></td> </tr> </table> </form> </body> </html>
<?php header("Refresh: 5; url=point-to-point.htm"); $Source_No = "$_POST[Source_Area_Code]$_POST[Source_Phone_Number]"; $Dest_No = "$_POST[Dest_Area_Code]$_POST[Dest_Phone_Number]"; $FileName = "$Source_No" . "-" . "$Dest_No.call"; $FileHandle = fopen("/tmp/".$FileName, 'w') or die("can't open file $FileName"); fwrite($FileHandle,"Channel: SIP/GoTalk/$Source_No\n"); fwrite($FileHandle,"Application: Dial\n"); fwrite($FileHandle,"Data: SIP/GoTalk/$Dest_No\n"); fwrite($FileHandle,"Context: internal\n"); fwrite($FileHandle,"MaxRetries: 1\n"); fwrite($FileHandle,"RetryTime: 60\n"); fwrite($FileHandle,"Priority: 1\n"); fwrite($FileHandle,"WaitTime: 20\n"); fclose($FileHandle); rename("/tmp/$FileName", "/var/spool/asterisk/outgoing/$FileName"); print "A call has been placed to $Source_No connecting $Dest_No"; ?>
Conferencing
This will allow you to dial multiple people to join a conference.
<html> <head> <meta http-equiv="Content-Language" content="en-au"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Klaverstyn call back portal</title> </head> <body> <p align="center"><img border="0" src="klaverstyn.jpg" width="521" height="249"></p> <div align="center"> <table border="1" width="500"> <tr> <td width="33%" align="center"><a href="point-to-point.htm">Point to Point</a></td> <td width="33%" align="center"><font color="#FF0000"><b>Conference</b></font></td> <td width="33%" align="center"><a href="call-back.htm">Call Back</a></td> </tr> </table> </div> <p>Conferencing</p> <table border="0" width="500" cellspacing="0" cellpadding="0"> <tr> <td>Please enter the phone number that you would like to participate in a conference call along with the conference room number.</td> </tr> </table> <form method="POST" action="conferencing.php"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="120"> </td> <td align="right" width="210">Enter Phone Number :</td> <td width="35"> </td> <td width="55"><select size="1" name="Area_Code"> <option>02</option> <option>03</option> <option>04</option> <option selected>07</option> <option>08</option> </select></td> <td> <!--webbot bot="Validation" s-data-type="Integer" s-number-separators="x" b-value-required="TRUE" i-minimum-length="8" i-maximum-length="8" --><input type="text" name="Phone_Number" size="8" maxlength="8"></td> <td width="35"> </td> <td> </td> </tr> <tr> <td> </td> <td align="right">Enter Conference Room Number :</td> <td> </td> <td><select size="1" name="Conference_Room"> <option>8205</option> <option>8206</option> <option>8207</option> <option>8208</option> <option>8209</option> <option>8210</option> </select></td> <td> </td> <td> </td> <td><input type="submit" value="Submit" name="B3"><input type="reset" value="Reset" name="B4"></td> </tr> </table> </form> </body> </html>
<?php header("Refresh: 5; url= conferencing.htm"); $Source_No = "$_POST[Area_Code]$_POST[Phone_Number]"; $Dest_No = "$_POST[Conference_Room]"; $FileName = "$Source_No" . "-" . "Conference_Room.call"; $FileHandle = fopen("/tmp/".$FileName, 'w') or die("can't open file $FileName"); fwrite($FileHandle,"Channel: SIP/GoTalk/$Source_No\n"); fwrite($FileHandle,"Application: MeetMe\n"); fwrite($FileHandle,"Data: $Dest_No,1cM(SkyFM-80s)\n"); fwrite($FileHandle,"Context: internal\n"); fwrite($FileHandle,"MaxRetries: 1\n"); fwrite($FileHandle,"RetryTime: 60\n"); fwrite($FileHandle,"Priority: 1\n"); fwrite($FileHandle,"WaitTime: 20\n"); fclose($FileHandle); rename("/tmp/$FileName", "/var/spool/asterisk/outgoing/$FileName"); print "A call has been placed to $Source_No connecting to conference room $Dest_No."; ?>
Call Back
The third option allows a phone number to be dialled and then presented with a menu system allowing the ability to call multiple people. I have not published this as it is more specific to me.