aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rwxr-xr-xconfig/freeswitch/freeswitch.inc530
-rw-r--r--config/freeswitch/freeswitch.xml2
-rwxr-xr-xconfig/freeswitch/freeswitch_cmd.tmp2
-rw-r--r--config/freeswitch/freeswitch_dialplan.xml2
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes.tmp48
-rwxr-xr-xconfig/freeswitch/freeswitch_dialplan_includes_details.tmp2
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp78
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes_edit.tmp158
-rw-r--r--config/freeswitch/freeswitch_extensions.tmp30
-rw-r--r--config/freeswitch/freeswitch_extensions_edit.tmp62
-rw-r--r--config/freeswitch/freeswitch_features.php38
-rw-r--r--config/freeswitch/freeswitch_gateways.tmp32
-rw-r--r--config/freeswitch/freeswitch_gateways_edit.tmp130
-rw-r--r--config/freeswitch/freeswitch_ivr.tmp34
-rw-r--r--config/freeswitch/freeswitch_ivr_edit.tmp144
-rwxr-xr-xconfig/freeswitch/freeswitch_ivr_options.tmp2
-rw-r--r--config/freeswitch/freeswitch_ivr_options_edit.tmp28
-rwxr-xr-xconfig/freeswitch/freeswitch_mailto.tmp78
-rw-r--r--config/freeswitch/freeswitch_modules.xml2
-rw-r--r--config/freeswitch/freeswitch_public_includes.tmp44
-rwxr-xr-xconfig/freeswitch/freeswitch_public_includes_details.tmp2
-rw-r--r--config/freeswitch/freeswitch_public_includes_details_edit.tmp92
-rw-r--r--config/freeswitch/freeswitch_public_includes_edit.tmp154
-rw-r--r--config/freeswitch/freeswitch_recordings.tmp128
-rw-r--r--config/freeswitch/freeswitch_recordings_edit.tmp18
-rwxr-xr-xconfig/freeswitch/freeswitch_recordings_play.tmp10
-rw-r--r--config/freeswitch/freeswitch_status.tmp50
-rw-r--r--config/freeswitch/freeswitch_time_conditions.tmp16
-rw-r--r--config/freeswitch/freeswitch_time_conditions_edit.tmp24
29 files changed, 970 insertions, 970 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc
index f53b0878..5d0c2c9c 100755
--- a/config/freeswitch/freeswitch.inc
+++ b/config/freeswitch/freeswitch.inc
@@ -6,7 +6,7 @@
freeswitch.inc
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
*/
@@ -56,7 +56,7 @@ function guid()
//echo guid();
-function pkg_is_service_running($servicename)
+function pkg_is_service_running($servicename)
{
exec("/bin/ps ax | awk '{ print $5 }'", $psout);
array_shift($psout);
@@ -72,10 +72,10 @@ function pkg_is_service_running($servicename)
}
-function event_socket_create($host, $port, $password)
+function event_socket_create($host, $port, $password)
{
//$host has been deprecated
-
+
//build the interface list
$i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
@@ -86,15 +86,15 @@ function event_socket_create($host, $port, $password)
foreach ($ifdescrs as $ifdescr => $ifname){
$ifinfo = get_interface_info($ifdescr);
$interface_ip_address = $ifinfo['ipaddr'];
-
+
if (strlen($interface_ip_address) > 0) {
$fp = fsockopen($interface_ip_address, $port, $errno, $errdesc, 3);
socket_set_blocking($fp,false);
-
+
if (!$fp) {
- //connection failed continue through the loop testing other addresses
- //invalid handle
+ //connection failed continue through the loop testing other addresses
+ //invalid handle
}
else {
//connected to the socket return the handle
@@ -107,20 +107,20 @@ function event_socket_create($host, $port, $password)
break;
}
}
- return $fp;
- }
-
+ return $fp;
+ }
+
} //end if interface_ip_address
- } //end foreach
+ } //end foreach
} //end function
-function event_socket_request($fp, $cmd)
+function event_socket_request($fp, $cmd)
{
- if ($fp) {
- fputs($fp, $cmd."\n\n");
+ if ($fp) {
+ fputs($fp, $cmd."\n\n");
usleep(100); //allow time for reponse
-
+
$response = "";
$i = 0;
$contentlength = 0;
@@ -129,7 +129,7 @@ function event_socket_request($fp, $cmd)
if ($contentlength > 0) {
$response .= $buffer;
}
-
+
if ($contentlength == 0) { //if contentlenght is already don't process again
if (strlen(trim($buffer)) > 0) { //run only if buffer has content
$temparray = split(":", trim($buffer));
@@ -138,21 +138,21 @@ function event_socket_request($fp, $cmd)
}
}
}
-
+
usleep(100); //allow time for reponse
-
+
//optional because of script timeout //don't let while loop become endless
- if ($i > 10000) { break; }
-
+ if ($i > 10000) { break; }
+
if ($contentlength > 0) { //is contentlength set
//stop reading if all content has been read.
- if (strlen($response) >= $contentlength) {
+ if (strlen($response) >= $contentlength) {
break;
}
}
$i++;
}
-
+
return $response;
}
else {
@@ -165,7 +165,7 @@ function event_socket_request_cmd($cmd)
{
global $config;
$password = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'];
- $port = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'];
+ $port = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'];
$host = $config['interfaces']['lan']['ipaddr'];
if (pkg_is_service_running('freeswitch')) {
@@ -191,9 +191,9 @@ function byte_convert( $bytes ) {
function recording_js()
{
- global $config;
+ global $config;
$admin_pin = $config['installedpackages']['freeswitchsettings']['config'][0]['admin_pin'];
-
+
$fout = fopen("/usr/local/freeswitch/scripts/recordings.js","w");
$tmp = " var pin = \"".$admin_pin."\";\n";
$tmp .= " //var pin = \"\"; //don't require a pin\n";
@@ -254,9 +254,9 @@ function recording_js()
//$tmp .= " session.execute(\"set\", \"tts_engine=flite\");\n";
//$tmp .= " session.execute(\"set\", \"tts_voice=kal\");\n";
//$tmp .= " session.execute(\"speak\", \"Please enter your pin number now.\");\n";
- $tmp .= " digitmaxlength = 6;\n";
+ $tmp .= " digitmaxlength = 6;\n";
$tmp .= " session.execute(\"set\", \"playback_terminators=#\");\n";
- $tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/please_enter_your_pin_number.wav\", mycb, \"dtmf\");\n";
+ $tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/please_enter_your_pin_number.wav\", mycb, \"dtmf\");\n";
$tmp .= " session.collectInput( mycb, dtmf, timeoutpin );\n";
$tmp .= " }\n";
$tmp .= "\n";
@@ -265,7 +265,7 @@ function recording_js()
//$tmp .= " session.execute(\"set\", \"tts_engine=flite\");\n";
//$tmp .= " session.execute(\"set\", \"tts_voice=kal\");\n";
//$tmp .= " session.execute(\"speak\", \"Begin recording.\");\n";
- $tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/begin_recording.wav\", mycb, \"dtmf\");\n";
+ $tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/begin_recording.wav\", mycb, \"dtmf\");\n";
$tmp .= " session.execute(\"set\", \"playback_terminators=#\");\n";
$tmp .= " session.execute(\"record\", \"/usr/local/freeswitch/recordings/temp\"+Year+Month+Day+Hours+Mins+Seconds+\".wav 180 200\");\n";
$tmp .= " }\n";
@@ -285,13 +285,13 @@ function recording_js()
}
-
+
function sync_package_freeswitch_settings()
{
- global $config;
+ global $config;
if($config['installedpackages']['freeswitchsettings']['config'] != "") {
-
+
conf_mount_rw();
config_unlock();
@@ -312,12 +312,12 @@ function sync_package_freeswitch_settings()
fwrite($fout, $tmpxml);
unset($tmpxml);
fclose($fout);
-
+
$fout = fopen("/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml","w");
$tmpxml = "<configuration name=\"event_socket.conf\" description=\"Socket Client\">\n";
$tmpxml .= " <settings>\n";
$tmpxml .= " <param name=\"listen-ip\" value=\"0.0.0.0\"/>\n";
- $tmpxml .= " <param name=\"listen-port\" value=\"" . $rowhelper['event_socket_port'] . "\"/>\n";
+ $tmpxml .= " <param name=\"listen-port\" value=\"" . $rowhelper['event_socket_port'] . "\"/>\n";
$tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['event_socket_password'] . "\"/>\n";
$tmpxml .= " <!--<param name=\"apply-inbound-acl\" value=\"lan\"/>-->\n";
$tmpxml .= " </settings>\n";
@@ -325,8 +325,8 @@ function sync_package_freeswitch_settings()
fwrite($fout, $tmpxml);
unset($tmpxml, $event_socket_password);
fclose($fout);
-
- $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/xml_rpc.conf","w");
+
+ $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/xml_rpc.conf","w");
$tmpxml = "<configuration name=\"xml_rpc.conf\" description=\"XML RPC\">\n";
$tmpxml .= " <settings>\n";
$tmpxml .= " <!-- The port where you want to run the http service (default 8080) -->\n";
@@ -340,11 +340,11 @@ function sync_package_freeswitch_settings()
fwrite($fout, $tmpxml);
unset($tmpxml, $event_socket_password);
fclose($fout);
-
+
recording_js();
-
+
}
-
+
conf_mount_ro();
$cmd = "api reloadxml";
//event_socket_request_cmd($cmd);
@@ -359,12 +359,12 @@ function sync_package_freeswitch_dialplan()
global $config;
conf_mount_rw();
config_unlock();
-
+
if(strlen($config['installedpackages']['freeswitchdialplan']['config'][0]['dialplan_default_xml']) == 0) {
/* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */
$filename = "/usr/local/freeswitch/conf/dialplan/default.xml";
$fout = fopen($filename,"r");
- $tmpxml = fread($fout, filesize($filename));
+ $tmpxml = fread($fout, filesize($filename));
$config['installedpackages']['freeswitchdialplan']['config'][0]['dialplan_default_xml'] = base64_encode($tmpxml);
unset($filename, $dialplan);
fclose($fout);
@@ -389,13 +389,13 @@ function sync_package_freeswitch_dialplan()
function sync_package_freeswitch_extensions()
{
- global $config;
+ global $config;
if($config['installedpackages']['freeswitchextensions']['config'] != "") {
conf_mount_rw();
config_unlock();
- /* delete all old extensions to prepare for new ones */
+ /* delete all old extensions to prepare for new ones */
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/1*.xml");
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/2*.xml");
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/3*.xml");
@@ -411,7 +411,7 @@ function sync_package_freeswitch_extensions()
$fout = fopen("/usr/local/freeswitch/conf/directory/default/".$rowhelper['extension'].".xml","w");
$tmpxml = "<include>\n";
- if (strlen($rowhelper['cidr']) == 0) {
+ if (strlen($rowhelper['cidr']) == 0) {
$tmpxml .= " <user id=\"" . $rowhelper['extension'] . "\" mailbox=\"" . $rowhelper['mailbox'] . "\">\n";
}
else {
@@ -422,7 +422,7 @@ function sync_package_freeswitch_extensions()
$tmpxml .= " <param name=\"vm-password\" value=\"" . $rowhelper['vm-password'] . "\"/>\n";
if (strlen($rowhelper['vm-mailto']) > 0) {
$tmpxml .= " <param name=\"vm-email-all-messages\" value=\"true\"/>\n";
-
+
switch ($rowhelper['vm-attach-file']) {
case "true":
$tmpxml .= " <param name=\"vm-attach-file\" value=\"true\"/>\n";
@@ -436,8 +436,8 @@ function sync_package_freeswitch_extensions()
$tmpxml .= " <param name=\"vm-mailto\" value=\"" . $rowhelper['vm-mailto'] . "\"/>\n";
}
- if (strlen($rowhelper['auth-acl']) > 0) {
- $tmpxml .= " <param name=\"auth-acl\" value=\"" . $rowhelper['auth-acl'] . "\"/>\n";
+ if (strlen($rowhelper['auth-acl']) > 0) {
+ $tmpxml .= " <param name=\"auth-acl\" value=\"" . $rowhelper['auth-acl'] . "\"/>\n";
}
$tmpxml .= " </params>\n";
$tmpxml .= " <variables>\n";
@@ -459,26 +459,26 @@ function sync_package_freeswitch_extensions()
unset($tmpxml);
fclose($fout);
}
-
+
conf_mount_ro();
$cmd = "api reloadxml";
//event_socket_request_cmd($cmd);
unset($cmd);
- }
+ }
}
function sync_package_freeswitch_gateways()
{
- global $config;
+ global $config;
if($config['installedpackages']['freeswitchgateways']['config'] != "") {
-
+
conf_mount_rw();
config_unlock();
- /* delete all old gateways to prepare for new ones */
+ /* delete all old gateways to prepare for new ones */
unlink_if_exists("/usr/local/freeswitch/conf/sip_profiles/external/*.xml");
foreach($config['installedpackages']['freeswitchgateways']['config'] as $rowhelper) {
@@ -493,7 +493,7 @@ function sync_package_freeswitch_gateways()
}
if (strlen($rowhelper['password']) > 0) {
$tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n";
- }
+ }
if (strlen($rowhelper['realm']) > 0) {
$tmpxml .= " <param name=\"realm\" value=\"" . $rowhelper['realm'] . "\"/>\n";
}
@@ -514,7 +514,7 @@ function sync_package_freeswitch_gateways()
}
if (strlen($rowhelper['register-transport']) > 0) {
$tmpxml .= " <param name=\"register-transport\" value=\"" . $rowhelper['register-transport'] . "\"/>\n";
- }
+ }
if (strlen($rowhelper['retry-seconds']) > 0) {
$tmpxml .= " <param name=\"retry-seconds\" value=\"" . $rowhelper['retry-seconds'] . "\"/>\n";
}
@@ -529,38 +529,38 @@ function sync_package_freeswitch_gateways()
}
if (strlen($rowhelper['supress-cng']) > 0) {
$tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n";
- }
+ }
$tmpxml .= " </gateway>\n";
$tmpxml .= "</include>";
-
+
fwrite($fout, $tmpxml);
unset($tmpxml);
fclose($fout);
- }
-
+ }
+
}
-
+
conf_mount_ro();
$cmd = "api sofia profile external restart reloadxml";
//event_socket_request_cmd($cmd);
unset($cmd);
-
+
}
-
+
}
function sync_package_freeswitch_modules()
{
-
+
global $config;
conf_mount_rw();
config_unlock();
foreach($config['installedpackages']['freeswitchmodules']['config'] as $rowhelper) {
$fout = fopen("/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml","w");
-
+
$tmpxml ="";
$tmpxml .= "<configuration name=\"modules.conf\" description=\"Modules\">\n";
$tmpxml .= " <modules>\n";
@@ -682,12 +682,12 @@ function sync_package_freeswitch_public()
global $config;
conf_mount_rw();
config_unlock();
-
+
if(strlen($config['installedpackages']['freeswitchpublic']['config'][0]['public_xml']) == 0) {
/* dialplan_public_xml not found in the pfsense config.xml get the default public.xml and save to config.xml. */
$filename = "/usr/local/freeswitch/conf/dialplan/public.xml";
$fout = fopen($filename,"r");
- $tmpxml = fread($fout, filesize($filename));
+ $tmpxml = fread($fout, filesize($filename));
$tmpxml = str_replace("<anti-action application=\"export\" data=\"domain_name=\${sip_req_host}\"/>", "<!--<anti-action application=\"export\" data=\"domain_name=\${sip_req_host}\"/>-->", $tmpxml);
$config['installedpackages']['freeswitchpublic']['config'][0]['public_xml'] = base64_encode($tmpxml);
unset($filename, $tmpxml);
@@ -716,12 +716,12 @@ function sync_package_freeswitch_vars()
global $config;
conf_mount_rw();
config_unlock();
-
+
if(strlen($config['installedpackages']['freeswitchvars']['config'][0]['vars_xml']) == 0) {
/* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */
$filename = "/usr/local/freeswitch/conf/vars.xml";
$fout = fopen($filename,"r");
- $tmpxml = fread($fout, filesize($filename));
+ $tmpxml = fread($fout, filesize($filename));
$config['installedpackages']['freeswitchvars']['config'][0]['vars_xml'] = base64_encode($tmpxml);
unset($filename, $dialplan);
fclose($fout);
@@ -748,12 +748,12 @@ function sync_package_freeswitch_internal()
global $config;
conf_mount_rw();
config_unlock();
-
+
if(strlen($config['installedpackages']['freeswitchinternal']['config'][0]['internal_xml']) == 0) {
/* internal_xml not found in the pfsense config.xml get the internal.xml and save to config.xml. */
$filename = "/usr/local/freeswitch/conf/sip_profiles/internal.xml";
$fout = fopen($filename,"r");
- $tmpxml = fread($fout, filesize($filename));
+ $tmpxml = fread($fout, filesize($filename));
$config['installedpackages']['freeswitchinternal']['config'][0]['internal_xml'] = base64_encode($tmpxml);
unset($filename, $dialplan);
fclose($fout);
@@ -780,12 +780,12 @@ function sync_package_freeswitch_external()
global $config;
conf_mount_rw();
config_unlock();
-
+
if(strlen($config['installedpackages']['freeswitchexternal']['config'][0]['external_xml']) == 0) {
/* external_xml not found in the pfsense config.xml get the external.xml and save to config.xml. */
$filename = "/usr/local/freeswitch/conf/sip_profiles/external.xml";
$fout = fopen($filename,"r");
- $tmpxml = fread($fout, filesize($filename));
+ $tmpxml = fread($fout, filesize($filename));
$config['installedpackages']['freeswitchexternal']['config'][0]['external_xml'] = base64_encode($tmpxml);
unset($filename, $dialplan);
fclose($fout);
@@ -818,9 +818,9 @@ function get_recording_filename($id)
return $rowhelper['filename'];
}
}
- }
+ }
}
-
+
function sync_package_freeswitch_ivr()
{
@@ -830,37 +830,37 @@ function sync_package_freeswitch_ivr()
config_lock();
$a_ivr = &$config['installedpackages']['freeswitchivr']['config'];
- if (count($a_ivr) > 0) {
+ if (count($a_ivr) > 0) {
foreach($a_ivr as $rowhelper) {
/*
$rowhelper['ivrid']
$rowhelper['ivrextension']
$rowhelper['ivrname']
- $rowhelper['recordingid']
+ $rowhelper['recordingid']
$rowhelper['ivrtimeout']
$rowhelper['ivrcontext']
$rowhelper['ivrconditionjs']
- $rowhelper['ivrdescr']
+ $rowhelper['ivrdescr']
*/
-
+
$a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config'];
- $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
+ $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
-
+
//add the IVR to the dialplan
if (strlen($rowhelper['ivrid']) > 0) {
$action = 'add'; //set default action to add
$i = 0;
if (count($a_dialplan_includes) > 0) {
foreach($a_dialplan_includes as $row) {
-
+
//$row['dialplanincludeid'];
//$row['extensionname'];
//$row['context'];
//$row['enabled'];
//echo "if (".$row['opt1name']." == \"ivrid\" && ".$row['opt1value']." == ".$rowhelper['ivrid'].") {\n";
-
+
if ($row['opt1name'] == "ivrid" && $row['opt1value'] == $rowhelper['ivrid']) {
//update
$action = 'update';
@@ -873,18 +873,18 @@ function sync_package_freeswitch_ivr()
$opt1name = $row['opt1name'];
$opt1value = $row['opt1value'];
$id = $i;
- //echo "update".$i."<br />\n";
+ //echo "update".$i."<br />\n";
}
$i++;
-
+
}
}
-
-
+
+
$ent = array();
if ($action == 'add') {
-
+
$dialplanincludeid = guid();
$ent['dialplanincludeid'] = $dialplanincludeid;
$ent['extensionname'] = $rowhelper['ivrextension'];
@@ -894,7 +894,7 @@ function sync_package_freeswitch_ivr()
$ent['descr'] = 'IVR';
$ent['opt1name'] = 'ivrid';
$ent['opt1value'] = $rowhelper['ivrid'];
-
+
//add to the config
$a_dialplan_includes[] = $ent;
unset($ent);
@@ -906,7 +906,7 @@ function sync_package_freeswitch_ivr()
$ent['fielddata'] = '^'.$rowhelper['ivrextension'].'$';
$a_dialplan_include_details[] = $ent;
unset($ent);
-
+
$ivrid = str_replace(array("{", "}"), "", $rowhelper['ivrid']);
$ent = array();
@@ -921,7 +921,7 @@ function sync_package_freeswitch_ivr()
}
if ($action == 'update') {
-
+
$ent['dialplanincludeid'] = $dialplanincludeid;
$ent['extensionname'] = $rowhelper['ivrextension'];
$ent['order'] = $order;
@@ -950,7 +950,7 @@ function sync_package_freeswitch_ivr()
unset($dialplanincludeid);
} //end if strlen ivrid; add the IVR to the dialplan
-
+
// Build the IVR javascript
$recording_action_filename = get_recording_filename($rowhelper['recordingidaction']);
$recording_antiaction_filename = get_recording_filename($rowhelper['recordingidantiaction']);
@@ -964,8 +964,8 @@ function sync_package_freeswitch_ivr()
$cmd = "api global_getvar domain";
$domain = trim(event_socket_request($fp, $cmd));
}
-
-
+
+
$tmp = ""; //make sure the variable starts with no value
$tmp .= "\n";
$tmp .= " var condition = true;\n";
@@ -1017,17 +1017,17 @@ function sync_package_freeswitch_ivr()
$tmp .= " }\n";
$tmp .= " return( true );\n";
$tmp .= " } //end function mycb\n";
-
+
$tmp .= "\n";
$tmp .= base64_decode($rowhelper['ivrconditionjs']);
$tmp .= "\n";
$tmp .= "\n";
-
+
//$tmp .= " //condition = true; //debugging\n";
$actiondirect = false;
$actioncount = 0;
- foreach($config['installedpackages']['freeswitchivroptions']['config'] as $row) {
+ foreach($config['installedpackages']['freeswitchivroptions']['config'] as $row) {
//find the correct IVR options with the correct action
if ($row['ivrid'] == $rowhelper['ivrid']) {
if ($row['optionaction'] == "action") {
@@ -1076,23 +1076,23 @@ function sync_package_freeswitch_ivr()
$tmp .= " dtmf.digits += session.getDigits(1, \"#\", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
$tmp .= " if (dtmf.digits == 0) {\n";
//$tmp .= " console_log( "info", "time out option: " + dtmf.digits + "\n" );\n";
-
- $a_ivr_options = &$config['installedpackages']['freeswitchivroptions']['config'];
+
+ $a_ivr_options = &$config['installedpackages']['freeswitchivroptions']['config'];
//find the timeout IVR options with the correct action
if (count($a_ivr_options) > 0) {
- foreach($a_ivr_options as $row) {
+ foreach($a_ivr_options as $row) {
if ($row['ivrid'] == $rowhelper['ivrid']) {
-
+
if ($row['optionaction'] == "action") {
- if (strtolower($row['optionnumber']) == "t") {
+ if (strtolower($row['optionnumber']) == "t") {
if ($row['optiontype'] == "extension") {
$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
}
if ($row['optiontype'] == "voicemail") {
//$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ }
}
} //end anti-action
@@ -1100,14 +1100,14 @@ function sync_package_freeswitch_ivr()
} //end for each
} //if count
-
-
+
+
$tmp .= " }\n";
$tmp .= " else {\n";
$tmp .= " break; //dtmf found end the while loop\n";
- $tmp .= " }\n";
- $tmp .= " }\n";
- $tmp .= " }\n";
+ $tmp .= " }\n";
+ $tmp .= " }\n";
+ $tmp .= " }\n";
$tmp .= " }\n";
$tmp .= "\n";
$tmp .= " //pickup the remaining digits\n";
@@ -1128,35 +1128,35 @@ function sync_package_freeswitch_ivr()
$a_ivr_options = &$config['installedpackages']['freeswitchivroptions']['config'];
if (count($a_ivr_options) > 0) {
foreach($a_ivr_options as $row) {
-
+
/*
$row['ivrid']
$row['optionnumber']
$row['optiontype']
$row['optionaction']
$row['optiondest']
- $row['optiondescr']
+ $row['optiondescr']
*/
-
- $tmpactiondefault = "";
-
+
+ $tmpactiondefault = "";
+
//find the correct IVR options with the correct action
if ($row['ivrid'] == $rowhelper['ivrid']){
-
+
if ($row['optionaction'] == "action") {
//$tmpaction .= "\n";
-
+
switch ($row['optionnumber']) {
//case "t":
-
+
//if ($row['optiontype'] == "extension") {
// $tmpactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
//}
//if ($row['optiontype'] == "voicemail") {
// //$tmpactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
// $tmpactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- //}
-
+ //}
+
//break;
default:
//$tmpaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n";
@@ -1172,17 +1172,17 @@ function sync_package_freeswitch_ivr()
if ($row['optiontype'] == "voicemail") {
//$tmpaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmpaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ }
$tmpaction .= " }\n";
-
+
}
-
+
$x++;
- } //end if action
+ } //end if action
} //end ivrid
-
+
} //end foreach
} //end if count
@@ -1193,9 +1193,9 @@ function sync_package_freeswitch_ivr()
//$tmp .= $tmpactiondefault;
$tmp .= " }\n";
$tmp .= "\n";
- unset($tmpaction);
+ unset($tmpaction);
+
-
$tmp .= " } \n";
//$tmp .= " else if ( dtmf.digits.length == \"3\" ) {\n";
//$tmp .= " //Transfer to the extension the caller chose\n";
@@ -1207,13 +1207,13 @@ function sync_package_freeswitch_ivr()
$tmp .= " } //end if session.ready\n";
$tmp .= "\n";
$tmp .= " }\n"; //end if condition
-
+
} //if ($actiondirect) {
} //actioncount
-
+
$antiactiondirect = false;
$antiactioncount = 0;
- foreach($config['installedpackages']['freeswitchivroptions']['config'] as $row) {
+ foreach($config['installedpackages']['freeswitchivroptions']['config'] as $row) {
//find the correct IVR options with the correct action
if ($row['ivrid'] == $rowhelper['ivrid']) {
if ($row['optionaction'] == "anti-action") {
@@ -1228,7 +1228,7 @@ function sync_package_freeswitch_ivr()
}
//$tmp .= "anti-action count: ".$antiactioncount."<br />\n";
-
+
if ($antiactioncount > 0) {
if ($antiactiondirect) {
$tmp .= " else {\n";
@@ -1261,40 +1261,40 @@ function sync_package_freeswitch_ivr()
$tmp .= " dtmf.digits += session.getDigits(1, \"#\", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
$tmp .= " if (dtmf.digits == 0) {\n";
//$tmp .= " console_log( "info", "time out option: " + dtmf.digits + "\n" );\n";
-
-
+
+
//find the timeout IVR options with the correct action
if (count($a_ivr_options) > 0) {
foreach($a_ivr_options as $row) {
if ($row['ivrid'] == $rowhelper['ivrid']) {
-
+
if ($row['optionaction'] == "anti-action") {
- if (strtolower($row['optionnumber']) == "t") {
-
+ if (strtolower($row['optionnumber']) == "t") {
+
if ($row['optiontype'] == "extension") {
$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
}
if ($row['optiontype'] == "voicemail") {
//$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ }
}
-
+
} //end anti-action
} //end ivrid
} //end for each
} //if count
-
-
+
+
$tmp .= " }\n";
$tmp .= " else {\n";
$tmp .= " break; //dtmf found end the while loop\n";
$tmp .= " }\n";
-
- $tmp .= " }\n";
+
+ $tmp .= " }\n";
$tmp .= " }\n";
$tmp .= " }\n";
$tmp .= "\n";
@@ -1307,48 +1307,48 @@ function sync_package_freeswitch_ivr()
$tmp .= "\n";
-
+
$tmpantiaction = "";
$tmp .= " if ( dtmf.digits.length > \"0\" ) {\n";
-
+
$x = 0;
if (count($a_ivr_options) > 0) {
foreach($a_ivr_options as $row) {
-
+
/*
$row['ivrid']
$row['optionnumber']
$row['optiontype']
$row['optionaction']
$row['optiondest']
- $row['optiondescr']
+ $row['optiondescr']
*/
//$tmpantiactiondefault = "";
-
+
//find the correct IVR options with the correct action
if ($row['ivrid'] == $rowhelper['ivrid']) {
-
+
if ($row['optionaction'] == "anti-action") {
-
+
switch ($row['optionnumber']) {
//case "t":
-
+
//if ($row['optiontype'] == "extension") {
// $tmpantiactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
//}
//if ($row['optiontype'] == "voicemail") {
// //$tmpantiactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
// $tmpantiactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- //}
-
+ //}
+
//break;
default:
//$tmpantiaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n";
if ($x == 0) {
- $tmpantiaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n";
+ $tmpantiaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n";
}
else {
$tmpantiaction .= " else if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n";
@@ -1360,13 +1360,13 @@ function sync_package_freeswitch_ivr()
if ($row['optiontype'] == "voicemail") {
//$tmpantiaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmpantiaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ }
$tmpantiaction .= " }\n";
-
+
} //end switch
-
- $x++;
+
+ $x++;
} //end anti-action
} //end ivrid
@@ -1374,15 +1374,15 @@ function sync_package_freeswitch_ivr()
} //end for each
} //if count
-
+
$tmp .= $tmpantiaction;
$tmp .= " else {\n";
- $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n";
+ $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n";
//$tmp .= $tmpantiactiondefault;
$tmp .= " }\n";
$tmp .= "\n";
unset($tmpantiaction);
-
+
$tmp .= " } \n";
//$tmp .= " else if ( dtmf.digits.length == \"3\" ) {\n";
//$tmp .= " //Transfer to the extension the caller chose\n";
@@ -1395,22 +1395,22 @@ function sync_package_freeswitch_ivr()
$tmp .= " } //end if session.ready\n";
$tmp .= "\n";
$tmp .= " } //end if condition";
-
+
} //if ($antiactiondirect) {
} //antiactioncount
unset($tmpactiondefault);
- unset($tmpantiactiondefault);
-
+ unset($tmpantiactiondefault);
+
if (strlen($rowhelper['ivrid']) > 0) {
- $ivrfilename = "ivr_".str_replace(array("{", "}"), "", $rowhelper['ivrid']).".js";
+ $ivrfilename = "ivr_".str_replace(array("{", "}"), "", $rowhelper['ivrid']).".js";
$fout = fopen("/usr/local/freeswitch/scripts/".$ivrfilename,"w");
fwrite($fout, $tmp);
unset($ivrfilename);
fclose($fout);
}
-
- } //end foreach
- } //end if count
+
+ } //end foreach
+ } //end if count
conf_mount_ro();
config_unlock();
@@ -1427,73 +1427,73 @@ function sync_package_freeswitch_dialplan_includes()
$a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config'];
$a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
-
+
if (count($a_dialplan_includes) > 0) {
foreach($config['installedpackages']['freeswitchdialplanincludes']['config'] as $rowhelper) {
$tmp = "";
$tmp .= "\n";
-
+
//$rowhelper['dialplanincludeid'];
//$rowhelper['extensionname'];
//$rowhelper['context'];
//$rowhelper['enabled'];
-
+
$tmp = "<extension name=\"".$rowhelper['extensionname']."\">\n";
-
- if (count($a_dialplan_include_details) > 0) {
-
+
+ if (count($a_dialplan_include_details) > 0) {
+
$conditioncount = 0;
$i = 0;
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "condition" && $rowhelper['dialplanincludeid'] == $ent['dialplanincludeid']) {
$conditioncount++;
$i++;
- }
+ }
}
-
+
$i = 1;
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "condition" && $rowhelper['dialplanincludeid'] == $ent['dialplanincludeid']) {
- if ($conditioncount == 1) { //single condition
+ if ($conditioncount == 1) { //single condition
//start tag
- $tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
+ $tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
}
- else { //more than one condition
- if ($i < $conditioncount) {
+ else { //more than one condition
+ if ($i < $conditioncount) {
//all tags should be self-closing except the last one
$tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\"/>\n";
}
else {
- //for the last tag use the start tag
+ //for the last tag use the start tag
$tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
}
}
$i++;
}
} //end for each
-
+
} //end if count
-
+
if (count($a_dialplan_include_details) > 0) {
$i = 0;
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "action" && $rowhelper['dialplanincludeid'] == $ent['dialplanincludeid']) {
- $tmp .= " <action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
- }
- $i++;
+ $tmp .= " <action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
+ }
+ $i++;
}
}
-
+
if (count($a_dialplan_include_details) > 0) {
$i = 0;
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "anti-action" && $rowhelper['dialplanincludeid'] == $ent['dialplanincludeid']) {
$tmp .= " <anti-action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
- }
- $i++;
+ }
+ $i++;
}
}
-
+
//if (count($a_dialplan_include_details) > 0) {
//foreach ($a_dialplan_include_details as $ent) {
// $i = 0;
@@ -1501,38 +1501,38 @@ function sync_package_freeswitch_dialplan_includes()
//$ent['tag']
//$ent['fieldtype']
//$ent['fielddata']
- // }
- // $i++;
+ // }
+ // $i++;
// }
//}
-
+
if ($conditioncount > 0) {
$tmp .= " </condition>\n";
}
- unset ($conditioncount);
+ unset ($conditioncount);
$tmp .= "</extension>\n";
-
-
+
+
if ($rowhelper['enabled'] == "true") {
- $dialplanincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
+ $dialplanincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
$fout = fopen("/usr/local/freeswitch/conf/dialplan/default/".$dialplanincludefilename,"w");
fwrite($fout, $tmp);
- fclose($fout);
+ fclose($fout);
}
unset($dialplanincludefilename);
unset($tmp);
-
-
+
+
} //end foreach
- } //if array count
-
+ } //if array count
+
conf_mount_ro();
config_unlock();
-
+
}
-function sync_package_freeswitch_public_includes()
+function sync_package_freeswitch_public_includes()
{
global $config;
@@ -1542,73 +1542,73 @@ function sync_package_freeswitch_public_includes()
$a_public_includes = &$config['installedpackages']['freeswitchpublicincludes']['config'];
$a_public_include_details = &$config['installedpackages']['freeswitchpublicincludedetails']['config'];
- if (count($a_public_includes) > 0) {
+ if (count($a_public_includes) > 0) {
foreach($a_public_includes as $rowhelper) {
$tmp = "";
$tmp .= "\n";
-
+
//$rowhelper['publicincludeid'];
//$rowhelper['extensionname'];
//$rowhelper['context'];
//$rowhelper['enabled'];
-
+
$tmp = "<extension name=\"".$rowhelper['extensionname']."\">\n";
- if (count($a_public_include_details) > 0) {
-
+ if (count($a_public_include_details) > 0) {
+
$conditioncount = 0;
$i = 0;
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "condition" && $rowhelper['publicincludeid'] == $ent['publicincludeid']) {
$conditioncount++;
$i++;
- }
+ }
}
-
+
$i = 1;
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "condition" && $rowhelper['publicincludeid'] == $ent['publicincludeid']) {
- if ($conditioncount == 1) { //single condition
+ if ($conditioncount == 1) { //single condition
//start tag
- $tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
+ $tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
}
- else { //more than one condition
- if ($i < $conditioncount) {
+ else { //more than one condition
+ if ($i < $conditioncount) {
//all tags should be self-closing except the last one
$tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\"/>\n";
}
else {
- //for the last tag use the start tag
+ //for the last tag use the start tag
$tmp .= " <condition field=\"".$ent['fieldtype']."\" expression=\"".$ent['fielddata']."\">\n";
}
}
$i++;
}
} //end for each
-
+
} //end if count
-
+
if (count($a_public_include_details) > 0) {
$i = 0;
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "action" && $rowhelper['publicincludeid'] == $ent['publicincludeid']) {
- $tmp .= " <action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
- }
- $i++;
+ $tmp .= " <action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
+ }
+ $i++;
}
}
-
+
if (count($a_public_include_details) > 0) {
$i = 0;
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "anti-action" && $rowhelper['publicincludeid'] == $ent['publicincludeid']) {
$tmp .= " <anti-action application=\"".$ent['fieldtype']."\" data=\"".$ent['fielddata']."\"/>\n";
- }
- $i++;
+ }
+ $i++;
}
}
-
+
//if (count($a_public_include_details) > 0) {
//foreach ($a_public_include_details as $ent) {
// $i = 0;
@@ -1616,60 +1616,60 @@ function sync_package_freeswitch_public_includes()
//$ent['tag']
//$ent['fieldtype']
//$ent['fielddata']
- // }
- // $i++;
+ // }
+ // $i++;
// }
//}
-
+
if ($conditioncount > 0) {
$tmp .= " </condition>\n";
}
unset ($conditioncount);
$tmp .= "</extension>\n";
-
-
+
+
if ($rowhelper['enabled'] == "true") {
- $publicincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
+ $publicincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
$fout = fopen("/usr/local/freeswitch/conf/dialplan/public/".$publicincludefilename,"w");
fwrite($fout, $tmp);
- fclose($fout);
+ fclose($fout);
}
unset($publicincludefilename);
unset($tmp);
-
- } //end foreach
- } //end if count
+
+ } //end foreach
+ } //end if count
conf_mount_ro();
config_unlock();
-
+
}
-function sync_package_freeswitch()
+function sync_package_freeswitch()
{
-
- global $config;
+
+ global $config;
sync_package_freeswitch_settings();
sync_package_freeswitch_dialplan();
- sync_package_freeswitch_dialplan_includes();
+ sync_package_freeswitch_dialplan_includes();
sync_package_freeswitch_extensions();
sync_package_freeswitch_gateways();
sync_package_freeswitch_modules();
sync_package_freeswitch_public();
- sync_package_freeswitch_public_includes();
- sync_package_freeswitch_vars();
+ sync_package_freeswitch_public_includes();
+ sync_package_freeswitch_vars();
sync_package_freeswitch_internal();
sync_package_freeswitch_external();
//sync_package_freeswitch_recordings();
- if (pkg_is_service_running('freeswitch')) {
+ if (pkg_is_service_running('freeswitch')) {
sync_package_freeswitch_ivr();
}
}
-
-function freeswitch_php_install_command()
+
+function freeswitch_php_install_command()
{
global $config;
$freeswitch_package_version = "0.8.4";
@@ -1709,7 +1709,7 @@ function freeswitch_php_install_command()
exec("cp /tmp/begin_recording.wav /usr/local/freeswitch/recordings/begin_recording.wav");
unlink_if_exists("/tmp/begin_recording.wav");
-
+
exec("cp /tmp/your_pin_number_is_incorect_goodbye.wav /usr/local/freeswitch/recordings/your_pin_number_is_incorect_goodbye.wav");
unlink_if_exists("/tmp/your_pin_number_is_incorect_goodbye.wav");
@@ -1758,7 +1758,7 @@ function freeswitch_php_install_command()
exec("cp /tmp/freeswitch_ivr.tmp /usr/local/www/freeswitch/freeswitch_ivr.php");
unlink_if_exists("/tmp/freeswitch_ivr.tmp");
-
+
exec("cp /tmp/freeswitch_ivr_edit.tmp /usr/local/www/freeswitch/freeswitch_ivr_edit.php");
unlink_if_exists("/tmp/freeswitch_ivr_edit.tmp");
@@ -1791,7 +1791,7 @@ function freeswitch_php_install_command()
exec("cp /tmp/freeswitch_recordings_play.tmp /usr/local/www/freeswitch/freeswitch_recordings_play.php");
unlink_if_exists("/tmp/freeswitch_recordings_play.tmp");
-
+
exec("cp /tmp/freeswitch_status.tmp /usr/local/www/freeswitch/freeswitch_status.php");
unlink_if_exists("/tmp/freeswitch_status.tmp");
@@ -1840,10 +1840,10 @@ function freeswitch_php_install_command()
//write the recording.js script
recording_js();
-
+
//add recording.js to the dialplan
$a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config'];
- $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
+ $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
//delete dialplan recording from the previous install
if (count($a_dialplan_includes) > 0) {
@@ -1851,12 +1851,12 @@ function freeswitch_php_install_command()
foreach ($a_dialplan_includes as $ent) {
if ($ent['extensionname'] == "Recordings") {
unset($a_dialplan_includes[$i]);
- }
- $i++;
+ }
+ $i++;
}
}
- //delete the recording dialplan details
+ //delete the recording dialplan details
if (count($a_dialplan_include_details) > 0) {
$i = 0;
foreach ($a_dialplan_include_details as $ent) {
@@ -1865,13 +1865,13 @@ function freeswitch_php_install_command()
}
if ($ent['fielddata'] == "recordings.js") {
unset($a_dialplan_include_details[$i]);
- }
- $i++;
+ }
+ $i++;
}
}
-
+
$dialplanincludeid = guid();
-
+
$ent = array();
$ent['dialplanincludeid'] = $dialplanincludeid;
$ent['extensionname'] = 'Recordings';
@@ -1940,9 +1940,9 @@ function freeswitch_php_install_command()
fwrite($fout, $tmpxml);
unset($tmpxml);
fclose($fout);
-
+
/* freeswitch modules defaults */
-
+
if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_console']) == 0) {
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_console'] = "enable";
}
@@ -1963,7 +1963,7 @@ function freeswitch_php_install_command()
}
if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_curl']) == 0) {
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_curl'] = "disable";
- }
+ }
if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_cdr']) == 0) {
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_cdr'] = "disable";
}
@@ -2062,7 +2062,7 @@ function freeswitch_php_install_command()
}
if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_amr']) == 0) {
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_amr'] = "enable";
- }
+ }
if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_ilbc']) == 0) {
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_ilbc'] = "enable";
}
@@ -2132,7 +2132,7 @@ function freeswitch_php_install_command()
// if backup file exists restore it
$filename = 'freeswitch.bak.tgz';
-
+
//extract a specific directory to /usr/local/freeswitch
if (file_exists('/tmp/'.$filename)) {
//echo "The file $filename exists";
@@ -2147,8 +2147,8 @@ function freeswitch_php_install_command()
system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/ssl');
//Optional
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
//system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/');
unset($filename);
@@ -2172,26 +2172,26 @@ function freeswitch_php_install_command()
"stop" => "/usr/local/freeswitch/bin/./freeswitch -stop"
)
);
-
+
sync_package_freeswitch();
$handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r");
pclose($handle);
- if (pkg_is_service_running('freeswitch')) {
+ if (pkg_is_service_running('freeswitch')) {
sync_package_freeswitch_ivr();
}
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = $freeswitch_build_version." revision ".$freeswitch_build_revision.".";
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = $freeswitch_package_version;
-
+
conf_mount_ro();
config_unlock();
-
+
}
-function freeswitch_deinstall_command()
+function freeswitch_deinstall_command()
{
conf_mount_rw();
@@ -2218,7 +2218,7 @@ function freeswitch_deinstall_command()
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_extensions_edit.php");
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_ivr.php");
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_ivr_edit.php");
- unlink_if_exists("/usr/local/www/freeswitch/freeswitch_ivr_options_edit.php");
+ unlink_if_exists("/usr/local/www/freeswitch/freeswitch_ivr_options_edit.php");
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_ivr_options.php");
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_gateways.php");
unlink_if_exists("/usr/local/www/freeswitch/freeswitch_gateways_edit.php");
diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml
index 5eb9949f..46ef16e7 100644
--- a/config/freeswitch/freeswitch.xml
+++ b/config/freeswitch/freeswitch.xml
@@ -58,7 +58,7 @@
<name>freeswitch</name>
<rcfile>freeswitch.sh</rcfile>
<executable>freeswitch</executable>
- <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. </description>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. </description>
</service>
<tabs>
<tab>
diff --git a/config/freeswitch/freeswitch_cmd.tmp b/config/freeswitch/freeswitch_cmd.tmp
index 05ae77cf..03883f62 100755
--- a/config/freeswitch/freeswitch_cmd.tmp
+++ b/config/freeswitch/freeswitch_cmd.tmp
@@ -4,7 +4,7 @@
freeswitch_cmd.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
diff --git a/config/freeswitch/freeswitch_dialplan.xml b/config/freeswitch/freeswitch_dialplan.xml
index d6d907d5..0e6fcd44 100644
--- a/config/freeswitch/freeswitch_dialplan.xml
+++ b/config/freeswitch/freeswitch_dialplan.xml
@@ -77,7 +77,7 @@
<tab>
<text>Features</text>
<url>/freeswitch/freeswitch_features.php</url>
- </tab>
+ </tab>
<tab>
<text>Gateways</text>
<url>/freeswitch/freeswitch_gateways.php</url>
diff --git a/config/freeswitch/freeswitch_dialplan_includes.tmp b/config/freeswitch/freeswitch_dialplan_includes.tmp
index 7e315ecf..3fa02dbf 100644
--- a/config/freeswitch/freeswitch_dialplan_includes.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes.tmp
@@ -1,10 +1,10 @@
<?php
/* $Id$ */
/*
- freeswitch_dialplan_includes.php
+ freeswitch_dialplan_includes.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -41,7 +41,7 @@ require("/usr/local/pkg/freeswitch.inc");
//default
//enabled
//descr
-
+
//freeswitchdialplanincludedetails
//dialplanincludeid
@@ -53,7 +53,7 @@ require("/usr/local/pkg/freeswitch.inc");
//tagorder
//1-20
//fieldtype
-
+
//fielddata
@@ -63,7 +63,7 @@ $a_dialplan_includes_details = &$config['installedpackages']['freeswitchdialplan
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'dialplanincludes') {
-
+
if ($a_dialplan_includes[$_GET['id']]) {
$dialplanincludeid = $a_dialplan_includes[$_GET['id']][dialplanincludeid];
@@ -71,7 +71,7 @@ if ($_GET['act'] == "del") {
$extensionname = $a_dialplan_includes[$_GET['id']][extensionname];
$order = $a_dialplan_includes[$_GET['id']][order];
$dialplanincludefilename = $order."_".$extensionname.".xml";
-
+
//delete the dialplan include details. aka. child data
if (count($a_dialplan_includes_details) > 0) {
$i=0;
@@ -80,16 +80,16 @@ if ($_GET['act'] == "del") {
//echo "child id: ".$i."<br />\n";
unset($a_dialplan_includes_details[$i]);
}
- $i++;
+ $i++;
}
}
-
+
//if the dialplan include xml file exists then delete it
if (file_exists("/usr/local/freeswitch/conf/dialplan/default/".$dialplanincludefilename)) {
unlink("/usr/local/freeswitch/conf/dialplan/default/".$dialplanincludefilename);
}
-
- unset($dialplanincludefilename);
+
+ unset($dialplanincludefilename);
unset($a_dialplan_includes[$_GET['id']]);
write_config();
sync_package_freeswitch_dialplan_includes();
@@ -134,7 +134,7 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_dialplan_includes.php" method="post" name="iform" id="iform">
-<?php
+<?php
//echo "<pre>";
@@ -144,28 +144,28 @@ include("head.inc");
//if ($config_change == 1) {
// write_config();
-// $config_change = 0;
+// $config_change = 0;
//}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("This has been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
<br />
<br />
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><span class="vexpl"><span class="red"><strong>Dialplan
</strong></span></span>
</td>
<td align='right'>
<input type='button' value='default.xml' onclick="document.location.href='/pkg_edit.php?xml=freeswitch_dialplan.xml&id=0';">
- </td>
+ </td>
</tr>
<tr>
<td colspan='2'>
@@ -173,14 +173,14 @@ include("head.inc");
The dialplan is used to setup call destinations based on conditions and context. You can use the dialplan to send calls to gateways, IVRs, external numbers, to scripts, or any destination.
</span>
</td>
-
+
</tr>
</table>
<br />
<br />
- <br />
-
+ <br />
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Extension Name</td>
@@ -197,9 +197,9 @@ include("head.inc");
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_dialplan_includes) > 0) {
+ if (count($a_dialplan_includes) > 0) {
foreach ($a_dialplan_includes as $ent) {
?>
<tr>
@@ -224,8 +224,8 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
- $i++;
+ <?php
+ $i++;
}
}
?>
@@ -246,7 +246,7 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
/usr/local/freeswitch/conf/dialplan/default/
diff --git a/config/freeswitch/freeswitch_dialplan_includes_details.tmp b/config/freeswitch/freeswitch_dialplan_includes_details.tmp
index 7b14dae4..b805ec52 100755
--- a/config/freeswitch/freeswitch_dialplan_includes_details.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes_details.tmp
@@ -4,7 +4,7 @@
freeswitch_dialplan_includes_details.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
diff --git a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
index 23ce76e3..ee5b45f1 100644
--- a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_dialplan_includes_details_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -62,9 +62,9 @@ if (isset($_POST['dialplanincludeid'])) {
//tagorder
//1-20
//fieldtype
-
+
//fielddata
-
+
if (isset($id) && $a_dialplan_includes_details[$id]) {
$pconfig['dialplanincludeid'] = $a_dialplan_includes_details[$id]['dialplanincludeid'];
@@ -89,7 +89,7 @@ if ($_POST) {
if (!$input_errors) {
-
+
$ent = array();
$ent['dialplanincludeid'] = $_POST['dialplanincludeid'];
$ent['tag'] = $_POST['tag'];
@@ -103,7 +103,7 @@ if ($_POST) {
$a_dialplan_includes_details[$id] = $ent;
}
else {
- //add
+ //add
$a_dialplan_includes_details[] = $ent;
}
@@ -142,14 +142,14 @@ include("head.inc");
$tab_array[] = array(gettext("Status"), false, "/freeswitch/freeswitch_status.php");
$tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
display_top_tabs($tab_array);
-
+
?>
</td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
+
<form action="freeswitch_dialplan_includes_details_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
@@ -177,9 +177,9 @@ include("head.inc");
if (tag == "") {
document.getElementById("label_fieldtype").innerHTML = "Type";
document.getElementById("label_fielddata").innerHTML = "Data";
- }
+ }
}
- </script>
+ </script>
<?php
echo " <select name='tag' class='formfld' id='form_tag' onchange='dialplan_include_details_tag_onchange();'>\n";
echo " <option></option>\n";
@@ -207,7 +207,7 @@ include("head.inc");
echo " <option>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option selected='yes'>param</option>\n";
- break;
+ break;
default:
echo " <option>condition</option>\n";
echo " <option>action</option>\n";
@@ -215,31 +215,31 @@ include("head.inc");
//echo " <option>param</option>\n";
}
echo " </select>\n";
-
+
//condition
//field expression
//action
- //application
+ //application
//data
//antiaction
- //application
+ //application
//data
//param
//name
//value
-
+
?>
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq" id="label_fieldtype">Type</td>
- <td width="78%" class="vtable">
- <input name="fieldtype" type="text" class="formfld" id="fieldtype" size="40" value="<?=htmlspecialchars($pconfig['fieldtype']);?>">
+ <td width="78%" class="vtable">
+ <input name="fieldtype" type="text" class="formfld" id="fieldtype" size="40" value="<?=htmlspecialchars($pconfig['fieldtype']);?>">
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq" id="label_fielddata">Data</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="fielddata" type="text" class="formfld" id="fielddata" size="40" value="<?=htmlspecialchars($pconfig['fielddata']);?>">
<br> <span class="vexpl"></span></td>
</tr>
@@ -247,16 +247,16 @@ include("head.inc");
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="dialplanincludeid" type="hidden" value="<?=$dialplanincludeid;?>">
- <input name="parentid" type="hidden" value="<?=$parentid;?>">
+ <input name="parentid" type="hidden" value="<?=$parentid;?>">
<?php if (isset($id) && $a_dialplan_includes_details[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
+ <input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
<input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
</td>
</tr>
</table>
</form>
-
+
<br />
<br />
<b>Additional Information</b>
@@ -268,7 +268,7 @@ include("head.inc");
<br />
<br />
<br />
-
+
<b>Conditions</b>
<br />
<br />
@@ -285,49 +285,49 @@ include("head.inc");
<li><b>uuid</b> Unique identifier of the current call? (looks like a GUID)</li>
<li><b>source</b> Name of the FreeSwitch module that received the call (e.g. PortAudio)</li>
<li><b>chan_name</b> Name of the current channel (Example: PortAudio/1234). Give us examples when this one can be used.</li>
- <li><b>network_addr</b> IP address of the signalling source for a VoIP call.</li>
+ <li><b>network_addr</b> IP address of the signalling source for a VoIP call.</li>
</ul>
In addition to the above you can also do variables using the syntax ${variable} or api functions using the syntax %{api} {args}
<br />
<br />
- Variables may be used in either the field or the expression, as follows
+ Variables may be used in either the field or the expression, as follows
<br />
<br />
<br />
<br />
-
+
<b>Action and Anti-Actions</b>
<br />
<br />
Actions are executed when the <b>condition matches</b>. Anti-Actions are executed when the <b>condition does NOT match</b>.
Additional information on applications for Actions and Anti-Actions.<br />
- <a href='http://wiki.freeswitch.org/wiki/Modules#Applications' target='_blank'>http://wiki.freeswitch.org/wiki/Modules#Applications</a>
+ <a href='http://wiki.freeswitch.org/wiki/Modules#Applications' target='_blank'>http://wiki.freeswitch.org/wiki/Modules#Applications</a>
<br />
<a href='http://wiki.freeswitch.org/wiki/Dialplan_Functions' target='_blank'>http://wiki.freeswitch.org/wiki/Dialplan_Functions</a>
<br />
<br />
<br />
- The following is a partial list of <b>applications</b>.
+ The following is a partial list of <b>applications</b>.
<ul>
<li><b>answer</b> answer the call</li>
<li><b>bridge</b> bridge the call<li>
<li><b>cond</b></li>
- <li><b>db</b> is a a runtime database either sqlite by default or odbc</li>
+ <li><b>db</b> is a a runtime database either sqlite by default or odbc</li>
<li><b>global_set</b> allows setting of global vars similar to the ones found in vars.xml</li>
<li><b>group</b> allows grouping of several extensions for things like ring groups</li>
<li><b>expr</b></li>
- <li><b>hangup</b> hangs up the call</li>
+ <li><b>hangup</b> hangs up the call</li>
<li><b>info</b> sends call info to the console</li>
<li><b>javascript</b> run javascript .js files</li>
<li><b>playback</b></li>
<li><b>reject</b> reject the call</li>
- <li><b>respond</b></li>
- <li><b>ring_ready</b></li>
+ <li><b>respond</b></li>
+ <li><b>ring_ready</b></li>
<li><b>set</b> set a variable</li>
<li><b>set_user</b></li>
<li><b>sleep</b></li>
- <li><b>sofia_contact</b></li>
+ <li><b>sofia_contact</b></li>
<li><b>transfer</b> transfer the call to another extension or number<li>
<li><b>voicemail</b> send the call to voicemail</li>
</ul>
@@ -340,13 +340,13 @@ include("head.inc");
<b>Param</b>
Example parameters by name and value
<br />
- <a href='http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go' target='_blank'>http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go</a>
+ <a href='http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go' target='_blank'>http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go</a>
<ul>
- <li><b>codec-ms</b> 20</li>
+ <li><b>codec-ms</b> 20</li>
<li><b>codec-prefs</b> PCMU@20i</li>
<li><b>debug</b> 1</li>
<li><b>dialplan</b> XML</li>
- <li><b>dtmf-duration</b> 100</li>
+ <li><b>dtmf-duration</b> 100</li>
<li><b>rfc2833-pt</b>" 101</li>
<li><b>sip-port</b> 5060</li>
<li><b>use-rtp-timer</b> true</li>
@@ -355,13 +355,13 @@ include("head.inc");
<br />
-->
-
+
<br />
<br />
<br />
<br />
<br />
-
+
</td>
</tr>
</table>
diff --git a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
index b270103b..173f363e 100644
--- a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_dialplan_includes_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -42,7 +42,7 @@ require("/usr/local/pkg/freeswitch.inc");
//default
//enabled
//descr
-
+
//
@@ -88,11 +88,11 @@ if ($_POST) {
if (!$input_errors) {
-
+
$ent = array();
if (strlen($_POST['dialplanincludeid']) > 0) {
//update
- $ent['dialplanincludeid'] = $_POST['dialplanincludeid'];
+ $ent['dialplanincludeid'] = $_POST['dialplanincludeid'];
}
else {
//add
@@ -107,48 +107,48 @@ if ($_POST) {
$ent['opt1name'] = $_POST['opt1name'];
$ent['opt1value'] = $_POST['opt1value'];
-
+
if (isset($id) && $a_dialplan_includes[$id]) {
-
+
if (count($a_dialplan_includes)>0) {
foreach($a_dialplan_includes as $rowhelper) {
-
+
//$rowhelper['dialplanincludeid'];
//$rowhelper['extensionname'];
//$rowhelper['context'];
//$rowhelper['enabled'];
-
+
$filenamechanged = false;
if ($rowhelper['dialplanincludeid'] == $_POST['dialplanincludeid']) {
-
+
if ($rowhelper['extensionname'] != $_POST['extensionname']) {
//if the extension name has changed then remove the current dialplan xml file
//to prepare for the new file
- $filenamechanged = true;
+ $filenamechanged = true;
}
if ($rowhelper['order'] != $_POST['order']) {
//if the order has changed then remove the current dialplan xml file
//to prepare for the new file
- $filenamechanged = true;
- }
+ $filenamechanged = true;
+ }
if ($_POST['enabled'] == "false") {
//if the extension name is disabled then remove the dialplan xml file
$filenamechanged = true;
}
- if ($filenamechanged){
+ if ($filenamechanged){
$dialplanincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
if (file_exists("/usr/local/freeswitch/conf/dialplan/default/".$dialplanincludefilename)) {
unlink("/usr/local/freeswitch/conf/dialplan/default/".$dialplanincludefilename);
}
unset($dialplanincludefilename);
}
-
+
}
- unset($filenamechanged);
-
+ unset($filenamechanged);
+
} //end foreach
} //end count
-
+
//update the config
$a_dialplan_includes[$id] = $ent;
}
@@ -201,8 +201,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Dialplan:<br>
</strong></span>
@@ -216,27 +216,27 @@ include("head.inc");
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Extension Name</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="extensionname" type="text" class="formfld" id="extensionname" size="40" value="<?=htmlspecialchars($pconfig['extensionname']);?>">
<br />
- Supported characters are 'a-z', 'A-Z', '0-9', underscore '_', and period '.'.
+ Supported characters are 'a-z', 'A-Z', '0-9', underscore '_', and period '.'.
</td>
</tr>
<!--
<tr>
<td width="22%" valign="top" class="vncellreq">Context</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="context" type="text" class="formfld" id="context" size="40" value="<?=htmlspecialchars($pconfig['context']);?>">
<br />
e.g. default
</td>
</tr>
-->
-
+
<tr>
<td width="22%" valign="top" class="vncellreq">Enabled</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='enabled' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['enabled'])) {
@@ -254,30 +254,30 @@ include("head.inc");
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
-
+
<tr>
<td width="22%" valign="top" class="vncellreq">Order</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<?php
-
+
echo " <select name='order' class='formfld'>\n";
echo " <option></option>\n";
if (strlen(htmlspecialchars($pconfig['order']))> 0) {
- echo " <option selected='yes' value='".htmlspecialchars($pconfig['order'])."'>".htmlspecialchars($pconfig['order'])."</option>\n";
+ echo " <option selected='yes' value='".htmlspecialchars($pconfig['order'])."'>".htmlspecialchars($pconfig['order'])."</option>\n";
}
$i=0;
while($i<=999) {
- if (strlen($i) == 1) {
+ if (strlen($i) == 1) {
echo " <option value='00$i'>00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i'>0$i</option>\n";
}
if (strlen($i) == 3) {
- echo " <option value='$i'>$i</option>\n";
+ echo " <option value='$i'>$i</option>\n";
}
$i++;
@@ -285,24 +285,24 @@ include("head.inc");
echo " </select>\n";
?>
<br />
- Processing of each dialplan include is determined by this order.
+ Processing of each dialplan include is determined by this order.
</td>
</tr>
-
+
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="dialplanincludeid" type="hidden" value="<?=htmlspecialchars($pconfig['dialplanincludeid']);?>">
- <?php
+ <?php
if (strlen($id) > 0 && $a_dialplan_includes[$id]) {
- echo "\n";
+ echo "\n";
echo " <input name=\"id\" type=\"hidden\" value=\"$id\">\n";
echo " <input name=\"opt1name\" type=\"hidden\" value=\"".htmlspecialchars($pconfig['opt1name'])."\">\n";
echo " <input name=\"opt1value\" type=\"hidden\" value=\"".htmlspecialchars($pconfig['opt1value'])."\">\n";
@@ -313,36 +313,36 @@ include("head.inc");
</tr>
</table>
</form>
-
+
<br>
<br>
<form action="freeswitch_dialplan_includes_edit.php" method="post" name="iform2" id="iform2">
- <?php
-
+ <?php
+
//echo "<pre>";
//print_r ($a_dialplan_includes);
//echo "</pre>";
-
- //if ($savemsg) print_info_box($savemsg);
+
+ //if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
- //endif;
-
+ //endif;
+
?>
-
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Conditions and Actions<br />
</strong></span>
- The following conditions, actions and anti-actions are used in the dialplan to direct call flow. Each is processed in order until you reach the action tag which tells FreeSWITCH what action to perform. You are not limited to only one condition or action tag for a given extension.
+ The following conditions, actions and anti-actions are used in the dialplan to direct call flow. Each is processed in order until you reach the action tag which tells FreeSWITCH what action to perform. You are not limited to only one condition or action tag for a given extension.
</span></p></td>
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Tag</td>
@@ -356,13 +356,13 @@ include("head.inc");
</tr>
</table>
</td>
- </tr>
-
- <?php
-
+ </tr>
+
+ <?php
+
$i = 0;
if (count($a_dialplan_include_details) > 0) {
-
+
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "condition" && $dialplanincludeid == $ent['dialplanincludeid']) {
?>
@@ -375,7 +375,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -385,15 +385,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_dialplan_include_details) > 0) {
-
+
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "action" && $dialplanincludeid == $ent['dialplanincludeid']) {
?>
@@ -406,7 +406,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -416,15 +416,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_dialplan_include_details) > 0) {
-
+
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "anti-action" && $dialplanincludeid == $ent['dialplanincludeid']) {
?>
@@ -437,7 +437,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -447,15 +447,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_dialplan_include_details) > 0) {
-
+
foreach ($a_dialplan_include_details as $ent) {
if ($ent['tag'] == "param" && $dialplanincludeid == $ent['dialplanincludeid']) {
?>
@@ -468,7 +468,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -478,11 +478,11 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
- }
+ }
?>
<tr>
<td class="list" colspan="3"></td>
@@ -502,14 +502,14 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
-
-
+
+
+ <br>
<br>
- <br>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_extensions.tmp b/config/freeswitch/freeswitch_extensions.tmp
index 3b25e98e..5c0db6a3 100644
--- a/config/freeswitch/freeswitch_extensions.tmp
+++ b/config/freeswitch/freeswitch_extensions.tmp
@@ -4,7 +4,7 @@
freeswitch_extensions.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -83,21 +83,21 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_extensions.php" method="post" name="iform" id="iform">
-<?php
+<?php
if ($config_change == 1) {
write_config();
- $config_change = 0;
+ $config_change = 0;
}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH extensions have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Extensions<br>
</strong></span>
@@ -126,24 +126,24 @@ if ($config_change == 1) {
</tr>
- <?php
-
+ <?php
+
$i = 0;
if (count($a_extensions) > 0) {
foreach ($a_extensions as $ent) {
-
+
?>
<tr>
<td class="listr" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
<?=$ent['extension'];?>&nbsp;
- </td>
+ </td>
<td class="listr" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
<?=$ent['vm-mailto'];?>&nbsp;
</td>
<td class="listr" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
<?=$ent['callgroup'];?>&nbsp;
- </td>
+ </td>
<td class="listbg" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?>&nbsp;
</td>
@@ -156,16 +156,16 @@ if ($config_change == 1) {
</table>
</td>
</tr>
- <?php
+ <?php
- $i++;
+ $i++;
}
}
?>
<tr>
<td class="list" colspan="4"></td>
- <td class="list">
+ <td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="17"></td>
@@ -181,7 +181,7 @@ if ($config_change == 1) {
<td class="list"></td>
</tr>
</table>
-
+
</form>
diff --git a/config/freeswitch/freeswitch_extensions_edit.tmp b/config/freeswitch/freeswitch_extensions_edit.tmp
index ca4535c3..9b62d6a7 100644
--- a/config/freeswitch/freeswitch_extensions_edit.tmp
+++ b/config/freeswitch/freeswitch_extensions_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_extensions_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -96,7 +96,7 @@ if ($_POST) {
$a_extensions[$id] = $ent;
}
else {
- //add
+ //add
$a_extensions[] = $ent;
}
@@ -154,64 +154,64 @@ function show_advanced_config() {
<td class="tabcont" >
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Extension Setup<br>
</strong></span>
- /usr/local/freeswitch/conf/directory/default/
+ /usr/local/freeswitch/conf/directory/default/
</p></td>
</tr>
</table>
<br />
-
+
<form action="freeswitch_extensions_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="25%" valign="top" class="vncellreq">Extension</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="extension" type="text" class="formfld unknown" id="extension" size="40" value="<?=htmlspecialchars($pconfig['extension']);?>">
<br><span class="vexpl">Enter the extension here. The default configuration expects extension numbers between 1000 -1019. To use 3 digit extensions adjust the dialplan 'default.xml' under name="Local_Extension" change the regular expression="^(10[01][0-9])$" to expression="^(\d{3})$".<br></span>
</td>
- </tr>
+ </tr>
<tr>
<td width="25%" valign="top" class="vncellreq">Password</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="password" type="password" class="formfld pwd" id="password" size="40" value="<?=htmlspecialchars($pconfig['password']);?>">
<br><span class="vexpl">Enter the password here.<br></span>
</td>
- </tr>
+ </tr>
<tr>
<td width="25%" valign="top" class="vncellreq">Mailbox</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="mailbox" type="text" class="formfld unknown" id="mailbox" size="40" value="<?=htmlspecialchars($pconfig['mailbox']);?>">
<br><span class="vexpl">Enter the mailbox here. Example: extension 1001 then mailbox 1001<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq">Voicemail Password</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="vm-password" type="password" class="formfld pwd" id="vm-password" size="40" value="<?=htmlspecialchars($pconfig['vm-password']);?>">
<br><span class="vexpl">Enter the voicemail password here.<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq">Account Code</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="accountcode" type="text" class="formfld unknown" id="accountcode" size="40" value="<?=htmlspecialchars($pconfig['accountcode']);?>">
<br><span class="vexpl">Enter the account code here. Example: extension 1001 then accountcode 1001<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Effective Caller ID Name</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="effective_caller_id_name" type="text" class="formfld unknown" id="effective_caller_id_name" size="40" value="<?=htmlspecialchars($pconfig['effective_caller_id_name']);?>">
<br><span class="vexpl">Enter the effective caller id name here.<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Effective Caller ID Number</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="effective_caller_id_number" type="text" class="formfld unknown" id="effective_caller_id_number" size="40" value="<?=htmlspecialchars($pconfig['effective_caller_id_number']);?>">
<br><span class="vexpl">Enter the effective caller id number here.<br></span>
</td>
@@ -219,14 +219,14 @@ function show_advanced_config() {
<!--
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Outbound Caller ID Name</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="outbound_caller_id_name" type="text" class="formfld unknown" id="outbound_caller_id_name" size="40" value="<?=htmlspecialchars($pconfig['outbound_caller_id_name']);?>">
<br><span class="vexpl">Enter the outbound caller id name here.<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Outbound Caller ID Number</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="outbound_caller_id_number" type="text" class="formfld unknown" id="outbound_caller_id_number" size="40" value="<?=htmlspecialchars($pconfig['outbound_caller_id_number']);?>">
<br><span class="vexpl">Enter the outbound caller id number here.<br></span>
</td>
@@ -234,15 +234,15 @@ function show_advanced_config() {
-->
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Voicemail Mail To</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="vm-mailto" type="text" class="formfld unknown" id="vm-mailto" size="40" value="<?=htmlspecialchars($pconfig['vm-mailto']);?>">
<br><span class="vexpl">Optional: Enter the email address to send voicemail to.<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq" nowrap>Voicemail Attach File</td>
- <td width="75%" class="vtable">
- <?php
+ <td width="75%" class="vtable">
+ <?php
echo " <select name='vm-attach-file' class='formfld unknown'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['vm-attach-file'])) {
@@ -260,31 +260,31 @@ function show_advanced_config() {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
Choose whether to attach the file to the email.
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq">User Context</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="user_context" type="text" class="formfld unknown" id="user_context" size="40" value="<?=htmlspecialchars($pconfig['user_context']);?>">
<br><span class="vexpl">Enter the user context here. Example: default<br></span>
</td>
</tr>
<tr>
<td width="25%" valign="top" class="vncellreq">Call Group</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="callgroup" type="text" class="formfld unknown" id="callgroup" size="40" value="<?=htmlspecialchars($pconfig['callgroup']);?>">
<br><span class="vexpl">Enter the user call group here. Example: sales, support<br></span>
</td>
- </tr>
+ </tr>
</table>
-
+
<div id="showadvancedbox">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="25%" valign="top" class="vncell">Show Advanced</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input type="button" onClick="show_advanced_config()" value="Advanced"></input></a>
</td>
</tr>
@@ -294,25 +294,25 @@ function show_advanced_config() {
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="25%" valign="top" class="vncell">Auth-ACL</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="auth-acl" type="text" class="formfld unknown" id="auth-acl" size="40" value="<?=htmlspecialchars($pconfig['auth-acl']);?>">
<br> <span class="vexpl">Enter the auth acl here.<br></span>
</td>
</tr>
<tr>
<td valign="top" class="vncell">CIDR</td>
- <td class="vtable">
+ <td class="vtable">
<input name="cidr" type="text" class="formfld unknown" id="cidr" size="40" value="<?=htmlspecialchars($pconfig['cidr']);?>">
<br> <span class="vexpl">Enter the cidr here.<br></span>
</td>
- </tr>
- </table>
+ </tr>
+ </table>
</div>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="25%" valign="top" class="vncellreq">Extension Description</td>
- <td width="75%" class="vtable">
+ <td width="75%" class="vtable">
<input name="description" type="text" class="formfld unknown" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>">
<br><span class="vexpl">Enter the description of the extension here.<br></span>
</td>
diff --git a/config/freeswitch/freeswitch_features.php b/config/freeswitch/freeswitch_features.php
index e122e39d..7578b033 100644
--- a/config/freeswitch/freeswitch_features.php
+++ b/config/freeswitch/freeswitch_features.php
@@ -4,7 +4,7 @@
freeswitch_extensions.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -82,7 +82,7 @@ include("head.inc");
<tr>
<td class="tabcont" >
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Features<br>
</strong></span>
@@ -98,11 +98,11 @@ include("head.inc");
</tr>
<tr>
<td width='10%' class="vncell"><a href='/freeswitch/freeswitch_ivr.php'>Open</a></td>
- <td class="vtable">
- An interactive voice response (IVR) often refered to as an Auto Attendant.
- It associates a recording to multiple options that can be used to direct
- calls to extensions, voicemail, queues, other IVR applications, and external
- phone numbers.
+ <td class="vtable">
+ An interactive voice response (IVR) often refered to as an Auto Attendant.
+ It associates a recording to multiple options that can be used to direct
+ calls to extensions, voicemail, queues, other IVR applications, and external
+ phone numbers.
</td>
</tr>
</table>
@@ -116,12 +116,12 @@ include("head.inc");
</tr>
<tr>
<td width='10%' class="vncell"><a href='/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0'>Open</a></td>
- <td class="vtable">
+ <td class="vtable">
Modules add additional features and can be enabled or disabled to provide the desired features.
</td>
</tr>
</table>
-
+
<br />
<br />
@@ -131,13 +131,13 @@ include("head.inc");
</tr>
<tr>
<td width='10%' class="vncell"><a href='/freeswitch/freeswitch_recordings.php'>Open</a></td>
- <td class="vtable">
- Music on hold can be in WAV or MP3 format. To play MP3 you must have mod_shout enabled
- on the 'Modules' tab. For best performance upload 16bit 8khz/16khz Mono WAV files.
+ <td class="vtable">
+ Music on hold can be in WAV or MP3 format. To play MP3 you must have mod_shout enabled
+ on the 'Modules' tab. For best performance upload 16bit 8khz/16khz Mono WAV files.
</td>
</tr>
</table>
-
+
<br />
<br />
@@ -147,14 +147,14 @@ include("head.inc");
</tr>
<tr>
<td width='10%' class="vncell"><a href='/freeswitch/freeswitch_recordings.php'>Open</a></td>
- <td class="vtable">
- To make a recording dial extension 732673 (record) or you can make a 16bit 8khz/16khz
- Mono WAV file then copy it to the following directory then refresh the page to play
- it back. Click on the 'Filename' to download it or the 'Recording Name' to play the audio.
+ <td class="vtable">
+ To make a recording dial extension 732673 (record) or you can make a 16bit 8khz/16khz
+ Mono WAV file then copy it to the following directory then refresh the page to play
+ it back. Click on the 'Filename' to download it or the 'Recording Name' to play the audio.
</td>
</tr>
- </table>
-
+ </table>
+
<br />
<br />
diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp
index 240aa926..88be8fc4 100644
--- a/config/freeswitch/freeswitch_gateways.tmp
+++ b/config/freeswitch/freeswitch_gateways.tmp
@@ -4,7 +4,7 @@
freeswitch_gateways.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -83,21 +83,21 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_gateways.php" method="post" name="iform" id="iform">
-<?php
+<?php
if ($config_change == 1) {
write_config();
- $config_change = 0;
+ $config_change = 0;
}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH gateways have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Gateways<br>
</strong></span>
@@ -106,7 +106,7 @@ if ($config_change == 1) {
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Gateway</td>
@@ -126,24 +126,24 @@ if ($config_change == 1) {
</tr>
- <?php
-
+ <?php
+
$i = 0;
if (count($a_gateways) > 0) {
foreach ($a_gateways as $ent) {
-
+
?>
<tr>
<td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';">
<?=$ent['gateway'];?>&nbsp;
- </td>
+ </td>
<td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';">
<?=$ent['context'];?>&nbsp;
</td>
<td class="listr" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';">
<?=$ent['enabled'];?>&nbsp;
- </td>
+ </td>
<td class="listbg" ondblclick="document.location='freeswitch_gateways_edit.php?id=<?=$i;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?>&nbsp;
</td>
@@ -156,16 +156,16 @@ if ($config_change == 1) {
</table>
</td>
</tr>
- <?php
+ <?php
- $i++;
+ $i++;
}
}
?>
<tr>
<td class="list" colspan="4"></td>
- <td class="list">
+ <td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="17"></td>
@@ -181,7 +181,7 @@ if ($config_change == 1) {
<td class="list"></td>
</tr>
</table>
-
+
</form>
diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp
index 7730a774..e0d1d3be 100644
--- a/config/freeswitch/freeswitch_gateways_edit.tmp
+++ b/config/freeswitch/freeswitch_gateways_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_gateways_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -104,7 +104,7 @@ if ($_POST) {
$a_gateways[$id] = $ent;
}
else {
- //add
+ //add
$a_gateways[] = $ent;
}
@@ -115,29 +115,29 @@ if ($_POST) {
$gatewayid = $_POST['gatewayid'];
$gateway = $_POST['gateway'];
$context = $_POST['context'];
-
+
$default_area_code = &$config['installedpackages']['freeswitchsettings']['config'][0]['default_area_code'];
$a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config'];
- $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
+ $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config'];
-
+
$tmp_array = split("\\\n", $_POST['dialplan_expression']);
foreach($tmp_array as $dialplan_expression) {
-
+
$dialplan_expression = trim($dialplan_expression);
if (strlen($dialplan_expression)>0) {
-
- switch ($dialplan_expression) {
+
+ switch ($dialplan_expression) {
case "^(\d{7})$":
$action_data = "sofia/gateway/".$gateway."/1".$default_area_code."\$1";
$label = "7 digits";
- $abbrv = "7d";
- break;
+ $abbrv = "7d";
+ break;
case "^(\d{10})$":
$action_data = "sofia/gateway/".$gateway."/1\$1";
$label = "10 digits";
- $abbrv = "10d";
+ $abbrv = "10d";
break;
case "^(\d{11})$":
$action_data = "sofia/gateway/".$gateway."/\$1";
@@ -151,9 +151,9 @@ if ($_POST) {
break;
case "^411$":
$action_data = "sofia/gateway/".$gateway."/\$1";
- $label = "411";
+ $label = "411";
$abbrv = "411";
- break;
+ break;
case "^911$":
$action_data = "sofia/gateway/".$gateway."/\$1";
$label = "911";
@@ -162,17 +162,17 @@ if ($_POST) {
case "^9(\d{3})$":
$action_data = "sofia/gateway/".$gateway."/1".$default_area_code."\$1";
$label = "dial 9, 3 digits";
- $abbrv = "9.3d";
+ $abbrv = "9.3d";
break;
case "^9(\d{4})$":
$action_data = "sofia/gateway/".$gateway."/1".$default_area_code."\$1";
$label = "dial 9, 4 digits";
- $abbrv = "9.4d";
- break;
+ $abbrv = "9.4d";
+ break;
case "^9(\d{7})$":
$action_data = "sofia/gateway/".$gateway."/1".$default_area_code."\$1";
$label = "dial 9, 7 digits";
- $abbrv = "9.7d";
+ $abbrv = "9.7d";
break;
case "^9(\d{10})$":
$action_data = "sofia/gateway/".$gateway."/\$1";
@@ -194,7 +194,7 @@ if ($_POST) {
$label = $dialplan_expression;
$abbrv = $dialplan_expression;
}
-
+
$dialplanincludeid = guid();
$ent['dialplanincludeid'] = $dialplanincludeid;
$ent['extensionname'] = $gateway.".".$abbrv;
@@ -295,7 +295,7 @@ function show_advanced_config() {
<td class="tabcont" >
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Gateway Setup<br>
</strong></span>
@@ -305,69 +305,69 @@ function show_advanced_config() {
</tr>
</table>
<br />
-
+
<form action="freeswitch_gateways_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Gateway</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="gateway" type="text" class="formfld" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
<br><span class="vexpl">Enter the gateway name here.<br></span>
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Username</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="username" type="text" class="formfld" id="username" size="40" value="<?=htmlspecialchars($pconfig['username']);?>">
<br><span class="vexpl">Enter the username here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Password</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="password" type="password" class="formfld" id="password" size="40" value="<?=htmlspecialchars($pconfig['password']);?>">
<br><span class="vexpl">Enter the password here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">From-user</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="from-user" type="text" class="formfld" id="from-user" size="40" value="<?=htmlspecialchars($pconfig['from-user']);?>">
<br><span class="vexpl">Enter the from-user here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">From-domain</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="from-domain" type="text" class="formfld" id="from-domain" size="40" value="<?=htmlspecialchars($pconfig['from-domain']);?>">
<br><span class="vexpl">Enter the from-domain here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Proxy</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="proxy" type="text" class="formfld" id="proxy" size="40" value="<?=htmlspecialchars($pconfig['proxy']);?>">
<br><span class="vexpl">Enter the proxy here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Realm</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="realm" type="text" class="formfld" id="realm" size="40" value="<?=htmlspecialchars($pconfig['realm']);?>">
<br><span class="vexpl">Enter the realm here.<br></span>
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Expire-seconds</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="expire-seconds" type="text" class="formfld" id="expire-seconds" size="40" value="<?=htmlspecialchars($pconfig['expire-seconds']);?>">
<br><span class="vexpl">Enter the expire-seconds here. Example: 600<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Register</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='register' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['register'])) {
@@ -385,32 +385,32 @@ function show_advanced_config() {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
Choose whether to register.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Retry-seconds</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="retry-seconds" type="text" class="formfld" id="retry-seconds" size="40" value="<?=htmlspecialchars($pconfig['retry-seconds']);?>">
<br> <span class="vexpl">Enter the retry_seconds here. Example: 30<br></span>
</td>
- </tr>
-
+ </tr>
+
<tr>
<td width="22%" valign="top" class="vncellreq">Context</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="context" type="text" class="formfld" id="context" size="40" value="<?=htmlspecialchars($pconfig['context']);?>">
<br> <span class="vexpl">Enter the context here. Example: public<br></span>
</td>
- </tr>
+ </tr>
</table>
<div id="showadvancedbox">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncell">Show Advanced</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input type="button" onClick="show_advanced_config()" value="Advanced"></input></a>
</td>
</tr>
@@ -420,8 +420,8 @@ function show_advanced_config() {
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncell">Register-transport</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='register-transport' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['register-transport'])) {
@@ -432,28 +432,28 @@ function show_advanced_config() {
case "tcp":
echo " <option value='udp'>udp</option>\n";
echo " <option value='tcp' selected='yes'>tcp</option>\n";
-
+
break;
default:
echo " <option value='udp'>udp</option>\n";
echo " <option value='tcp'>tcp</option>\n";
}
echo " </select>\n";
- ?>
- Choose whether to register-transport.
+ ?>
+ Choose whether to register-transport.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Extension</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="extension" type="text" class="formfld" id="extension" size="40" value="<?=htmlspecialchars($pconfig['extension']);?>">
<br> <span class="vexpl">Enter the extension here.<br></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Caller-id-in-from</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='caller-id-in-from' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['caller-id-in-from'])) {
@@ -464,20 +464,20 @@ function show_advanced_config() {
case "false":
echo " <option value='true'>true</option>\n";
echo " <option value='false' selected='yes'>false</option>\n";
-
+
break;
default:
echo " <option value='true'>true</option>\n";
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Supress-cng</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='supress-cng' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['supress-cng'])) {
@@ -488,25 +488,25 @@ function show_advanced_config() {
case "false":
echo " <option value='true'>true</option>\n";
echo " <option value='false' selected='yes'>false</option>\n";
-
+
break;
default:
echo " <option value='true'>true</option>\n";
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
</table>
-
+
</div>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Enabled</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='enabled' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['enabled'])) {
@@ -524,10 +524,10 @@ function show_advanced_config() {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
-
+
<tr>
<td width="22%" valign="top" class="vncell">Dialplan Expression</td>
<td width="78%" class="vtable">
@@ -536,7 +536,7 @@ function show_advanced_config() {
?>
<br>
<select name='dialplan_expression_select' id='dialplan_expression_select' onchange="document.getElementById('dialplan_expression').value += document.getElementById('dialplan_expression_select').value + '\n';" class='formfld'>
- <option></option>
+ <option></option>
<option value='^(\d{7})$'>7 digits local</option>
<option value='^(\d{10})$'>10 digits long distance</option>
<option value='^(\d{11})$'>11 digits long distance</option>
@@ -549,17 +549,17 @@ function show_advanced_config() {
<option value='^9(\d{4})$'>Dial 9 then 4 digits</option>
<option value='^9(\d{7})$'>Dial 9 then 7 digits</option>
<option value='^9(\d{10})$'>Dial 9 then 10 digits</option>
- <option value='^9(\d{11})$'>Dial 9 then 11 digits</option>
+ <option value='^9(\d{11})$'>Dial 9 then 11 digits</option>
</select>
<span class="vexpl">
<br />
- Shortcut to create the outbound dialplan entries for this Gateway. The entries are saved to and edited from the 'Dialplan' tab.
+ Shortcut to create the outbound dialplan entries for this Gateway. The entries are saved to and edited from the 'Dialplan' tab.
</span></td>
- </tr>
-
+ </tr>
+
<tr>
<td width="22%" valign="top" class="vncell">Gateway Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>">
<br> <span class="vexpl">Enter the description of the gateway here.</span></td>
</tr>
diff --git a/config/freeswitch/freeswitch_ivr.tmp b/config/freeswitch/freeswitch_ivr.tmp
index 55f64a79..7c9f9c05 100644
--- a/config/freeswitch/freeswitch_ivr.tmp
+++ b/config/freeswitch/freeswitch_ivr.tmp
@@ -4,7 +4,7 @@
freeswitch_ivr.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -84,7 +84,7 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_ivr.php" method="post" name="iform" id="iform">
-<?php
+<?php
//echo "<pre>";
@@ -93,11 +93,11 @@ include("head.inc");
//build a list of recordings from the config.xml
//$config_recording_list = '';
-//$i = 0;
+//$i = 0;
//if (count($a_ivr) > 0) {
// foreach ($a_ivr as $ivrent) {
// $config_recording_list .= $ivrent['filename']."|";
-// $i++;
+// $i++;
// }
//}
//echo "config recording list: ".$config_recording_list."<br />\n";
@@ -105,29 +105,29 @@ include("head.inc");
//if ($config_change == 1) {
// write_config();
-// $config_change = 0;
+// $config_change = 0;
//}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>IVR<br />
</strong></span>
- An interactive voice response (IVR) often refered to as an Auto Attendant.
- It associates a recording to multiple options that can be used to direct calls
- to extensions, voicemail, queues, other IVR applications, and external
+ An interactive voice response (IVR) often refered to as an Auto Attendant.
+ It associates a recording to multiple options that can be used to direct calls
+ to extensions, voicemail, queues, other IVR applications, and external
phone numbers.
</span></p></td>
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Extension</td>
@@ -143,9 +143,9 @@ include("head.inc");
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_ivr) > 0) {
+ if (count($a_ivr) > 0) {
foreach ($a_ivr as $ent) {
if (strlen($ent['ivrid']) > 0) {
?>
@@ -169,8 +169,8 @@ include("head.inc");
</td>
</tr>
<?php
- }
- $i++;
+ }
+ $i++;
}
}
?>
@@ -191,7 +191,7 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
<br>
diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp
index 047e1a63..dd8cd7bb 100644
--- a/config/freeswitch/freeswitch_ivr_edit.tmp
+++ b/config/freeswitch/freeswitch_ivr_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_ivr_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -122,8 +122,8 @@ $parentid = $id;
$ivrconditionjs .= " condition = false;\n";
$ivrconditionjs .= "}\n";
$ivrconditionjs .= "\n";
-
-
+
+
if (isset($id) && $a_ivr[$id]) {
$pconfig['ivrid'] = $a_ivr[$id]['ivrid'];
$ivrid = $a_ivr[$id]['ivrid'];
@@ -171,7 +171,7 @@ if ($_POST) {
$ivrent['recordingidaction'] = $_POST['recordingidaction'];
$ivrent['recordingidantiaction'] = $_POST['recordingidantiaction'];
$ivrent['ivrtimeout'] = $_POST['ivrtimeout'];
- $ivrent['ivrcontext'] = $_POST['ivrcontext'];
+ $ivrent['ivrcontext'] = $_POST['ivrcontext'];
$ivrent['ivrconditionjs'] = base64_encode($_POST['ivrconditionjs']);
$ivrent['ivrdescr'] = $_POST['ivrdescr'];
@@ -227,8 +227,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>General Settings:<br>
</strong></span>
@@ -242,20 +242,20 @@ include("head.inc");
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Extension</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="ivrextension" type="text" class="formfld" id="ivrextension" size="40" value="<?=htmlspecialchars($pconfig['ivrextension']);?>">
<br> <span class="vexpl">e.g. <em>5002</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">IVR Name</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="ivrname" type="text" class="formfld" id="ivrname" size="40" value="<?=htmlspecialchars($pconfig['ivrname']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Recording Action</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
$a_recordings = &$config['installedpackages']['freeswitchrecordings']['config'];
echo " <select name='recordingidaction' class='formfld'>\n";
echo " <option></option>\n";
@@ -270,13 +270,13 @@ include("head.inc");
}
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Recording Anti-Action</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
//$a_recordings = &$config['installedpackages']['freeswitchrecordings']['config'];
echo " <select name='recordingidantiaction' class='formfld'>\n";
echo " <option></option>\n";
@@ -291,33 +291,33 @@ include("head.inc");
}
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
<?php
if (strlen($pconfig['ivrtimeout']) == 0) {
$pconfig['ivrtimeout'] = 10; //set a default timeout
- }
- ?>
+ }
+ ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Timeout</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="ivrtimeout" type="text" class="formfld" id="ivrtimeout" size="40" value="<?=htmlspecialchars($pconfig['ivrtimeout']);?>">
- <br><span class="vexpl">After the recording concludes the
- timeout sets the time in seconds to continue to wait for DTMF.
- If the DTMF is <br />not detected during that time the 't'
+ <br><span class="vexpl">After the recording concludes the
+ timeout sets the time in seconds to continue to wait for DTMF.
+ If the DTMF is <br />not detected during that time the 't'
timeout option is executed.</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Context</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="ivrcontext" type="text" class="formfld" id="ivrextension" size="40" value="<?=htmlspecialchars($pconfig['ivrcontext']);?>">
<br> <span class="vexpl">e.g. <em>default</em></span></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="ivrdescr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['ivrdescr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
@@ -335,14 +335,14 @@ include("head.inc");
echo "<textarea name=\"ivrconditionjs\" cols=\"50\" rows=\"7\" wrap=\"off\">".htmlspecialchars(base64_decode($pconfig['ivrconditionjs']))."</textarea>\n";
}
?>
- <br> <span class="vexpl">A simple valid condition is:
- condition=true; To re-populate the default simply empty the
- textarea and click on save. The following javascript variables
- have been defined: Hours, Mins, Seconds, Month, Date, Year,
+ <br> <span class="vexpl">A simple valid condition is:
+ condition=true; To re-populate the default simply empty the
+ textarea and click on save. The following javascript variables
+ have been defined: Hours, Mins, Seconds, Month, Date, Year,
and Day.</span></td>
- </tr>
-
-
+ </tr>
+
+
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
@@ -355,39 +355,39 @@ include("head.inc");
</tr>
</table>
</form>
-
+
<br>
<br>
<form action="freeswitch_ivr_edit.php" method="post" name="iform2" id="iform2">
- <?php
-
-
+ <?php
+
+
//echo "<pre>";
//print_r ($a_ivr);
//echo "</pre>";
-
- //if ($savemsg) print_info_box($savemsg);
+
+ //if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
- //endif;
-
+ //endif;
+
?>
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong><br>
</strong></span>
- Options are the choices that are available to the caller when they
- are calling the auto attendant. If the caller presses 2 then the call
+ Options are the choices that are available to the caller when they
+ are calling the auto attendant. If the caller presses 2 then the call
is directed to the corresponding destination.
</span></p></td>
</tr>
</table>
-
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Action<br />
</strong></span>
@@ -396,7 +396,7 @@ include("head.inc");
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Option</td>
@@ -413,9 +413,9 @@ include("head.inc");
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_ivr_options) > 0) {
+ if (count($a_ivr_options) > 0) {
foreach ($a_ivr_options as $ent) {
if ($ent['optionaction'] == "action" && $ivrid == $ent['ivrid']) {
?>
@@ -428,7 +428,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_ivr_options_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&ivrid=<?=$ivrid;?>';">
<?=$ent['optiondest'];?>&nbsp;
- </td>
+ </td>
<td class="listbg" ondblclick="document.location='freeswitch_ivr_options_edit.php?id=<?=$id;?>&parentid=<?=$parentid;?>&ivrid=<?=$ivrid;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($ent['optiondescr']);?>&nbsp;
</td>
@@ -441,9 +441,9 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
?>
@@ -465,36 +465,36 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
-
+
<form action="freeswitch_ivr_edit.php" method="post" name="iform2" id="iform2">
- <?php
-
-
+ <?php
+
+
//echo "<pre>";
//print_r ($a_ivr);
//echo "</pre>";
-
- //if ($savemsg) print_info_box($savemsg);
+
+ //if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
- //endif;
-
+ //endif;
+
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Anti-Action<br />
</strong></span>
- The options that are executed when the <b>condition does NOT match.</b>
+ The options that are executed when the <b>condition does NOT match.</b>
</span></p></td>
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Option</td>
@@ -511,9 +511,9 @@ include("head.inc");
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_ivr_options) > 0) {
+ if (count($a_ivr_options) > 0) {
foreach ($a_ivr_options as $ent) {
if ($ent['optionaction'] == "anti-action" && $ivrid == $ent['ivrid']) {
?>
@@ -526,7 +526,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_ivr_options_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&ivrid=<?=$ivrid;?>';">
<?=$ent['optiondest'];?>&nbsp;
- </td>
+ </td>
<td class="listbg" ondblclick="document.location='freeswitch_ivr_options_edit.php?id=<?=$id;?>&parentid=<?=$parentid;?>&ivrid=<?=$ivrid;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($ent['optiondescr']);?>&nbsp;
</td>
@@ -539,9 +539,9 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
?>
@@ -563,11 +563,11 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
-
+
+ <br>
<br>
- <br>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_ivr_options.tmp b/config/freeswitch/freeswitch_ivr_options.tmp
index 8356bc58..b5716af4 100755
--- a/config/freeswitch/freeswitch_ivr_options.tmp
+++ b/config/freeswitch/freeswitch_ivr_options.tmp
@@ -4,7 +4,7 @@
freeswitch_ivr_options.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
diff --git a/config/freeswitch/freeswitch_ivr_options_edit.tmp b/config/freeswitch/freeswitch_ivr_options_edit.tmp
index 987f3575..085fa48a 100644
--- a/config/freeswitch/freeswitch_ivr_options_edit.tmp
+++ b/config/freeswitch/freeswitch_ivr_options_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_recordings_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -89,7 +89,7 @@ if ($_POST) {
$a_ivr_options[$id] = $ivroptionent;
}
else {
- //add
+ //add
$a_ivr_options[] = $ivroptionent;
}
@@ -135,19 +135,19 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
+
<form action="freeswitch_ivr_options_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Option Number</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optionnumber" type="text" class="formfld" id="optionnumber" size="40" value="<?=htmlspecialchars($pconfig['optionnumber']);?>">
<br> <span class="vexpl">Option Number<br>
e.g. <em>1</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Type</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<?php
echo " <select name='optiontype' class='formfld'>\n";
echo " <option></option>\n";
@@ -166,17 +166,17 @@ include("head.inc");
echo " </select>\n";
?>
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Destination</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optiondest" type="text" class="formfld" id="optiondest" size="40" value="<?=htmlspecialchars($pconfig['optiondest']);?>">
<br> <span class="vexpl">Destination<br>
e.g. <em>1001</em></span></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optiondescr" type="text" class="formfld" id="optiondescr" size="40" value="<?=htmlspecialchars($pconfig['optiondescr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
@@ -186,23 +186,23 @@ include("head.inc");
<td width="78%">
<input name="ivrid" type="hidden" value="<?=$ivrid;?>">
<input name="parentid" type="hidden" value="<?=$parentid;?>">
- <input name="optionaction" type="hidden" value="<?=$pconfig['optionaction'];?>">
+ <input name="optionaction" type="hidden" value="<?=$pconfig['optionaction'];?>">
<?php if (isset($id) && $a_ivr_options[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
+ <input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
<input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
</td>
</tr>
</table>
</form>
-
+
<br>
<br>
<br>
<br>
<br>
<br>
-
+
</td>
</tr>
</table>
diff --git a/config/freeswitch/freeswitch_mailto.tmp b/config/freeswitch/freeswitch_mailto.tmp
index 23645570..402a0524 100755
--- a/config/freeswitch/freeswitch_mailto.tmp
+++ b/config/freeswitch/freeswitch_mailto.tmp
@@ -4,7 +4,7 @@
freeswitch_mailto.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -32,7 +32,7 @@
require_once("config.inc");
require_once("/usr/local/pkg/freeswitch.inc");
-global $config;
+global $config;
$tmp_smtphost = $config['installedpackages']['freeswitchsettings']['config'][0]['smtphost'];
$tmp_smtpsecure = $config['installedpackages']['freeswitchsettings']['config'][0]['smtpsecure']; //options "", "TLS", "SSL"
@@ -43,12 +43,12 @@ $tmp_smtppassword = $config['installedpackages']['freeswitchsettings']['config']
$tmp_smtpfrom = $config['installedpackages']['freeswitchsettings']['config'][0]['smtpfrom'];
$tmp_smtpfromname = $config['installedpackages']['freeswitchsettings']['config'][0]['smtpfromname'];
-
+
ini_set(max_execution_time,900); //15 minutes
ini_set('memory_limit', '96M');
$fd = fopen("php://stdin", "r");
-$email = file_get_contents ("php://stdin");
+$email = file_get_contents ("php://stdin");
fclose($fd);
@@ -65,8 +65,8 @@ ob_start();
$tmparray = split("\n\n", $email);
$mainheader = $tmparray[0];
$maincontent = substr($email, strlen($mainheader), strlen($email));
-
-//get the boundary
+
+//get the boundary
$tmparray = split("\n", $mainheader);
$contenttmp = $tmparray[1]; //Content-Type: multipart/mixed; boundary="XXXX_boundary_XXXX"
$tmparray = split('; ', $contenttmp); //boundary="XXXX_boundary_XXXX"
@@ -75,11 +75,11 @@ ob_start();
$boundary = $tmparray[1];
$boundary = trim($boundary,'"');
//echo "boundary: $boundary\n";
-
+
//put the main headers into an array
$mainheaderarray = split("\n", $mainheader);
//print_r($mainheaderarray);
- foreach ($mainheaderarray as $val) {
+ foreach ($mainheaderarray as $val) {
$tmparray = split(': ', $val);
//print_r($tmparray);
$var[$tmparray[0]] = trim($tmparray[1]);
@@ -87,13 +87,13 @@ ob_start();
$var['To'] = str_replace("<", "", $var['To']);
$var['To'] = str_replace(">", "", $var['To']);
-
+
echo "To: ".$var['To']."\n";
echo "From: ".$var['From']."\n";
echo "Subject: ".$var['Subject']."\n";
//print_r($var);
echo "\n\n";
-
+
// split mime type multi-part into each part
$maincontent = str_replace($boundary."--", $boundary, $maincontent);
@@ -102,7 +102,7 @@ ob_start();
// loop through each mime part
$i=0;
foreach ($tmparray as $mimepart) {
-
+
$mimearray = split("\n\n", $mimepart);
$subheader = $mimearray[0];
$headermimearray = split("\n", trim($subheader));
@@ -117,40 +117,40 @@ ob_start();
//echo "subboundary: ".$subboundary."\n";
}
}
- else {
+ else {
$tmparray = split(':', $val); //':' found
}
-
+
//print_r($tmparray);
$var[trim($tmparray[0])] = trim($tmparray[1]);
}
//print_r($var);
-
-
+
+
$contenttypearray = split(' ', $headermimearray[0]);
-
+
if ($contenttypearray[0] == "Content-Type:") {
$contenttype = trim($contenttypearray[1]);
-
+
switch ($contenttype) {
case "multipart/alternative;":
-
+
//echo "type: ".$contenttype."\n";
$content = trim(substr($mimepart, strlen($subheader), strlen($mimepart)));
-
+
$content = str_replace($subboundary."--", $subboundary, $content);
$tmpsubarray = split("--".$subboundary, $content);
foreach ($tmpsubarray as $mimesubsubpart) {
-
+
$mimesubsubarray = split("\n\n", $mimesubsubpart);
$subsubheader = $mimesubsubarray[0];
-
+
$headersubsubmimeearray = split("\n", trim($subsubheader));
$subsubcontenttypearray = split(' ', $headersubsubmimeearray[0]);
//echo "subsubcontenttypearray[0] ".$subsubcontenttypearray[0]."\n";
if ($subsubcontenttypearray[0] == "Content-Type:") {
- $subsubcontenttype = trim($subsubcontenttypearray[1]);
+ $subsubcontenttype = trim($subsubcontenttypearray[1]);
switch ($subsubcontenttype) {
case "text/plain;":
$textplain = trim(substr($mimesubsubpart, strlen($subsubheader), strlen($mimesubsubpart)));
@@ -162,51 +162,51 @@ ob_start();
break;
}
} //end if
-
+
} //end foreach
-
+
break;
case "audio/wav;":
- //echo "type: ".$contenttype."\n";
+ //echo "type: ".$contenttype."\n";
$strwav = trim(substr($mimepart, strlen($subheader), strlen($mimepart)));
//echo "\n*** begin wav ***\n".$strwav."\n*** end wav ***\n";
break;
-
- }//end switch
+
+ }//end switch
} //end if
-
- $i++;
-
+
+ $i++;
+
} //end foreach
//send the email
-
+
include "class.phpmailer.php";
include "class.smtp.php"; ; // optional, gets called from within class.phpmailer.php if not already loaded
-
+
$mail = new PHPMailer();
-
+
$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPAuth = $tmp_smtpauth; // turn on/off SMTP authentication
$mail->Host = $tmp_smtphost;
if (strlen($tmp_smtpsecure)>0) {
$mail->SMTPSecure = $tmp_smtpsecure;
}
- if ($tmp_smtpauth) {
+ if ($tmp_smtpauth) {
$mail->Username = $tmp_smtpusername;
$mail->Password = $tmp_smtppassword;
}
-
+
$mail->From = $tmp_smtpfrom;
$mail->FromName = $tmp_smtpfromname;
$mail->Subject = $var['Subject'];
$mail->AltBody = $textplain; // optional, comment out and test
$mail->MsgHTML($texthtml);
-
-
+
+
$tmp_to = $var['To'];
$tmp_to = str_replace(";", ",", $tmp_to);
$tmp_to_array = split(",", $tmp_to);
@@ -222,10 +222,10 @@ ob_start();
$mail->AddStringAttachment(base64_decode($strwav),$filename,$encoding,$type);
}
unset($strwav);
-
+
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
- }
+ }
else {
echo "Message sent!";
}
diff --git a/config/freeswitch/freeswitch_modules.xml b/config/freeswitch/freeswitch_modules.xml
index cca48f9f..05762fa0 100644
--- a/config/freeswitch/freeswitch_modules.xml
+++ b/config/freeswitch/freeswitch_modules.xml
@@ -65,7 +65,7 @@
<name>freeswitch</name>
<rcfile>freeswitch.sh</rcfile>
<executable>freeswitch</executable>
- <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
</service>
<tabs>
<tab>
diff --git a/config/freeswitch/freeswitch_public_includes.tmp b/config/freeswitch/freeswitch_public_includes.tmp
index c1ef5086..1947d8ff 100644
--- a/config/freeswitch/freeswitch_public_includes.tmp
+++ b/config/freeswitch/freeswitch_public_includes.tmp
@@ -4,7 +4,7 @@
freeswitch_public_includes.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -41,7 +41,7 @@ require("/usr/local/pkg/freeswitch.inc");
//default
//enabled
//descr
-
+
//freeswitchpublicincludedetails
//publicincludeid
@@ -53,7 +53,7 @@ require("/usr/local/pkg/freeswitch.inc");
//tagorder
//1-20
//fieldtype
-
+
//fielddata
@@ -63,7 +63,7 @@ $a_public_includes_details = &$config['installedpackages']['freeswitchpublicincl
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'publicincludes') {
-
+
if ($a_public_includes[$_GET['id']]) {
$publicincludeid = $a_public_includes[$_GET['id']][publicincludeid];
@@ -71,7 +71,7 @@ if ($_GET['act'] == "del") {
$extensionname = $a_public_includes[$_GET['id']][extensionname];
$order = $a_public_includes[$_GET['id']][order];
$publicincludefilename = $order."_".$extensionname.".xml";
-
+
//delete the public include details. aka. child data
if (count($a_public_includes_details) > 0) {
$i=0;
@@ -81,17 +81,17 @@ if ($_GET['act'] == "del") {
//echo "child id: ".$i."<br />\n";
unset($a_public_includes_details[$i]);
}
- $i++;
+ $i++;
}
}
}
-
+
//if the public include xml file exists then delete it
if (file_exists("/usr/local/freeswitch/conf/public/default/".$publicincludefilename)) {
unlink("/usr/local/freeswitch/conf/public/default/".$publicincludefilename);
}
-
- unset($publicincludefilename);
+
+ unset($publicincludefilename);
unset($a_public_includes[$_GET['id']]);
write_config();
sync_package_freeswitch_public_includes();
@@ -136,7 +136,7 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_public_includes.php" method="post" name="iform" id="iform">
-<?php
+<?php
//echo "<pre>";
@@ -146,28 +146,28 @@ include("head.inc");
//if ($config_change == 1) {
// write_config();
-// $config_change = 0;
+// $config_change = 0;
//}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
<br />
<br />
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><span class="vexpl"><span class="red"><strong>Public
</strong></span></span>
</td>
<td align='right'>
<input type='button' value='public.xml' alt='' onclick="document.location.href='/pkg_edit.php?xml=freeswitch_public.xml&id=0';">
- </td>
+ </td>
</tr>
<tr>
<td colspan='2'>
@@ -175,14 +175,14 @@ include("head.inc");
The public dialplan is used to route incoming calls to destinations based on conditions and context. It can send incoming calls to IVRs, extensions, external numbers, and scripts.
</span>
</td>
-
+
</tr>
</table>
<br />
<br />
- <br />
-
+ <br />
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Extension Name</td>
@@ -199,9 +199,9 @@ include("head.inc");
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_public_includes) > 0) {
+ if (count($a_public_includes) > 0) {
foreach ($a_public_includes as $ent) {
if (strlen($ent['extensionname'].$ent['enabled']) > 0) {
?>
@@ -227,7 +227,7 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
} //end if strlen
$i++;
} //end for each
@@ -250,7 +250,7 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
/usr/local/freeswitch/conf/dialplan/public/
diff --git a/config/freeswitch/freeswitch_public_includes_details.tmp b/config/freeswitch/freeswitch_public_includes_details.tmp
index c28a7647..c6546b01 100755
--- a/config/freeswitch/freeswitch_public_includes_details.tmp
+++ b/config/freeswitch/freeswitch_public_includes_details.tmp
@@ -4,7 +4,7 @@
freeswitch_public_includes_details.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
diff --git a/config/freeswitch/freeswitch_public_includes_details_edit.tmp b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
index dd332d14..451764d6 100644
--- a/config/freeswitch/freeswitch_public_includes_details_edit.tmp
+++ b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_public_includes_details_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -62,9 +62,9 @@ if (isset($_POST['publicincludeid'])) {
//tagorder
//1-20
//fieldtype
-
+
//fielddata
-
+
if (isset($id) && $a_public_includes_details[$id]) {
$pconfig['publicincludeid'] = $a_public_includes_details[$id]['publicincludeid'];
@@ -89,7 +89,7 @@ if ($_POST) {
if (!$input_errors) {
-
+
$ent = array();
$ent['publicincludeid'] = $_POST['publicincludeid'];
$ent['tag'] = $_POST['tag'];
@@ -103,7 +103,7 @@ if ($_POST) {
$a_public_includes_details[$id] = $ent;
}
else {
- //add
+ //add
$a_public_includes_details[] = $ent;
}
@@ -143,14 +143,14 @@ include("head.inc");
$tab_array[] = array(gettext("Status"), false, "/freeswitch/freeswitch_status.php");
$tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
display_top_tabs($tab_array);
-
+
?>
</td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
+
<form action="freeswitch_public_includes_details_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
@@ -178,9 +178,9 @@ include("head.inc");
if (tag == "") {
document.getElementById("label_fieldtype").innerHTML = "Type";
document.getElementById("label_fielddata").innerHTML = "Data";
- }
+ }
}
- </script>
+ </script>
<?php
echo " <select name='tag' class='formfld' id='form_tag' onchange='public_include_details_tag_onchange();'>\n";
echo " <option></option>\n";
@@ -208,7 +208,7 @@ include("head.inc");
echo " <option>action</option>\n";
echo " <option>anti-action</option>\n";
//echo " <option selected='yes'>param</option>\n";
- break;
+ break;
default:
echo " <option>condition</option>\n";
echo " <option>action</option>\n";
@@ -216,31 +216,31 @@ include("head.inc");
//echo " <option>param</option>\n";
}
echo " </select>\n";
-
+
//condition
//field expression
//action
- //application
+ //application
//data
//antiaction
- //application
+ //application
//data
//param
//name
//value
-
+
?>
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq" id="label_fieldtype">Type</td>
- <td width="78%" class="vtable">
- <input name="fieldtype" type="text" class="formfld" id="fieldtype" size="40" value="<?=htmlspecialchars($pconfig['fieldtype']);?>">
+ <td width="78%" class="vtable">
+ <input name="fieldtype" type="text" class="formfld" id="fieldtype" size="40" value="<?=htmlspecialchars($pconfig['fieldtype']);?>">
</td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq" id="label_fielddata">Data</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="fielddata" type="text" class="formfld" id="fielddata" size="40" value="<?=htmlspecialchars($pconfig['fielddata']);?>">
<br> <span class="vexpl"></span></td>
</tr>
@@ -248,9 +248,9 @@ include("head.inc");
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="publicincludeid" type="hidden" value="<?=$publicincludeid;?>">
- <input name="parentid" type="hidden" value="<?=$parentid;?>">
+ <input name="parentid" type="hidden" value="<?=$parentid;?>">
<?php if (isset($id) && $a_public_includes_details[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
+ <input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
<input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
</td>
@@ -264,7 +264,7 @@ include("head.inc");
<b>Example</b>
<br />
<br />
- If the inbound call matches the DID 12085551234 then proceed to the action.
+ If the inbound call matches the DID 12085551234 then proceed to the action.
<br />
<br />
<table cellpadding='3'>
@@ -274,8 +274,8 @@ include("head.inc");
</table>
<br />
- <br />
-
+ <br />
+
Transfer the inbound call to an IVR with extension of 5000.
<br />
<br />
@@ -283,8 +283,8 @@ include("head.inc");
<tr><th class="vncellreq" width='75' align="left">Tag:</th><td class="vtable">action</td></tr>
<tr><th class="vncellreq" align="left">Application:</th><td class="vtable">transfer</td></tr>
<tr><th class="vncellreq" align="left">Data:</th><td class="vtable">5000 XML default</td></tr>
- </table>
-
+ </table>
+
<br />
<br />
@@ -295,15 +295,15 @@ include("head.inc");
<tr><th class="vncellreq" width='75' align="left">Tag:</th><td class="vtable">action</td></tr>
<tr><th class="vncellreq" align="left">Application:</th><td class="vtable">transfer</td></tr>
<tr><th class="vncellreq" align="left">Data:</th><td class="vtable">1001 XML default</td></tr>
- </table>
+ </table>
+
-
<br />
<br />
<br />
<br />
-
-
+
+
<b>Conditions</b>
<br />
<br />
@@ -320,49 +320,49 @@ include("head.inc");
<li><b>uuid</b> Unique identifier of the current call? (looks like a GUID)</li>
<li><b>source</b> Name of the FreeSwitch module that received the call (e.g. PortAudio)</li>
<li><b>chan_name</b> Name of the current channel (Example: PortAudio/1234). Give us examples when this one can be used.</li>
- <li><b>network_addr</b> IP address of the signalling source for a VoIP call.</li>
+ <li><b>network_addr</b> IP address of the signalling source for a VoIP call.</li>
</ul>
In addition to the above you can also do variables using the syntax ${variable} or api functions using the syntax %{api} {args}
<br />
<br />
- Variables may be used in either the field or the expression, as follows
+ Variables may be used in either the field or the expression, as follows
<br />
<br />
<br />
<br />
-
+
<b>Action and Anti-Actions</b>
<br />
<br />
Actions are executed when the <b>condition matches</b>. Anti-Actions are executed when the <b>condition does NOT match</b>.
Additional information on applications for Actions and Anti-Actions.<br />
- <a href='http://wiki.freeswitch.org/wiki/Modules#Applications' target='_blank'>http://wiki.freeswitch.org/wiki/Modules#Applications</a>
+ <a href='http://wiki.freeswitch.org/wiki/Modules#Applications' target='_blank'>http://wiki.freeswitch.org/wiki/Modules#Applications</a>
<br />
<a href='http://wiki.freeswitch.org/wiki/public_Functions' target='_blank'>http://wiki.freeswitch.org/wiki/public_Functions</a>
<br />
<br />
<br />
- The following is a partial list of <b>applications</b>.
+ The following is a partial list of <b>applications</b>.
<ul>
<li><b>answer</b> answer the call</li>
<li><b>bridge</b> bridge the call<li>
<li><b>cond</b></li>
- <li><b>db</b> is a a runtime database either sqlite by default or odbc</li>
+ <li><b>db</b> is a a runtime database either sqlite by default or odbc</li>
<li><b>global_set</b> allows setting of global vars similar to the ones found in vars.xml</li>
<li><b>group</b> allows grouping of several extensions for things like ring groups</li>
<li><b>expr</b></li>
- <li><b>hangup</b> hangs up the call</li>
+ <li><b>hangup</b> hangs up the call</li>
<li><b>info</b> sends call info to the console</li>
<li><b>javascript</b> run javascript .js files</li>
<li><b>playback</b></li>
<li><b>reject</b> reject the call</li>
- <li><b>respond</b></li>
- <li><b>ring_ready</b></li>
+ <li><b>respond</b></li>
+ <li><b>ring_ready</b></li>
<li><b>set</b> set a variable</li>
<li><b>set_user</b></li>
<li><b>sleep</b></li>
- <li><b>sofia_contact</b></li>
+ <li><b>sofia_contact</b></li>
<li><b>transfer</b> transfer the call to another extension or number<li>
<li><b>voicemail</b> send the call to voicemail</li>
</ul>
@@ -375,13 +375,13 @@ include("head.inc");
<b>Param</b>
Example parameters by name and value
<br />
- <a href='http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go' target='_blank'>http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go</a>
+ <a href='http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go' target='_blank'>http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go</a>
<ul>
- <li><b>codec-ms</b> 20</li>
+ <li><b>codec-ms</b> 20</li>
<li><b>codec-prefs</b> PCMU@20i</li>
<li><b>debug</b> 1</li>
<li><b>public</b> XML</li>
- <li><b>dtmf-duration</b> 100</li>
+ <li><b>dtmf-duration</b> 100</li>
<li><b>rfc2833-pt</b>" 101</li>
<li><b>sip-port</b> 5060</li>
<li><b>use-rtp-timer</b> true</li>
@@ -390,13 +390,13 @@ include("head.inc");
<br />
-->
-
+
<br />
<br />
<br />
<br />
<br />
-
+
</td>
</tr>
</table>
diff --git a/config/freeswitch/freeswitch_public_includes_edit.tmp b/config/freeswitch/freeswitch_public_includes_edit.tmp
index 7ccbaeec..74f3c020 100644
--- a/config/freeswitch/freeswitch_public_includes_edit.tmp
+++ b/config/freeswitch/freeswitch_public_includes_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_public_includes_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -43,7 +43,7 @@ require("/usr/local/pkg/freeswitch.inc");
//default
//enabled
//descr
-
+
//
@@ -90,11 +90,11 @@ if ($_POST) {
if (!$input_errors) {
-
+
$ent = array();
if (strlen($_POST['publicincludeid']) > 0) {
//update
- $ent['publicincludeid'] = $_POST['publicincludeid'];
+ $ent['publicincludeid'] = $_POST['publicincludeid'];
}
else {
//add
@@ -109,49 +109,49 @@ if ($_POST) {
$ent['opt1name'] = $_POST['opt1name'];
$ent['opt1value'] = $_POST['opt1value'];
-
+
if (isset($id) && $a_public_includes[$id]) {
$a_public_includes = $config['installedpackages']['freeswitchpublicincludes']['config'];
if (count($a_public_includes) > 0) {
foreach($a_public_includes as $rowhelper) {
-
+
//$rowhelper['publicincludeid'];
//$rowhelper['extensionname'];
//$rowhelper['context'];
//$rowhelper['enabled'];
-
+
$filenamechanged = false;
if ($rowhelper['publicincludeid'] == $_POST['publicincludeid']) {
-
+
if ($rowhelper['extensionname'] != $_POST['extensionname']) {
//if the extension name has changed then remove the current public xml file
//to prepare for the new file
- $filenamechanged = true;
+ $filenamechanged = true;
}
if ($rowhelper['order'] != $_POST['order']) {
//if the order has changed then remove the current public xml file
//to prepare for the new file
- $filenamechanged = true;
- }
+ $filenamechanged = true;
+ }
if ($_POST['enabled'] == "false") {
//if the extension name is disabled then remove the public xml file
$filenamechanged = true;
}
- if ($filenamechanged){
+ if ($filenamechanged){
$publicincludefilename = $rowhelper['order']."_".$rowhelper['extensionname'].".xml";
if (file_exists("/usr/local/freeswitch/conf/dialplan/public/".$publicincludefilename)) {
unlink("/usr/local/freeswitch/conf/dialplan/public/".$publicincludefilename);
}
unset($publicincludefilename);
}
-
+
}
- unset($filenamechanged);
-
+ unset($filenamechanged);
+
} //end foreach
} //end if count
-
+
//update the config
$a_public_includes[$id] = $ent;
}
@@ -203,8 +203,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Public:<br>
</strong></span>
@@ -218,27 +218,27 @@ include("head.inc");
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Extension Name</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="extensionname" type="text" class="formfld" id="extensionname" size="40" value="<?=htmlspecialchars($pconfig['extensionname']);?>">
<br />
- Supported characters are 'a-z', 'A-Z', '0-9', underscore '_', and period '.'.
+ Supported characters are 'a-z', 'A-Z', '0-9', underscore '_', and period '.'.
</td>
</tr>
<!--
<tr>
<td width="22%" valign="top" class="vncellreq">Context</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="context" type="text" class="formfld" id="context" size="40" value="<?=htmlspecialchars($pconfig['context']);?>">
<br />
e.g. default
</td>
</tr>
-->
-
+
<tr>
<td width="22%" valign="top" class="vncellreq">Enabled</td>
- <td width="78%" class="vtable">
- <?php
+ <td width="78%" class="vtable">
+ <?php
echo " <select name='enabled' class='formfld'>\n";
echo " <option></option>\n";
switch (htmlspecialchars($pconfig['enabled'])) {
@@ -256,30 +256,30 @@ include("head.inc");
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
- ?>
+ ?>
</td>
</tr>
-
+
<tr>
<td width="22%" valign="top" class="vncellreq">Order</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<?php
-
+
echo " <select name='order' class='formfld'>\n";
echo " <option></option>\n";
if (strlen(htmlspecialchars($pconfig['order']))> 0) {
- echo " <option selected='yes' value='".htmlspecialchars($pconfig['order'])."'>".htmlspecialchars($pconfig['order'])."</option>\n";
+ echo " <option selected='yes' value='".htmlspecialchars($pconfig['order'])."'>".htmlspecialchars($pconfig['order'])."</option>\n";
}
$i=0;
while($i<=999) {
- if (strlen($i) == 1) {
+ if (strlen($i) == 1) {
echo " <option value='00$i'>00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i'>0$i</option>\n";
}
if (strlen($i) == 3) {
- echo " <option value='$i'>$i</option>\n";
+ echo " <option value='$i'>$i</option>\n";
}
$i++;
@@ -287,24 +287,24 @@ include("head.inc");
echo " </select>\n";
?>
<br />
- Processing of each public include is determined by this order.
+ Processing of each public include is determined by this order.
</td>
</tr>
-
+
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="publicincludeid" type="hidden" value="<?=htmlspecialchars($pconfig['publicincludeid']);?>">
- <?php
+ <?php
if (strlen($id) > 0 && $a_public_includes[$id]) {
- echo "\n";
+ echo "\n";
echo " <input name=\"id\" type=\"hidden\" value=\"$id\">\n";
echo " <input name=\"opt1name\" type=\"hidden\" value=\"".htmlspecialchars($pconfig['opt1name'])."\">\n";
echo " <input name=\"opt1value\" type=\"hidden\" value=\"".htmlspecialchars($pconfig['opt1value'])."\">\n";
@@ -315,36 +315,36 @@ include("head.inc");
</tr>
</table>
</form>
-
+
<br>
<br>
<form action="freeswitch_public_includes_edit.php" method="post" name="iform2" id="iform2">
- <?php
-
+ <?php
+
//echo "<pre>";
//print_r ($a_public_includes);
//echo "</pre>";
-
- //if ($savemsg) print_info_box($savemsg);
+
+ //if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
- //endif;
-
+ //endif;
+
?>
-
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Conditions and Actions<br />
</strong></span>
- The following conditions, actions and anti-actions are used in the public to direct call flow. Each is processed in order until you reach the action tag which tells FreeSWITCH what action to perform. You are not limited to only one condition or action tag for a given extension.
+ The following conditions, actions and anti-actions are used in the public to direct call flow. Each is processed in order until you reach the action tag which tells FreeSWITCH what action to perform. You are not limited to only one condition or action tag for a given extension.
</span></p></td>
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Tag</td>
@@ -358,13 +358,13 @@ include("head.inc");
</tr>
</table>
</td>
- </tr>
-
- <?php
-
+ </tr>
+
+ <?php
+
$i = 0;
if (count($a_public_include_details) > 0) {
-
+
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "condition" && $publicincludeid == $ent['publicincludeid']) {
?>
@@ -377,7 +377,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -387,15 +387,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_public_include_details) > 0) {
-
+
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "action" && $publicincludeid == $ent['publicincludeid']) {
?>
@@ -408,7 +408,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -418,15 +418,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_public_include_details) > 0) {
-
+
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "anti-action" && $publicincludeid == $ent['publicincludeid']) {
?>
@@ -439,7 +439,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -449,15 +449,15 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
}
-
+
$i = 0;
if (count($a_public_include_details) > 0) {
-
+
foreach ($a_public_include_details as $ent) {
if ($ent['tag'] == "param" && $publicincludeid == $ent['publicincludeid']) {
?>
@@ -470,7 +470,7 @@ include("head.inc");
</td>
<td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';">
<?=$ent['fielddata'];?>&nbsp;
- </td>
+ </td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
@@ -480,11 +480,11 @@ include("head.inc");
</table>
</td>
</tr>
- <?php
+ <?php
}
- $i++;
+ $i++;
}
- }
+ }
?>
<tr>
<td class="list" colspan="3"></td>
@@ -504,12 +504,12 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
-
+
+ <br>
<br>
- <br>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_recordings.tmp b/config/freeswitch/freeswitch_recordings.tmp
index 6683bd15..62d81ae2 100644
--- a/config/freeswitch/freeswitch_recordings.tmp
+++ b/config/freeswitch/freeswitch_recordings.tmp
@@ -4,7 +4,7 @@
freeswitch_recordings.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -49,7 +49,7 @@ if ($_GET['a'] == "download") {
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Description: File Transfer");
- header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
+ header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
}
else {
$file_ext = substr($_GET['filename'], -3);
@@ -58,7 +58,7 @@ if ($_GET['a'] == "download") {
}
if ($file_ext == "mp3") {
header("Content-Type: audio/mp3");
- }
+ }
}
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
@@ -66,7 +66,7 @@ if ($_GET['a'] == "download") {
fpassthru($fd);
}
}
-
+
if ($_GET['type'] = "moh") {
if (file_exists($dir_music_on_hold_8000.$_GET['filename'])) {
$fd = fopen($dir_music_on_hold_8000.$_GET['filename'], "rb");
@@ -75,7 +75,7 @@ if ($_GET['a'] == "download") {
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Description: File Transfer");
- header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
+ header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
}
else {
$file_ext = substr($_GET['filename'], -3);
@@ -84,7 +84,7 @@ if ($_GET['a'] == "download") {
}
if ($file_ext == "mp3") {
header("Content-Type: audio/mp3");
- }
+ }
}
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
@@ -180,29 +180,29 @@ function EvalSound(soundobj) {
<tr>
<td class="tabcont" >
-<?php
+<?php
//build a list of recordings from the config.xml
$config_recording_list = '';
-$i = 0;
+$i = 0;
if (count($a_recordings) > 0) {
foreach ($a_recordings as $recordingent) {
$config_recording_list .= $recordingent['filename']."|";
- $i++;
+ $i++;
}
}
-
+
$config_change = 0;
if (is_dir($dir_recordings)) {
if ($dh = opendir($dir_recordings)) {
while (($file = readdir($dh)) !== false) {
- if (filetype($dir_recordings . $file) == "file") {
-
+ if (filetype($dir_recordings . $file) == "file") {
+
if (strpos($config_recording_list, $file) === false) {
-
+
//$handle = fopen($dir_recordings.$file,'rb');
//$file_content = fread($handle,filesize($dir_recordings.$file));
//fclose($handle);
@@ -215,83 +215,83 @@ if (is_dir($dir_recordings)) {
$recordingent['recordingid'] = guid();
//$recordingent['filecontent'] = base64_encode($file_content);
$recordingent['descr'] = 'Auto';
-
+
$a_recordings[] = $recordingent;
write_config();
-
+
unset($file_content);
-
+
}
else {
//echo "The file was found.<br/>";
}
-
+
}
}
closedir($dh);
}
}
-
-//saved for future use if and when config.xml scales well
+
+//saved for future use if and when config.xml scales well
//enough to save the files inside it
//$i = 0;
-//if (count($a_recordings) > 0) {
+//if (count($a_recordings) > 0) {
// foreach ($a_recordings as $recordingent) {
// if (!is_file($dir_recordings.$recordingent['filename'])) {
//echo "not found: ".$recordingent['filename']."<br />";
-
+
//recording not found restore the file from the config.xml
- //$file_content = $recordingent['filecontent'];
+ //$file_content = $recordingent['filecontent'];
//$handle = fopen($dir_recordings.$recordingent['filename'],'w');
- //fwrite ($handle, base64_decode($file_content));
+ //fwrite ($handle, base64_decode($file_content));
//unset($file_content);
//fclose($handle);
- //$recordingent['filecontent'] = base64_encode($file_content);
-
- // loop through recordings in the config.xml
+ //$recordingent['filecontent'] = base64_encode($file_content);
+
+ // loop through recordings in the config.xml
// if the file does not exist remove it from the file system.
//unset($a_recordings[$i]);
-
-// $config_change = 1;
+
+// $config_change = 1;
// }
// else {
- //echo "found: ".$recordingent['filename']."<br />";
+ //echo "found: ".$recordingent['filename']."<br />";
// }
-// $i++;
+// $i++;
// }
//}
if ($config_change == 1) {
write_config();
- $config_change = 0;
+ $config_change = 0;
}
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Recordings:<br>
</strong></span>
To make a recording dial extension 732673 (record) or you can make a
- 16bit 8khz/16khz Mono WAV file then copy it to the
- following directory then refresh the page to play it back.
- Click on the 'Filename' to download it or the 'Recording Name' to
+ 16bit 8khz/16khz Mono WAV file then copy it to the
+ following directory then refresh the page to play it back.
+ Click on the 'Filename' to download it or the 'Recording Name' to
play the audio.
</span></p></td>
</tr>
</table>
-
+
<br />
-
+
<div id="niftyOutter">
<form action="" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
<table border='0'>
@@ -305,11 +305,11 @@ if ($config_change == 1) {
<input name="ulfile" type="file" class="button" id="ulfile">
<input name="submit" type="submit" class="button" id="upload" value="Upload">
</td>
- </tr>
+ </tr>
</table>
</div>
</form>
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" class="listhdrr">Filename (download)</td>
@@ -327,9 +327,9 @@ if ($config_change == 1) {
</td>
</tr>
- <?php
+ <?php
$i = 0;
- if (count($a_recordings) > 0) {
+ if (count($a_recordings) > 0) {
foreach ($a_recordings as $recordingent) {
?>
<tr>
@@ -341,7 +341,7 @@ if ($config_change == 1) {
<td class="listr" ondblclick="document.location='freeswitch_recordings_edit.php?id=<?=$i;?>';">
<a href="javascript:void(0);" onclick="window.open('freeswitch_recordings_play.php?a=download&type=rec&filename=<?=$recordingent['filename'];?>', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')">
<?=$recordingent['recordingname'];?>&nbsp;
- </a>
+ </a>
</td>
<td class="listbg" ondblclick="document.location='freeswitch_recordings_edit.php?id=<?=$i;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($recordingent['descr']);?>&nbsp;
@@ -355,12 +355,12 @@ if ($config_change == 1) {
</table>
</td>
</tr>
- <?php
+ <?php
$i++;
- } //end for each
+ } //end for each
} //end count
?>
-
+
<!--
<tr>
<td class="list" colspan="3"></td>
@@ -380,28 +380,28 @@ if ($config_change == 1) {
<td class="list"></td>
</tr>
</table>
-
+
<br />
<br />
<br />
-
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Music on Hold:<br>
</strong></span>
- Music on hold can be in WAV or MP3 format. To play MP3 you must have
- mod_shout enabled on the 'Modules' tab. For best performance
- upload 16bit 8khz/16khz Mono WAV files.
- <!--Click on the 'Filename' to download it or the 'Recording Name' to
+ Music on hold can be in WAV or MP3 format. To play MP3 you must have
+ mod_shout enabled on the 'Modules' tab. For best performance
+ upload 16bit 8khz/16khz Mono WAV files.
+ <!--Click on the 'Filename' to download it or the 'Recording Name' to
play the audio.-->
</span></p></td>
</tr>
</table>
-
+
<br />
-
+
<div id="niftyOutter">
<form action="" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
<table border='0'>
@@ -414,8 +414,8 @@ if ($config_change == 1) {
<td valign="top" class="label">
<input name="ulfile" type="file" class="button" id="ulfile">
<input name="submit" type="submit" class="button" id="upload" value="Upload">
- </td>
- </tr>
+ </td>
+ </tr>
</table>
</div>
</form>
@@ -434,7 +434,7 @@ if ($config_change == 1) {
if ($handle = opendir($dir_music_on_hold_8000)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && is_file($dir_music_on_hold_8000.$file)) {
-
+
$tmp_filesize = filesize($dir_music_on_hold_8000.$file);
$tmp_filesize = byte_convert($tmp_filesize);
@@ -442,18 +442,18 @@ if ($config_change == 1) {
echo " <td class=\"listlr\" ondblclick=\"\">\n";
echo " <a href=\"freeswitch_recordings.php?a=download&type=moh&t=bin&filename=".$file."\">\n";
echo " $file";
- echo " </a>";
+ echo " </a>";
echo " </td>\n";
echo " <td class=\"listlr\" ondblclick=\"\">\n";
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('freeswitch_recordings_play.php?a=download&type=moh&filename=".$file."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
$tmp_file_array = split("\.",$file);
echo " ".$tmp_file_array[0];
- echo " </a>";
- echo " </td>\n";
+ echo " </a>";
+ echo " </td>\n";
echo " <td class=\"listlr\" ondblclick=\"\">\n";
echo date ("F d Y H:i:s", filemtime($dir_music_on_hold_8000.$file));
echo " </td>\n";
- echo " <td class=\"listlr\" ondblclick=\"\">\n";
+ echo " <td class=\"listlr\" ondblclick=\"\">\n";
echo " ".$tmp_filesize;
echo " </td>\n";
echo " <td valign=\"middle\" nowrap class=\"list\">\n";
@@ -465,7 +465,7 @@ if ($config_change == 1) {
echo " </table>\n";
echo " </td>\n";
echo "</tr>\n";
-
+
}
}
closedir($handle);
diff --git a/config/freeswitch/freeswitch_recordings_edit.tmp b/config/freeswitch/freeswitch_recordings_edit.tmp
index 72604dbd..06ced40b 100644
--- a/config/freeswitch/freeswitch_recordings_edit.tmp
+++ b/config/freeswitch/freeswitch_recordings_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_recordings_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -77,13 +77,13 @@ if ($_POST) {
//if file name is not the same then rename the file
if ($_POST['filename'] != $_POST['filename_orig']) {
- rename('/usr/local/freeswitch/recordings/'.$_POST['filename_orig'], '/usr/local/freeswitch/recordings/'.$_POST['filename']);
+ rename('/usr/local/freeswitch/recordings/'.$_POST['filename_orig'], '/usr/local/freeswitch/recordings/'.$_POST['filename']);
}
$a_recordings[$id] = $recordingent;
}
else {
//add
- $recordingent['filename'] = $_POST['filename'];
+ $recordingent['filename'] = $_POST['filename'];
$a_recordings[] = $recordingent;
}
@@ -128,26 +128,26 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
+
<form action="freeswitch_recordings_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Filename</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="filename" type="text" class="formfld" id="filename" size="40" value="<?=htmlspecialchars($pconfig['filename']);?>">
<br> <span class="vexpl">Name of the file<br>
e.g. <em>example.wav</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Recording Name</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="recordingname" type="text" class="formfld" id="recordingname" size="40" value="<?=htmlspecialchars($pconfig['recordingname']);?>">
<br> <span class="vexpl">Recording Name<br>
e.g. <em>recordingx</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
@@ -165,7 +165,7 @@ include("head.inc");
</tr>
</table>
</form>
-
+
<br>
<br>
<br>
diff --git a/config/freeswitch/freeswitch_recordings_play.tmp b/config/freeswitch/freeswitch_recordings_play.tmp
index 8dfb90c2..0b198b78 100755
--- a/config/freeswitch/freeswitch_recordings_play.tmp
+++ b/config/freeswitch/freeswitch_recordings_play.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_recordings_play.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -45,11 +45,11 @@ $type = $_GET['type']; //moh //rec
<td align='center'>
<b>file: <?=$filename?></b>
</td>
- </tr>
+ </tr>
<tr>
<td align='center'>
<?php
-
+
$file_ext = substr($_GET['filename'], -3);
if ($file_ext == "wav") {
echo "<embed src=\"freeswitch_recordings.php?a=download&type=".$type."&filename=".$filename."\" autostart=true width=200 height=40 name=\"sound".$$filename."\" enablejavascript=\"true\">\n";
@@ -60,7 +60,7 @@ $type = $_GET['type']; //moh //rec
echo "<param name=\"quality\" value=\"high\"/>\n";
echo "<param name=\"bgcolor\" value=\"#E6E6E6\"/>\n";
echo "</object>\n";
- }
+ }
?>
</td>
diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp
index 986ef7db..3aa70ba5 100644
--- a/config/freeswitch/freeswitch_status.tmp
+++ b/config/freeswitch/freeswitch_status.tmp
@@ -4,7 +4,7 @@
freeswitch_status.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -62,7 +62,7 @@ if ($_GET['a'] == "other") {
if ($_GET['t'] == "restore") {
$tmp = '/tmp/';
$filename = 'freeswitch.bak.tgz';
-
+
//extract a specific directory to /usr/local/freeswitch
if (file_exists('/tmp/'.$filename)) {
//echo "The file $filename exists";
@@ -73,19 +73,19 @@ if ($_GET['a'] == "other") {
system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/recordings/');
system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/scripts/');
system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/storage/');
-
- //Optional
+
+ //Optional
//system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/');
- //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/');
-
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/');
+
header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ;
}
else {
header( 'Location: freeswitch_status.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ;
- }
-
+ }
+
exit;
}
}
@@ -109,7 +109,7 @@ if (!pkg_is_service_running('freeswitch')) {
<p class="pgtitle">FreeSWITCH: Status</font></p>
-<?php
+<?php
if ($savemsg) {
print_info_box($savemsg);
}
@@ -159,9 +159,9 @@ echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
+echo $response;
echo "</pre>\n";
-fclose($fp);
+fclose($fp);
echo "<br /><br />\n\n";
@@ -181,9 +181,9 @@ echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
+echo $response;
echo "</pre>\n";
-fclose($fp);
+fclose($fp);
echo "<br /><br />\n\n";
@@ -204,9 +204,9 @@ echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
+echo $response;
echo "</pre>\n";
-fclose($fp);
+fclose($fp);
echo "<br /><br />\n\n";
@@ -215,10 +215,10 @@ $cmd = "api status";
$response = event_socket_request($fp, $cmd);
echo "<b>status</b><br />\n";
echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
+echo $response;
echo "</pre>\n";
-fclose($fp);
-echo "<br /><br />\n\n";
+fclose($fp);
+echo "<br /><br />\n\n";
$fp = event_socket_create($host, $port, $password);
@@ -235,7 +235,7 @@ else {
echo $response;
echo "</pre>\n";
}
-fclose($fp);
+fclose($fp);
echo "<br /><br />\n\n";
echo "<br /><br />\n\n";
@@ -254,7 +254,7 @@ else {
echo $response;
echo "</pre>\n";
}
-fclose($fp);
+fclose($fp);
echo "<br /><br />\n\n";
echo "<br /><br />\n\n";
@@ -307,7 +307,7 @@ echo "<br /><br />\n\n";
echo "<b>tail -n 100 /usr/local/freeswitch/log/freeswitch.log</b><br />\n";
echo "<textarea cols='85' rows='30' wrap='off'>\n";
-echo system("tail -n 100 /usr/local/freeswitch/log/freeswitch.log");
+echo system("tail -n 100 /usr/local/freeswitch/log/freeswitch.log");
echo "</textarea>\n";
echo "<br /><br />\n\n";
@@ -317,9 +317,9 @@ echo "<br /><br />\n\n";
//$response = event_socket_request($fp, $cmd);
//echo "<b>api sofia</b><br />\n";
//echo "<pre style=\"font-size: 9pt;\">\n";
-//echo $response;
+//echo $response;
//echo "</pre>\n";
-//fclose($fp);
+//fclose($fp);
//echo "<br /><br />\n\n";
?>
diff --git a/config/freeswitch/freeswitch_time_conditions.tmp b/config/freeswitch/freeswitch_time_conditions.tmp
index aae0bd20..d1507780 100644
--- a/config/freeswitch/freeswitch_time_conditions.tmp
+++ b/config/freeswitch/freeswitch_time_conditions.tmp
@@ -4,7 +4,7 @@
freeswitch_time_conditions.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -85,32 +85,32 @@ include("head.inc");
<td class="tabcont" >
<form action="freeswitch_ivr_options.php" method="post" name="iform" id="iform">
-<?php
+<?php
//echo "<pre>";
//print_r ($a_ivr);
//echo "</pre>";
-//if ($savemsg) print_info_box($savemsg);
+//if ($savemsg) print_info_box($savemsg);
//if (file_exists($d_hostsdirty_path)): echo"<p>";
//print_info_box_np("The FreeSWITCH recordings have been changed.<br>You must apply the changes in order for them to take effect.");
//echo"<br />";
-//endif;
+//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td><p><span class="vexpl"><span class="red"><strong>Note:<br>
</strong></span>
To make a recording dial extension 700 or you can make a
- 16bit 8khz/16khz Mono WAV file then copy it to the
+ 16bit 8khz/16khz Mono WAV file then copy it to the
following directory then refresh the page to play it back.
</span></p></td>
</tr>
</table>
<br />
-
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Filename</td>
@@ -167,7 +167,7 @@ include("head.inc");
<td class="list"></td>
</tr>
</table>
-
+
</form>
<br>
diff --git a/config/freeswitch/freeswitch_time_conditions_edit.tmp b/config/freeswitch/freeswitch_time_conditions_edit.tmp
index 5f1a37ba..22d5e7d5 100644
--- a/config/freeswitch/freeswitch_time_conditions_edit.tmp
+++ b/config/freeswitch/freeswitch_time_conditions_edit.tmp
@@ -1,11 +1,11 @@
-<?php
+<?php
/* $Id$ */
/*
freeswitch_time_conditions_edit.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
-
+
FreeSWITCH (TM)
http://www.freeswitch.org/
@@ -89,7 +89,7 @@ if ($_POST) {
$a_ivr_options[$id] = $ivroptionent;
}
else {
- //add
+ //add
$a_ivr_options[] = $ivroptionent;
}
@@ -135,19 +135,19 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont" >
-
+
<form action="freeswitch_ivr_options_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Option Number</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optionnumber" type="text" class="formfld" id="optionnumber" size="40" value="<?=htmlspecialchars($pconfig['optionnumber']);?>">
<br> <span class="vexpl">Option Number<br>
e.g. <em>1</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Type</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<?php
echo " <select name='optiontype' class='formfld'>\n";
echo " <option></option>\n";
@@ -169,14 +169,14 @@ include("head.inc");
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Destination</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optiondest" type="text" class="formfld" id="optiondest" size="40" value="<?=htmlspecialchars($pconfig['optiondest']);?>">
<br> <span class="vexpl">Destination<br>
e.g. <em>1001</em></span></td>
- </tr>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="optiondescr" type="text" class="formfld" id="optiondescr" size="40" value="<?=htmlspecialchars($pconfig['optiondescr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
@@ -187,21 +187,21 @@ include("head.inc");
<input name="ivrid" type="hidden" value="<?=$ivrid;?>">
<input name="parentid" type="hidden" value="<?=$parentid;?>">
<?php if (isset($id) && $a_ivr_options[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
+ <input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
<input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
</td>
</tr>
</table>
</form>
-
+
<br>
<br>
<br>
<br>
<br>
<br>
-
+
</td>
</tr>
</table>