From 5374e5972afc5e16f90a8434e3d136843cd6fd33 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 12 Dec 2008 22:18:40 +0000 Subject: FreeSWITCH package bug fix pointed out by tusc fixes xml for multiple condidtions in the dialplan for both 'Public' and 'Dialplan'. --- packages/freeswitch/freeswitch.inc | 107 ++++++++++++++++++++++++------------- packages/freeswitch/freeswitch.xml | 2 +- 2 files changed, 72 insertions(+), 37 deletions(-) (limited to 'packages') diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc index 049ede80..569c6790 100644 --- a/packages/freeswitch/freeswitch.inc +++ b/packages/freeswitch/freeswitch.inc @@ -1342,24 +1342,40 @@ function sync_package_freeswitch_dialplan_includes() //$rowhelper['enabled']; $tmp = "\n"; - - 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']) { - if ($i == 0) { - $tmp .= " \n"; - } - else { - $tmp .= " \n"; - } - $conditioncount++; - $i++; - } - - } - } + + 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 + //start tag + $tmp .= " \n"; + } + else { //more than one condition + if ($i < $conditioncount) { + //all tags should be self-closing except the last one + $tmp .= " \n"; + } + else { + //for the last tag use the start tag + $tmp .= " \n"; + } + } + $i++; + } + } //end for each + + } //end if count if (count($a_dialplan_include_details) > 0) { $i = 0; @@ -1396,6 +1412,7 @@ function sync_package_freeswitch_dialplan_includes() if ($conditioncount > 0) { $tmp .= " \n"; } + unset ($conditioncount); $tmp .= "\n"; @@ -1440,23 +1457,40 @@ function sync_package_freeswitch_public_includes() $tmp = "\n"; - 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']) { - if ($i == 0) { - $tmp .= " \n"; - } - else { - $tmp .= " \n"; - } - $conditioncount++; - $i++; - } - - } - } + 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 + //start tag + $tmp .= " \n"; + } + else { //more than one condition + if ($i < $conditioncount) { + //all tags should be self-closing except the last one + $tmp .= " \n"; + } + else { + //for the last tag use the start tag + $tmp .= " \n"; + } + } + $i++; + } + } //end for each + + } //end if count + if (count($a_public_include_details) > 0) { $i = 0; @@ -1493,6 +1527,7 @@ function sync_package_freeswitch_public_includes() if ($conditioncount > 0) { $tmp .= " \n"; } + unset ($conditioncount); $tmp .= "\n"; @@ -1932,7 +1967,7 @@ function freeswitch_php_install_command() } $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = "1.0.1 revision 10638."; - $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.4.4"; + $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.4.5"; conf_mount_ro(); diff --git a/packages/freeswitch/freeswitch.xml b/packages/freeswitch/freeswitch.xml index e1739529..f3520c0a 100644 --- a/packages/freeswitch/freeswitch.xml +++ b/packages/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.4.4 + 0.4.5 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc -- cgit v1.2.3