[Freeswitch-svn] [commit] r12126 - freeswitch/trunk/scripts
FreeSWITCH SVN
intralanman at freeswitch.org
Tue Feb 17 16:00:30 PST 2009
Author: intralanman
Date: Tue Feb 17 18:00:30 2009
New Revision: 12126
Log:
adding click to call similar to the perl example
Added:
freeswitch/trunk/scripts/call.php
Added: freeswitch/trunk/scripts/call.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/call.php Tue Feb 17 18:00:30 2009
@@ -0,0 +1,31 @@
+<?php
+require_once('ESL.php');
+$my_company_DID = '2135551212';
+$my_company_domain = 'mydomain.com';
+
+$groups = array('default'
+ , 'support'
+ , 'billing'
+ , 'sales'
+);
+
+
+$esl = new ESLconnection('192.168.86.254', '8021', 'ClueCon');
+if (is_array($_REQUEST) && !empty($_REQUEST['callee'])) {
+ $callee = str_replace(array('.', '(', ')', '-', ' '), '', $_REQUEST['callee']);
+ $callee = ereg_replace('^(1|\+1)?([2-9][0-9]{2}[2-9][0-9]{6})$', '1\2', $callee);
+ $group = !empty($_REQUEST['group']) ? $_REQUEST['group'] : 'default';
+ $command_string = "api originate GROUP/$group &transfer($callee LCR)";
+ echo $command_string;
+ $res = $esl->sendRecv($command_string);
+} else {
+ echo "<form><br>\n";
+ echo "Your Number: <input name=\"callee\"><br>\n";
+ echo "Department: <select name=\"group\">";
+ foreach ($groups as $group) {
+ echo "<option value=\"$group\">$group</option>";
+ }
+ echo "</select>";
+ echo "<input type=\"submit\" value=\"Call Me\">";
+ echo "</form>";
+}
More information about the Freeswitch-svn
mailing list