diff options
author | mcrane <mctch@yahoo.com> | 2009-05-31 02:32:26 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-05-31 02:32:26 -0600 |
commit | f05d9e652f80e52a8ce5988ac4231916c664bd4c (patch) | |
tree | e0f04d15059fe112ec68fb1ae1562ac672b783cd | |
parent | cf8abc2e725f42eb6176de1da77d5a03766fee6e (diff) | |
download | pfsense-packages-f05d9e652f80e52a8ce5988ac4231916c664bd4c.tar.gz pfsense-packages-f05d9e652f80e52a8ce5988ac4231916c664bd4c.tar.bz2 pfsense-packages-f05d9e652f80e52a8ce5988ac4231916c664bd4c.zip |
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.
-rw-r--r-- | config/freeswitch/freeswitch.inc | 262 | ||||
-rw-r--r-- | config/freeswitch/freeswitch.xml | 2 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp | 35 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_dialplan_includes_edit.tmp | 83 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_gateways_edit.tmp | 2 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_ivr_options_edit.tmp | 34 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_public_includes_details_edit.tmp | 43 | ||||
-rw-r--r-- | config/freeswitch/freeswitch_public_includes_edit.tmp | 103 | ||||
-rwxr-xr-x | pkg_config.7.xml | 2 |
9 files changed, 386 insertions, 180 deletions
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 = "<extension name=\"".$rowhelper['extensionname']."\">\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 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>FreeSWITCH Settings</name> - <version>0.8.8.1</version> + <version>0.8.9</version> <title>FreeSWITCH: Settings</title> <include_file>/usr/local/pkg/freeswitch.inc</include_file> <menu> 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()); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabcont" > - + <br /> <form action="freeswitch_dialplan_includes_details_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> @@ -233,6 +233,33 @@ display_top_tabs(build_menu()); <br> <span class="vexpl"></span></td> </tr> <tr> + <td width="22%" valign="top" class="vncellreq" id="label_fieldtype">Order</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='fieldorder' class='formfld'>\n"; + //echo " <option></option>\n"; + if (strlen(htmlspecialchars($pconfig['fieldorder']))> 0) { + echo " <option selected='yes' value='".htmlspecialchars($pconfig['fieldorder'])."'>".htmlspecialchars($pconfig['fieldorder'])."</option>\n"; + } + $i=0; + while($i<=999) { + 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"; + } + + $i++; + } + echo " </select>\n"; + ?> + </td> + </tr> + <tr> <td width="22%" valign="top"> </td> <td width="78%"> <input name="dialplanincludeid" type="hidden" value="<?=$dialplanincludeid;?>"> 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"<br />"; //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()); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="20%" class="listhdrr">Tag</td> - <td width="20%" class="listhdrr">Type</td> + <td width="40" class="listhdrr">Tag</td> + <td width="40" class="listhdrr">Type</td> <td width="50%" class="listhdrr">Data</td> - <td width="10%" class="list"> + <td width="40" class="listhdrr">Order</td> + <td width="40" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"></td> @@ -355,20 +376,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "condition" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -386,20 +410,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "action" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -417,20 +444,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "anti-action" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -448,20 +478,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "param" && $dialplanincludeid == $ent['dialplanincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_dialplan_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_dialplan_includes_details.php?type=dialplanincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&dialplanincludeid=<?=$dialplanincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -473,7 +506,7 @@ display_top_tabs(build_menu()); } ?> <tr> - <td class="list" colspan="3"></td> + <td class="list" colspan="4"></td> <td class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -486,7 +519,7 @@ display_top_tabs(build_menu()); <tr> - <td class="list" colspan="3"></td> + <td class="list" colspan="4"></td> <td class="list"></td> </tr> </table> 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()); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabcont" > - + <br /> <form action="freeswitch_ivr_options_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> @@ -152,10 +154,40 @@ display_top_tabs(build_menu()); else { echo " <option>voicemail</option>\n"; } + if (htmlspecialchars($pconfig['huntgrouptimeouttype']) == "sip uri") { + echo " <option selected='yes'>sip uri</option>\n"; + } + else { + echo " <option>sip uri</option>\n"; + } echo " </select>\n"; ?> </td> </tr> + + <tr> + <td width="22%" valign="top" class="vncellreq">Profile</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='optionprofile' class='formfld'>\n"; + echo " <option></option>\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 " <option selected='yes'>$sip_profile_name</option>\n"; + } + else { + echo " <option>$sip_profile_name</option>\n"; + } + } + echo " </select>\n"; + + ?> + </td> + </tr> + <tr> <td width="22%" valign="top" class="vncellreq">Destination</td> <td width="78%" class="vtable"> 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()); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabcont" > - + <br /> <form action="freeswitch_public_includes_details_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> @@ -233,6 +229,33 @@ display_top_tabs(build_menu()); <br> <span class="vexpl"></span></td> </tr> <tr> + <td width="22%" valign="top" class="vncellreq" id="label_fieldtype">Order</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='fieldorder' class='formfld'>\n"; + //echo " <option></option>\n"; + if (strlen(htmlspecialchars($pconfig['fieldorder']))> 0) { + echo " <option selected='yes' value='".htmlspecialchars($pconfig['fieldorder'])."'>".htmlspecialchars($pconfig['fieldorder'])."</option>\n"; + } + $i=0; + while($i<=999) { + 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"; + } + + $i++; + } + echo " </select>\n"; + ?> + </td> + </tr> + <tr> <td width="22%" valign="top"> </td> <td width="78%"> <input name="publicincludeid" type="hidden" value="<?=$publicincludeid;?>"> 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()); <form action="freeswitch_public_includes_edit.php" method="post" name="iform2" id="iform2"> <?php - //echo "<pre>"; - //print_r ($a_public_includes); - //echo "</pre>"; - - //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; + //echo "<pre>"; + //print_r ($a_public_includes); + //echo "</pre>"; + + //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; + + //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()); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="20%" class="listhdrr">Tag</td> - <td width="20%" class="listhdrr">Type</td> + <td width="40" class="listhdrr">Tag</td> + <td width="40" class="listhdrr">Type</td> <td width="50%" class="listhdrr">Data</td> - <td width="10%" class="list"> + <td width="40" class="listhdrr">Order</td> + <td width="40" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"></td> @@ -348,7 +369,7 @@ display_top_tabs(build_menu()); </td> </tr> - <?php + <?php $i = 0; if (count($a_public_include_details) > 0) { @@ -357,20 +378,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "condition" && $publicincludeid == $ent['publicincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -388,20 +412,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "action" && $publicincludeid == $ent['publicincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -419,20 +446,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "anti-action" && $publicincludeid == $ent['publicincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -450,20 +480,23 @@ display_top_tabs(build_menu()); if ($ent['tag'] == "param" && $publicincludeid == $ent['publicincludeid']) { ?> <tr> - <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> + <td class="listlr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>'"> <?=$ent['tag']?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fieldtype'];?> </td> - <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> <?=$ent['fielddata'];?> </td> + <td class="listr" ondblclick="document.location='freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>';"> + <?=$ent['fieldorder'];?> + </td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$i;?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="freeswitch_public_includes_details_edit.php?id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_public_includes_details.php?type=publicincludedetails&act=del&id=<?=$ent['id'];?>&parentid=<?=$parentid;?>&publicincludeid=<?=$publicincludeid;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -475,7 +508,7 @@ display_top_tabs(build_menu()); } ?> <tr> - <td class="list" colspan="3"></td> + <td class="list" colspan="4"></td> <td class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -488,7 +521,7 @@ display_top_tabs(build_menu()); <tr> - <td class="list" colspan="3"></td> + <td class="list" colspan="4"></td> <td class="list"></td> </tr> </table> diff --git a/pkg_config.7.xml b/pkg_config.7.xml index bc1d28cf..eeef7439 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -92,7 +92,7 @@ <pkginfolink>http://doc.pfsense.org/index.php/FreeSWITCH</pkginfolink> <config_file>http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml</config_file> <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url> - <version>0.8.8.1</version> + <version>0.8.9</version> <status>Beta</status> <required_version>1.2.1</required_version> <maintainer>markjcrane@gmail.com</maintainer> |