From cf8abc2e725f42eb6176de1da77d5a03766fee6e Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 28 May 2009 21:10:10 -0600 Subject: FreeSWITCH package add profile selection to hunt group dest, ivr watch for up to 5 digits instead of 4 --- config/freeswitch/freeswitch.inc | 21 ++++++++-------- config/freeswitch/freeswitch.xml | 2 +- .../freeswitch_hunt_group_destinations_edit.tmp | 29 +++++++++++++++++++++- config/freeswitch/freeswitch_hunt_group_edit.tmp | 18 ++++++++------ config/freeswitch/freeswitch_ivr.tmp | 2 +- config/freeswitch/freeswitch_profiles.tmp | 12 +-------- config/freeswitch/freeswitch_recordings_edit.tmp | 2 +- 7 files changed, 54 insertions(+), 32 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index fc222125..6c0976da 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1124,8 +1124,8 @@ function sync_package_freeswitch_hunt_group() //Get the list of destinations then build the Hunt Group javascript $tmp = ""; - $tmp .= " function get_sofia_contact(extension,domain_name){\n"; - $tmp .= " session.execute(\"set\", \"sofia_contact_\"+extension+\"=\${sofia_contact(internal/\"+extension+\"@\"+domain_name+\")}\");\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"; @@ -1185,15 +1185,18 @@ function sync_package_freeswitch_hunt_group() $row['huntgroupid'] $row['destinationnumber'] $row['destinationtype'] + $row['destinationprofile'] $row['destinationorder'] $row['destinationdescr'] */ - if ($row['huntgroupid'] == $rowhelper['huntgroupid']) { + if ($row['huntgroupid'] == $rowhelper['huntgroupid']) { + + //set the default profile + if (strlen($row['destinationnumber']) == 0) { $row['destinationnumber'] = "internal"; } if ($row['destinationtype'] == "extension") { - //$tmp .= " session.execute(\"transfer\", \"".$row['destinationnumber']." XML default\"); //".$row['destinationdescr']."\n"; - $tmp .= " sofia_contact_".$row['destinationnumber']." = get_sofia_contact(\"".$row['destinationnumber']."\",domain_name);\n"; + $tmp .= " sofia_contact_".$row['destinationnumber']." = get_sofia_contact(\"".$row['destinationnumber']."\",domain_name, \"".$row['destinationprofile']."\");\n"; $tmp_sub_array["application"] = "bridge"; $tmp_sub_array["data"] = "sofia_contact_".$row['destinationnumber']; $tmp_array[$x] = $tmp_sub_array; @@ -1207,9 +1210,7 @@ function sync_package_freeswitch_hunt_group() $tmp_array[$x] = $tmp_sub_array; unset($tmp_sub_array); } - if ($row['destinationtype'] == "sip uri") { - //$tmp .= " session.execute(\"transfer\", \"".$row['destinationnumber']." XML default\"); //".$row['destinationdescr']."\n"; - //tmp .= " sofia_contact_".$row['destinationnumber']." = get_sofia_contact(\"".$row['destinationnumber']."\",domain_name);\n"; + if ($row['destinationtype'] == "sip uri") { $tmp_sub_array["application"] = "bridge"; $tmp_sub_array["data"] = "\"".$row['destinationnumber']."\""; $tmp_array[$x] = $tmp_sub_array; @@ -1607,7 +1608,7 @@ function sync_package_freeswitch_ivr() //$tmp .= " //http://wiki.freeswitch.org/wiki/Session_getDigits\n"; //$tmp .= " //getDigits(length, terminators, timeout, digit_timeout, abs_timeout)\n"; //$tmp .= " //dtmf.digits += session.getDigits(2, \"#\", 3000); //allow up to 3 digits\n"; - $tmp .= " dtmf.digits += session.getDigits(3, \"#\", 3000); //allow up to 4 digits\n"; + $tmp .= " dtmf.digits += session.getDigits(4, \"#\", 3000); //allow up to 5 digits\n"; $tmp .= "\n"; $tmp .= "\n"; //$tmp .= " console_log( \"info\", \"IVR Digit Pressed: \" + dtmf.digits + \"\\n\" );\n"; @@ -2165,7 +2166,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.8"; + $freeswitch_package_version = "0.8.8.1"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index fc191c21..83d0ccf4 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 + 0.8.8.1 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp index bd7f446b..1188438c 100644 --- a/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp +++ b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp @@ -57,6 +57,7 @@ if (isset($_POST['huntgroupid'])) { if (isset($id) && $a_hunt_group_destinations[$id]) { $pconfig['destinationnumber'] = $a_hunt_group_destinations[$id]['destinationnumber']; $pconfig['destinationtype'] = $a_hunt_group_destinations[$id]['destinationtype']; + $pconfig['destinationprofile'] = $a_hunt_group_destinations[$id]['destinationprofile']; $pconfig['destinationorder'] = $a_hunt_group_destinations[$id]['destinationorder']; $pconfig['destinationdescr'] = $a_hunt_group_destinations[$id]['destinationdescr']; } @@ -80,6 +81,7 @@ if ($_POST) { $huntgroupdestinationent['huntgroupid'] = $_POST['huntgroupid']; $huntgroupdestinationent['destinationnumber'] = $_POST['destinationnumber']; $huntgroupdestinationent['destinationtype'] = $_POST['destinationtype']; + $huntgroupdestinationent['destinationprofile'] = $_POST['destinationprofile']; $huntgroupdestinationent['destinationorder'] = $_POST['destinationorder']; $huntgroupdestinationent['destinationdescr'] = $_POST['destinationdescr']; @@ -160,7 +162,32 @@ display_top_tabs(build_menu()); 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['destinationprofile']) == $sip_profile_name) { + echo " \n"; + } + else { + echo " \n"; + } + } + echo " \n"; + + + ?> + + + Order diff --git a/config/freeswitch/freeswitch_hunt_group_edit.tmp b/config/freeswitch/freeswitch_hunt_group_edit.tmp index 8e06429c..b1c6d57f 100644 --- a/config/freeswitch/freeswitch_hunt_group_edit.tmp +++ b/config/freeswitch/freeswitch_hunt_group_edit.tmp @@ -294,11 +294,12 @@ display_top_tabs(build_menu()); - - - + + + + - diff --git a/config/freeswitch/freeswitch_recordings_edit.tmp b/config/freeswitch/freeswitch_recordings_edit.tmp index 1e38d616..e53c44fc 100644 --- a/config/freeswitch/freeswitch_recordings_edit.tmp +++ b/config/freeswitch/freeswitch_recordings_edit.tmp @@ -116,7 +116,7 @@ display_top_tabs(build_menu());
DestinationTypeOrderDestinationTypeProfileOrder Description + @@ -341,6 +342,9 @@ display_top_tabs(build_menu()); + @@ -363,7 +367,7 @@ display_top_tabs(build_menu()); } ?> - + - +
  +   +  
@@ -376,7 +380,7 @@ display_top_tabs(build_menu()); - +
@@ -391,7 +395,7 @@ display_top_tabs(build_menu());
diff --git a/config/freeswitch/freeswitch_ivr.tmp b/config/freeswitch/freeswitch_ivr.tmp index 67084f07..c1e53dff 100644 --- a/config/freeswitch/freeswitch_ivr.tmp +++ b/config/freeswitch/freeswitch_ivr.tmp @@ -117,7 +117,7 @@ display_top_tabs(build_menu());
-    +     diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp index 983b448c..188619f4 100644 --- a/config/freeswitch/freeswitch_profiles.tmp +++ b/config/freeswitch/freeswitch_profiles.tmp @@ -81,17 +81,7 @@ include("head.inc");
- +
-- cgit v1.2.3