From f05d9e652f80e52a8ce5988ac4231916c664bd4c Mon Sep 17 00:00:00 2001 From: mcrane Date: Sun, 31 May 2009 02:32:26 -0600 Subject: FreeSWITCH add order field for dialplan and public options, IVR add profile and sip uri, copy libspandsp.so.1 to libspandsp.so.2 so mod_fax will start, fix editarea path so the textarea tool will work. --- config/freeswitch/freeswitch.inc | 262 +++++++++++++-------- config/freeswitch/freeswitch.xml | 2 +- .../freeswitch_dialplan_includes_details_edit.tmp | 35 ++- .../freeswitch_dialplan_includes_edit.tmp | 83 +++++-- config/freeswitch/freeswitch_gateways_edit.tmp | 2 + config/freeswitch/freeswitch_ivr_options_edit.tmp | 34 ++- .../freeswitch_public_includes_details_edit.tmp | 43 +++- .../freeswitch/freeswitch_public_includes_edit.tmp | 103 +++++--- 8 files changed, 385 insertions(+), 179 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index 6c0976da..d630ea3e 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -85,8 +85,10 @@ function build_menu() { unset($menu_selected); $menu_selected = false; + if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public.php") { $menu_selected = true; } if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public_includes.php") { $menu_selected = true; } - if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public.php") { $menu_selected = true; } + if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public_includes_edit.php") { $menu_selected = true; } + if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public_includes_details_edit.php") { $menu_selected = true; } $tab_array[] = array(gettext("Public"), $menu_selected, "/packages/freeswitch/freeswitch_public_includes.php"); unset($menu_selected); @@ -1486,8 +1488,25 @@ function sync_package_freeswitch_ivr() $tmp .= " var Year = objdate2.getYear()\n"; $tmp .= " var Day = objdate2.getDay()+1;\n"; $tmp .= " var exit = false;\n"; - $tmp .= "\n"; - $tmp .= "//console_log( \"info\", \"IVR Server Time is: \"+Hours+\":\"+Mins+\" \\n\" );\n"; + $tmp .= "\n"; + $tmp .= " dialed_extension = session.getVariable(\"dialed_extension\");\n"; + $tmp .= " domain_name = session.getVariable(\"domain_name\");\n"; + $tmp .= " domain = session.getVariable(\"domain\");\n"; + $tmp .= " us_ring = session.getVariable(\"us-ring\");\n"; + $tmp .= " caller_id_name = session.getVariable(\"caller_id_name\");\n"; + $tmp .= " caller_id_number = session.getVariable(\"caller_id_number\");\n"; + $tmp .= "\n"; + $tmp .= " session.execute(\"set\", \"ringback=\"+us_ring); //set to ringtone\n"; + $tmp .= " session.execute(\"set\", \"transfer_ringback=\"+us_ring); //set to ringtone\n"; + $tmp .= "\n"; + $tmp .= "//console_log( \"info\", \"IVR Server Time is: \"+Hours+\":\"+Mins+\" \\n\" );\n"; + $tmp .= "\n"; + $tmp .= " function get_sofia_contact(extension,domain_name, profile){\n"; + $tmp .= " session.execute(\"set\", \"sofia_contact_\"+extension+\"=\${sofia_contact(\"+profile+\"/\"+extension+\"@\"+domain_name+\")}\");\n"; + $tmp .= " sofia_contact = session.getVariable(\"sofia_contact_\"+extension);\n"; + $tmp .= " //console_log( \"info\", \"sofia_contact: \"+sofia_contact+\".\\n\" );\n"; + $tmp .= " return sofia_contact;\n"; + $tmp .= " }\n"; $tmp .= "\n"; $tmp .= " function mycb( session, type, obj, arg ) {\n"; $tmp .= " try {\n"; @@ -1529,6 +1548,7 @@ function sync_package_freeswitch_ivr() if (strtolower($row['optionnumber']) == "n") { //direct the call now don't wait for dtmf $actiondirect = true; $actiondirecttype = $row['optiontype']; + $actiondirectprofile = $row['optionprofile']; $actiondirectdest = $row['optiondest']; } } @@ -1542,12 +1562,18 @@ function sync_package_freeswitch_ivr() $tmp .= " //direct\n"; $tmp .= " //console_log( \"info\", \"action direct\\n\" );\n"; if ($actiondirecttype == "extension") { - $tmp .= " session.execute(\"transfer\", \"".$actiondirectdest." XML default\"); //".$actiondirectdest."\n"; - } + $tmp .= " sofia_contact_".$actiondirectdest." = get_sofia_contact(\"".$actiondirectdest."\",domain_name, \"".$actiondirectprofile."\");\n"; + $tmp .= " session.execute(\"bridge\", sofia_contact_".$actiondirectdest."); //".$actiondirectdest."\n"; + //$tmp .= " session.execute(\"transfer\", \"".$actiondirectdest." XML default\"); //".$actiondirectdest."\n"; + } if ($actiondirecttype == "voicemail") { //$tmp .= " session.execute(\"voicemail\", \"".$actiondirectdest." XML default\");\n"; $tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$actiondirectdest."\");\n"; } + if ($actiondirecttype == "sip uri") { + $tmp .= " session.execute(\"bridge\", \"".$actiondirectdest."\"); //".$actiondirectdest."\n"; + } + $tmp .= "}\n"; } @@ -1580,13 +1606,18 @@ function sync_package_freeswitch_ivr() if ($row['optionaction'] == "action") { 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"; - } + if ($row['optiontype'] == "extension") { + $tmp .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; + $tmp .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "voicemail") { + //$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; + $tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "sip uri") { + //$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n"; + $tmp .= " session.execute(\"bridge\", \"".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } } } //end anti-action @@ -1594,7 +1625,6 @@ function sync_package_freeswitch_ivr() } //end for each } //if count - $tmp .= " }\n"; $tmp .= " else {\n"; @@ -1640,37 +1670,33 @@ function sync_package_freeswitch_ivr() 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"; - if ($x == 0) { - $tmpaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; - } - else { - $tmpaction .= " else if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; - } - if ($row['optiontype'] == "extension") { - $tmpaction .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\");\n"; - } - if ($row['optiontype'] == "voicemail") { - //$tmpaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; - $tmpaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n"; - } - $tmpaction .= " }\n"; - + switch ($row['optionnumber']) { + case "t": + break; + default: + //$tmpaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n"; + if ($x == 0) { + $tmpaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; + } + else { + $tmpaction .= " else if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "extension") { + $tmpaction .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; + $tmpaction .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "voicemail") { + //$tmpaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; + $tmpaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "sip uri") { + //$tmpaction .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n"; + $tmpaction .= " session.execute(\"bridge\", \"".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + + $tmpaction .= " }\n"; - } + } $x++; } //end if action @@ -1691,7 +1717,7 @@ function sync_package_freeswitch_ivr() $tmp .= " } \n"; - //$tmp .= " else if ( dtmf.digits.length == \"3\" ) {\n"; + //$tmp .= " else if ( dtmf.digits.length == \"4\" ) {\n"; //$tmp .= " //Transfer to the extension the caller chose\n"; //$tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n"; //$tmp .= " } else {\n"; @@ -1728,13 +1754,19 @@ function sync_package_freeswitch_ivr() $tmp .= " else {\n"; $tmp .= " //anti-action direct\n"; $tmp .= " //console_log( \"info\", \"anti-action call now don't wait for dtmf\\n\" );\n"; - if ($antiactiondirecttype == "extension") { - $tmp .= " session.execute(\"transfer\", \"".$antiactiondirectdest." XML default\"); //".$antiactiondirectdest."\n"; - } - if ($antiactiondirecttype == "voicemail") { - //$tmp .= " session.execute(\"voicemail\", \"".$antiactiondirectdest." XML default\");\n"; - $tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$antiactiondirectdest."\");\n"; + + if ($actiondirecttype == "extension") { + $tmp .= " sofia_contact_".$actiondirectdest." = get_sofia_contact(\"".$actiondirectdest."\",domain_name, \"".$actiondirectprofile."\");\n"; + $tmp .= " session.execute(\"bridge\", sofia_contact_".$actiondirectdest."); //".$actiondirectdest."\n"; + //$tmp .= " session.execute(\"transfer\", \"".$actiondirectdest." XML default\"); //".$actiondirectdest."\n"; + } + if ($actiondirecttype == "voicemail") { + //$tmp .= " session.execute(\"voicemail\", \"".$actiondirectdest." XML default\");\n"; + $tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$actiondirectdest."\");\n"; } + if ($actiondirecttype == "sip uri") { + $tmp .= " session.execute(\"bridge\", \"".$actiondirectdest."\"); //".$actiondirectdest."\n"; + } $tmp .= "}\n"; } else { @@ -1765,14 +1797,18 @@ function sync_package_freeswitch_ivr() if ($row['optionaction'] == "anti-action") { 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"; - } + if ($row['optiontype'] == "extension") { + $tmp .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; + $tmp .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "voicemail") { + //$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; + $tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "sip uri") { + //$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n"; + $tmp .= " session.execute(\"bridge\", \"".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } } } //end anti-action @@ -1799,11 +1835,8 @@ function sync_package_freeswitch_ivr() $tmp .= "\n"; $tmp .= " console_log( \"info\", \"IVR Digit Pressed: \" + dtmf.digits + \"\\n\" );\n"; $tmp .= "\n"; - - - - + $tmpantiaction = ""; $tmp .= " if ( dtmf.digits.length > \"0\" ) {\n"; @@ -1824,41 +1857,36 @@ function sync_package_freeswitch_ivr() //find the correct IVR options with the correct action if ($row['ivrid'] == $rowhelper['ivrid']) { - if ($row['optionaction'] == "anti-action") { + 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"; - //} - + switch ($row['optionnumber']) { + case "t": //break; - default: - //$tmpantiaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n"; - - if ($x == 0) { - $tmpantiaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; - } - else { - $tmpantiaction .= " else if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; - } - - if ($row['optiontype'] == "extension") { - $tmpantiaction .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\");\n"; - } - if ($row['optiontype'] == "voicemail") { - //$tmpantiaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; - $tmpantiaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n"; - } - $tmpantiaction .= " }\n"; - + default: + //$tmpantiaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n"; + + if ($x == 0) { + $tmpantiaction .= " if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; + } + else { + $tmpantiaction .= " else if ( dtmf.digits == \"".$row['optionnumber']."\" ) { //".$row['optiondescr']."\n"; + } + + if ($row['optiontype'] == "extension") { + $tmpantiaction .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; + $tmpantiaction .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "voicemail") { + //$tmpantiaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; + $tmpantiaction .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + if ($row['optiontype'] == "sip uri") { + //$tmpantiaction .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n"; + $tmpantiaction .= " session.execute(\"bridge\", \"".$row['optiondest']."\"); //".$row['optiondescr']."\n"; + } + $tmpantiaction .= " }\n"; - } //end switch + } //end switch $x++; } //end anti-action @@ -1915,13 +1943,25 @@ function sync_package_freeswitch_ivr() function sync_package_freeswitch_dialplan_includes() { - global $config; - conf_mount_rw(); - config_lock(); + global $config; + conf_mount_rw(); + config_lock(); - $a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config']; - $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config']; + $a_dialplan_includes = &$config['installedpackages']['freeswitchdialplanincludes']['config']; + $a_dialplan_include_details = &$config['installedpackages']['freeswitchdialplanincludedetails']['config']; + //order the array + if (!function_exists('cmp_number_dialplan_details')) { + function cmp_number_dialplan_details($a, $b) { + if ($a["fieldorder"] > $b["fieldorder"]) { + return 1; + } + else { + return 0; + } + } + } + if (count($a_dialplan_includes) > 0) { foreach($config['installedpackages']['freeswitchdialplanincludes']['config'] as $rowhelper) { $tmp = ""; @@ -1935,6 +1975,8 @@ function sync_package_freeswitch_dialplan_includes() $tmp = "\n"; if (count($a_dialplan_include_details) > 0) { + + if (count($a_dialplan_include_details) > 0) { usort($a_dialplan_include_details, "cmp_number_dialplan_details"); } $conditioncount = 0; $i = 0; @@ -2037,6 +2079,18 @@ function sync_package_freeswitch_public_includes() $a_public_include_details = &$config['installedpackages']['freeswitchpublicincludedetails']['config']; if (count($a_public_includes) > 0) { + + //order the array + function cmp_number_public_include_details($a, $b) { + if ($a["fieldorder"] > $b["fieldorder"]) { + return 1; + } + else { + return 0; + } + } + + foreach($a_public_includes as $rowhelper) { $tmp = ""; $tmp .= "\n"; @@ -2050,6 +2104,8 @@ function sync_package_freeswitch_public_includes() if (count($a_public_include_details) > 0) { + if (count($a_public_include_details) > 0) { usort($a_public_include_details, "cmp_number_public_include_details"); } + $conditioncount = 0; $i = 0; foreach ($a_public_include_details as $ent) { @@ -2166,7 +2222,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.8.1"; + $freeswitch_package_version = "0.8.9"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; @@ -2230,10 +2286,10 @@ function freeswitch_php_install_command() exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libogg.so.5.3"); exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libvorbis.so.4"); exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libcurl.so.5"); - exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libspandsp.so.1"); exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libodbc.so.1"); exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libiconv.so.3"); - + exec("cd /usr/local/lib/;fetch http://www.pfsense.com/packages/config/freeswitch/libspandsp.so.1"); + exec("cp /usr/local/lib/libspandsp.so.1 /usr/local/lib/libspandsp.so.2"); //download xml package files //exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch.inc"); @@ -2247,7 +2303,7 @@ function freeswitch_php_install_command() //misc files if (!is_dir('/usr/local/www/edit_area/')) { - exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/edit_area.tgz"); + exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/edit_area.tgz"); system('cd /usr/local/www; tar xvpfz /tmp/edit_area.tgz edit_area'); unlink_if_exists("/tmp/edit_area.tgz"); } diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index 83d0ccf4..7479a58f 100644 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.8.1 + 0.8.9 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp index bd719273..f3cbf71d 100644 --- a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp +++ b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp @@ -59,7 +59,7 @@ if (isset($_POST['dialplanincludeid'])) { //action //antiaction //param - //tagorder + //fieldorder //1-20 //fieldtype @@ -69,7 +69,7 @@ if (isset($_POST['dialplanincludeid'])) { if (isset($id) && $a_dialplan_includes_details[$id]) { $pconfig['dialplanincludeid'] = $a_dialplan_includes_details[$id]['dialplanincludeid']; $pconfig['tag'] = $a_dialplan_includes_details[$id]['tag']; - //$pconfig['tagorder'] = $a_dialplan_includes_details[$id]['tagorder']; + $pconfig['fieldorder'] = $a_dialplan_includes_details[$id]['fieldorder']; $pconfig['fieldtype'] = $a_dialplan_includes_details[$id]['fieldtype']; $pconfig['fielddata'] = $a_dialplan_includes_details[$id]['fielddata']; } @@ -93,7 +93,7 @@ if ($_POST) { $ent = array(); $ent['dialplanincludeid'] = $_POST['dialplanincludeid']; $ent['tag'] = $_POST['tag']; - //$ent['tagorder'] = $_POST['tagorder']; + $ent['fieldorder'] = $_POST['fieldorder']; $ent['fieldtype'] = $_POST['fieldtype']; $ent['fielddata'] = $_POST['fielddata']; @@ -138,7 +138,7 @@ display_top_tabs(build_menu());
- +
@@ -232,6 +232,33 @@ display_top_tabs(build_menu());
+ + + +
Order + \n"; + //echo " \n"; + if (strlen(htmlspecialchars($pconfig['fieldorder']))> 0) { + echo " \n"; + } + $i=0; + while($i<=999) { + if (strlen($i) == 1) { + echo " \n"; + } + if (strlen($i) == 2) { + echo " \n"; + } + if (strlen($i) == 3) { + echo " \n"; + } + + $i++; + } + echo " \n"; + ?> +
  diff --git a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp index 228ebab1..a6118042 100644 --- a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp +++ b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp @@ -318,6 +318,26 @@ display_top_tabs(build_menu()); //echo"
