From 23b1a7de679f1b8626633b643b6566c51274d986 Mon Sep 17 00:00:00 2001 From: mcrane Date: Wed, 15 Jul 2009 22:38:34 -0600 Subject: FreeSWITCH add an optional pin number to the hunt group. --- config/freeswitch_dev/freeswitch.inc | 23 ++++++++++++++++++++++ .../freeswitch_dev/freeswitch_hunt_group_edit.tmp | 17 ++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/freeswitch_dev/freeswitch.inc b/config/freeswitch_dev/freeswitch.inc index 22d8478f..aaeb2767 100644 --- a/config/freeswitch_dev/freeswitch.inc +++ b/config/freeswitch_dev/freeswitch.inc @@ -1172,6 +1172,29 @@ function sync_package_freeswitch_hunt_group() } //end if strlen huntgroupid; add the Hunt Group to the dialplan + //--- begin: pin number ------------------------------------ + if ($rowhelper['huntgrouppin']) > 0) { + echo "var pin = '".$rowhelper['huntgrouppin']."';\n"; + echo "if (pin.length > 0) {\n"; + echo " var dtmf = new Object();\n"; + echo " dtmf.digits = \"\";\n"; + echo " digitmaxlength = 6;\n"; + echo " session.execute(\"set\", \"playback_terminators=#\");\n"; + echo " session.streamFile( \"/usr/local/freeswitch/sounds/custom/8000/please_enter_the_pin_number.wav\", mycb, \"dtmf\");\n"; + echo " session.collectInput( mycb, dtmf, timeoutpin );\n"; + echo "\n"; + echo " if (dtmf.digits == pin || pin.length == 0) {\n"; + echo " //continue\n"; + echo " }\n"; + echo " else {\n"; + echo " console_log( \"info\", \"Pin: \" + dtmf.digits + \" is incorrect\\n\" );\n"; + echo " session.streamFile( \"/usr/local/freeswitch/sounds/custom/8000/your_pin_number_is_incorect_goodbye.wav\", mycb, \"dtmf\");\n"; + echo " session.hangup();\n"; + echo " }\n"; + echo "}"; + } + //--- end: pin number ------------------------------------ + //Get the list of destinations then build the Hunt Group javascript $tmp = ""; $tmp .= "\n"; diff --git a/config/freeswitch_dev/freeswitch_hunt_group_edit.tmp b/config/freeswitch_dev/freeswitch_hunt_group_edit.tmp index 29915f67..82fa87e0 100644 --- a/config/freeswitch_dev/freeswitch_hunt_group_edit.tmp +++ b/config/freeswitch_dev/freeswitch_hunt_group_edit.tmp @@ -58,7 +58,8 @@ if (isset($id) && $a_hunt_group[$id]) { $pconfig['huntgrouptimeoutdestination'] = $a_hunt_group[$id]['huntgrouptimeoutdestination']; $pconfig['huntgrouptimeouttype'] = $a_hunt_group[$id]['huntgrouptimeouttype']; $pconfig['huntgroupringback'] = $a_hunt_group[$id]['huntgroupringback']; - $pconfig['huntgroupcidnameprefix'] = $a_hunt_group[$id]['huntgroupcidnameprefix']; + $pconfig['huntgroupcidnameprefix'] = $a_hunt_group[$id]['huntgroupcidnameprefix']; + $pconfig['huntgrouppin'] = $a_hunt_group[$id]['huntgrouppin']; $pconfig['huntgroupdescr'] = $a_hunt_group[$id]['huntgroupdescr']; } @@ -97,7 +98,8 @@ if ($_POST) { $huntgroupent['huntgrouptimeoutdestination'] = $_POST['huntgrouptimeoutdestination']; $huntgroupent['huntgrouptimeouttype'] = $_POST['huntgrouptimeouttype']; $huntgroupent['huntgroupringback'] = $_POST['huntgroupringback']; - $huntgroupent['huntgroupcidnameprefix'] = $_POST['huntgroupcidnameprefix']; + $huntgroupent['huntgroupcidnameprefix'] = $_POST['huntgroupcidnameprefix']; + $huntgroupent['huntgrouppin'] = $_POST['huntgrouppin']; $huntgroupent['huntgroupdescr'] = $_POST['huntgroupdescr']; if (isset($id) && $a_hunt_group[$id]) { @@ -283,6 +285,17 @@ display_top_tabs(build_menu()); + + PIN + + +
+ + If this is provided then the caller will be required to enter the PIN number. (optional) + + + + Description -- cgit v1.2.3