aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch_dev/freeswitch.inc
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-07-15 22:38:34 -0600
committermcrane <mctch@yahoo.com>2009-07-15 22:38:34 -0600
commit23b1a7de679f1b8626633b643b6566c51274d986 (patch)
tree5b40299bd727f8db3268abf7778d73ad04bf16ba /config/freeswitch_dev/freeswitch.inc
parent1fbbee5377f717c203a83e67781cd2d80a126e68 (diff)
downloadpfsense-packages-23b1a7de679f1b8626633b643b6566c51274d986.tar.gz
pfsense-packages-23b1a7de679f1b8626633b643b6566c51274d986.tar.bz2
pfsense-packages-23b1a7de679f1b8626633b643b6566c51274d986.zip
FreeSWITCH add an optional pin number to the hunt group.
Diffstat (limited to 'config/freeswitch_dev/freeswitch.inc')
-rw-r--r--config/freeswitch_dev/freeswitch.inc23
1 files changed, 23 insertions, 0 deletions
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";