aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch_dev
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
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')
-rw-r--r--config/freeswitch_dev/freeswitch.inc23
-rw-r--r--config/freeswitch_dev/freeswitch_hunt_group_edit.tmp17
2 files changed, 38 insertions, 2 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";
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]) {
@@ -284,6 +286,17 @@ display_top_tabs(build_menu());
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell">PIN</td>
+ <td width="78%" class="vtable">
+ <input name="huntgrouppin" type="text" class="formfld" id="huntgrouppin" size="40" value="<?=htmlspecialchars($pconfig['huntgrouppin']);?>">
+ <br>
+ <span class="vexpl">
+ If this is provided then the caller will be required to enter the PIN number. (optional)
+ </span>
+ </td>
+ </tr>
+
+ <tr>
<td width="22%" valign="top" class="vncell">Description</td>
<td width="78%" class="vtable">
<input name="huntgroupdescr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['huntgroupdescr']);?>">