"; //endif; + //create a temporary id for the array + $i = 0; + if (count($a_dialplan_include_details) > 0) { + foreach ($a_dialplan_include_details as $ent) { + $a_dialplan_include_details[$i]['id'] = $i; + $i++; + } + } + + //order the array + function cmp_number($a, $b) { + if ($a["fieldorder"] > $b["fieldorder"]) { + return 1; + } + else { + return 0; + } + } + if (count($a_dialplan_include_details) > 0) { usort($a_dialplan_include_details, "cmp_number"); } + ?> @@ -333,10 +353,11 @@ display_top_tabs(build_menu()); - - + + - +
TagTypeTagType Data + Order @@ -355,20 +376,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "condition" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> - - - + @@ -386,20 +410,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "action" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> - - - + @@ -417,20 +444,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "anti-action" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> - - - + @@ -448,20 +478,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "param" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> - - - + @@ -473,7 +506,7 @@ display_top_tabs(build_menu()); } ?> - +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
@@ -486,7 +519,7 @@ display_top_tabs(build_menu()); - +
diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp index ea2b7efe..1fef05f3 100644 --- a/config/freeswitch/freeswitch_gateways_edit.tmp +++ b/config/freeswitch/freeswitch_gateways_edit.tmp @@ -212,6 +212,7 @@ if ($_POST) { $ent['tag'] = 'condition'; //condition, action, antiaction $ent['fieldtype'] = 'destination_number'; $ent['fielddata'] = $dialplan_expression; + $ent['fieldorder'] = '000'; $a_dialplan_include_details[] = $ent; unset($ent); @@ -220,6 +221,7 @@ if ($_POST) { $ent['tag'] = 'action'; //condition, action, antiaction $ent['fieldtype'] = 'bridge'; $ent['fielddata'] = $action_data; + $ent['fieldorder'] = '001'; $a_dialplan_include_details[] = $ent; unset($ent); diff --git a/config/freeswitch/freeswitch_ivr_options_edit.tmp b/config/freeswitch/freeswitch_ivr_options_edit.tmp index 1e3313d0..1a7af9d5 100644 --- a/config/freeswitch/freeswitch_ivr_options_edit.tmp +++ b/config/freeswitch/freeswitch_ivr_options_edit.tmp @@ -57,6 +57,7 @@ if (isset($id) && $a_ivr_options[$id]) { $pconfig['optionaction'] = $a_ivr_options[$id]['optionaction']; $pconfig['optionnumber'] = $a_ivr_options[$id]['optionnumber']; $pconfig['optiontype'] = $a_ivr_options[$id]['optiontype']; + $pconfig['optionprofile'] = $a_ivr_options[$id]['optionprofile']; $pconfig['optiondest'] = $a_ivr_options[$id]['optiondest']; $pconfig['optiondescr'] = $a_ivr_options[$id]['optiondescr']; } @@ -80,6 +81,7 @@ if ($_POST) { $ivroptionent['ivrid'] = $_POST['ivrid']; $ivroptionent['optionnumber'] = $_POST['optionnumber']; $ivroptionent['optiontype'] = $_POST['optiontype']; + $ivroptionent['optionprofile'] = $_POST['optionprofile']; $ivroptionent['optionaction'] = $_POST['optionaction']; $ivroptionent['optiondest'] = $_POST['optiondest']; $ivroptionent['optiondescr'] = $_POST['optiondescr']; @@ -124,7 +126,7 @@ display_top_tabs(build_menu());
- +
@@ -152,10 +154,40 @@ display_top_tabs(build_menu()); else { echo " \n"; } + if (htmlspecialchars($pconfig['huntgrouptimeouttype']) == "sip uri") { + echo " \n"; + } + else { + echo " \n"; + } echo " \n"; ?> + + + + + +
Profile + \n"; + echo " \n"; + + foreach (ListFiles('/usr/local/freeswitch/conf/sip_profiles') as $key=>$sip_profile_file){ + $sip_profile_name = str_replace(".xml", "", $sip_profile_file); + + if (htmlspecialchars($pconfig['optionprofile']) == $sip_profile_name) { + echo " \n"; + } + else { + echo " \n"; + } + } + echo " \n"; + + ?> +
Destination diff --git a/config/freeswitch/freeswitch_public_includes_details_edit.tmp b/config/freeswitch/freeswitch_public_includes_details_edit.tmp index 30d07f99..c6cba5be 100644 --- a/config/freeswitch/freeswitch_public_includes_details_edit.tmp +++ b/config/freeswitch/freeswitch_public_includes_details_edit.tmp @@ -58,19 +58,17 @@ if (isset($_POST['publicincludeid'])) { //action //antiaction //param - //tagorder - //1-20 //fieldtype - //fielddata - + //fieldorder + //000-999 if (isset($id) && $a_public_includes_details[$id]) { $pconfig['publicincludeid'] = $a_public_includes_details[$id]['publicincludeid']; $pconfig['tag'] = $a_public_includes_details[$id]['tag']; - //$pconfig['tagorder'] = $a_public_includes_details[$id]['tagorder']; $pconfig['fieldtype'] = $a_public_includes_details[$id]['fieldtype']; - $pconfig['fielddata'] = $a_public_includes_details[$id]['fielddata']; + $pconfig['fielddata'] = $a_public_includes_details[$id]['fielddata']; + $pconfig['fieldorder'] = $a_public_includes_details[$id]['fieldorder']; } //else { // if (isset($_GET['a'])) { @@ -86,16 +84,14 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - if (!$input_errors) { $ent = array(); $ent['publicincludeid'] = $_POST['publicincludeid']; $ent['tag'] = $_POST['tag']; - //$ent['tagorder'] = $_POST['tagorder']; $ent['fieldtype'] = $_POST['fieldtype']; $ent['fielddata'] = $_POST['fielddata']; - + $ent['fieldorder'] = $_POST['fieldorder']; if (isset($id) && $a_public_includes_details[$id]) { //update @@ -138,7 +134,7 @@ display_top_tabs(build_menu());
- +
@@ -232,6 +228,33 @@ display_top_tabs(build_menu());
+ + + +
Order + \n"; + //echo " \n"; + if (strlen(htmlspecialchars($pconfig['fieldorder']))> 0) { + echo " \n"; + } + $i=0; + while($i<=999) { + if (strlen($i) == 1) { + echo " \n"; + } + if (strlen($i) == 2) { + echo " \n"; + } + if (strlen($i) == 3) { + echo " \n"; + } + + $i++; + } + echo " \n"; + ?> +
  diff --git a/config/freeswitch/freeswitch_public_includes_edit.tmp b/config/freeswitch/freeswitch_public_includes_edit.tmp index 3e0644c3..e98dedeb 100644 --- a/config/freeswitch/freeswitch_public_includes_edit.tmp +++ b/config/freeswitch/freeswitch_public_includes_edit.tmp @@ -310,16 +310,36 @@ display_top_tabs(build_menu()); "; - //print_r ($a_public_includes); - //echo ""; - - //if ($savemsg) print_info_box($savemsg); - //if (file_exists($d_hostsdirty_path)): echo"

"; - //print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); - //echo"
"; - //endif; + //echo "

";
+		//print_r ($a_public_includes);
+		//echo "
"; + + //if ($savemsg) print_info_box($savemsg); + //if (file_exists($d_hostsdirty_path)): echo"

"; + //print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); + //echo"
"; + //endif; + + //create a temporary id for the array + $i = 0; + if (count($a_public_include_details) > 0) { + foreach ($a_public_include_details as $ent) { + $a_public_include_details[$i]['id'] = $i; + $i++; + } + } + //order the array + function cmp_number_public_details($a, $b) { + if ($a["fieldorder"] > $b["fieldorder"]) { + return 1; + } + else { + return 0; + } + } + if (count($a_public_include_details) > 0) { usort($a_public_include_details, "cmp_number_public_details"); } + ?> @@ -335,10 +355,11 @@ display_top_tabs(build_menu()); - - + + - +
TagTypeTagType Data + Order @@ -348,7 +369,7 @@ display_top_tabs(build_menu()); - 0) { @@ -357,20 +378,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "condition" && $publicincludeid == $ent['publicincludeid']) { ?> - - - + @@ -388,20 +412,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "action" && $publicincludeid == $ent['publicincludeid']) { ?> - - - + @@ -419,20 +446,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "anti-action" && $publicincludeid == $ent['publicincludeid']) { ?> - - - + @@ -450,20 +480,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "param" && $publicincludeid == $ent['publicincludeid']) { ?> - - - + @@ -475,7 +508,7 @@ display_top_tabs(build_menu()); } ?> - +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
+ +   +   +   + - - + +
@@ -488,7 +521,7 @@ display_top_tabs(build_menu()); - +
-- cgit v1.2.3