From 450e30893ebc71226bfd710fd662b29dff330fe2 Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 24 Apr 2009 15:24:03 -0600 Subject: FreeSWITCH package set order for dialplan, extension, gateway and public lists --- config/freeswitch/freeswitch_dialplan_includes.tmp | 72 ++++++++++++++-------- config/freeswitch/freeswitch_extensions.tmp | 36 ++++++++--- config/freeswitch/freeswitch_gateways.tmp | 30 ++++++--- config/freeswitch/freeswitch_public_includes.tmp | 35 ++++++++--- 4 files changed, 124 insertions(+), 49 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch_dialplan_includes.tmp b/config/freeswitch/freeswitch_dialplan_includes.tmp index 3fa02dbf..7a2b6b27 100644 --- a/config/freeswitch/freeswitch_dialplan_includes.tmp +++ b/config/freeswitch/freeswitch_dialplan_includes.tmp @@ -197,33 +197,53 @@ include("head.inc"); - 0) { - foreach ($a_dialplan_includes as $ent) { + 0) { + foreach ($a_dialplan_includes as $ent) { + $a_dialplan_includes[$i]['id'] = $i; + $i++; + } + } + + //order the array + function cmp_number($a, $b) { + if ($a["order"] > $b["order"]) { + return 1; + } + else { + return 0; + } + } + usort($a_dialplan_includes, "cmp_number"); + + $i = 0; + if (count($a_dialplan_includes) > 0) { + foreach ($a_dialplan_includes as $ent) { ?> - - - - - - - - -   - - -   - - - - - - - -
- - + + + + + + + + +   + + +   + + + + + + + +
+ + - 0) { + foreach ($a_extensions as $ent) { + $a_extensions[$i]['id'] = $i; + $i++; + } + } + + //order the array + function cmp_number($a, $b) { + if ($a["extension"] > $b["extension"]) { + return 1; + } + else { + return 0; + } + } + usort($a_extensions, "cmp_number"); + $i = 0; if (count($a_extensions) > 0) { @@ -135,23 +155,23 @@ if ($config_change == 1) { ?> - +   - +   - +   - +   - - + +
diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp index 88be8fc4..6a0d6dd6 100644 --- a/config/freeswitch/freeswitch_gateways.tmp +++ b/config/freeswitch/freeswitch_gateways.tmp @@ -126,8 +126,22 @@ if ($config_change == 1) { - 0) { + foreach ($a_gateways as $ent) { + $a_gateways[$i]['id'] = $i; + $i++; + } + } + + //order the array + function cmp_string($a, $b) { + return strcmp($a["gateway"], $b["gateway"]); + } + usort($a_gateways, "cmp_string"); + $i = 0; if (count($a_gateways) > 0) { @@ -135,23 +149,23 @@ if ($config_change == 1) { ?> - +   - +   - +   - +   - - + +
diff --git a/config/freeswitch/freeswitch_public_includes.tmp b/config/freeswitch/freeswitch_public_includes.tmp index 1947d8ff..74bbf3bf 100644 --- a/config/freeswitch/freeswitch_public_includes.tmp +++ b/config/freeswitch/freeswitch_public_includes.tmp @@ -199,30 +199,51 @@ include("head.inc"); - 0) { + foreach ($a_public_includes as $ent) { + $a_public_includes[$i]['id'] = $i; + $i++; + } + } + + //order the array + //order the array + function cmp_number($a, $b) { + if ($a["order"] > $b["order"]) { + return 1; + } + else { + return 0; + } + } + usort($a_public_includes, "cmp_number"); + $i = 0; if (count($a_public_includes) > 0) { foreach ($a_public_includes as $ent) { if (strlen($ent['extensionname'].$ent['enabled']) > 0) { ?> - + - + - +   - +   - - + +
-- cgit v1.2.3