aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-05-28 03:47:17 -0600
committermcrane <mctch@yahoo.com>2009-05-28 03:47:17 -0600
commit23e1ab04471d14367023a7a11b08920b6a40b0b6 (patch)
tree59cb9071447f4168f1702d024bba41c648a5a2b2 /config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp
parent43d53ad267a29408fb9ef3598cd40db4c0c1d553 (diff)
downloadpfsense-packages-23e1ab04471d14367023a7a11b08920b6a40b0b6.tar.gz
pfsense-packages-23e1ab04471d14367023a7a11b08920b6a40b0b6.tar.bz2
pfsense-packages-23e1ab04471d14367023a7a11b08920b6a40b0b6.zip
FreeSWITCH package add huntgroup feature and outbound caller id to extension
Diffstat (limited to 'config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp')
-rw-r--r--config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp230
1 files changed, 230 insertions, 0 deletions
diff --git a/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp
new file mode 100644
index 00000000..bd7f446b
--- /dev/null
+++ b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp
@@ -0,0 +1,230 @@
+<?php
+/* $Id$ */
+/*
+
+ freeswitch_hunt_group_destinations_edit.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+require("/usr/local/pkg/freeswitch.inc");
+
+
+$a_hunt_group_destinations = &$config['installedpackages']['freeswitchhuntgroupdestinations']['config'];
+
+
+$id = $_GET['id'];
+if (isset($_POST['id'])) {
+ $id = $_POST['id'];
+}
+
+$parentid = $_GET['parentid'];
+if (isset($_POST['parentid'])) {
+ $parentid = $_POST['parentid'];
+}
+
+$huntgroupid = $_GET['huntgroupid'];
+if (isset($_POST['huntgroupid'])) {
+ $huntgroupid = $_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['destinationorder'] = $a_hunt_group_destinations[$id]['destinationorder'];
+ $pconfig['destinationdescr'] = $a_hunt_group_destinations[$id]['destinationdescr'];
+}
+else {
+ if (isset($_GET['a'])) {
+ //if ($_GET['a'] == "action"){ $pconfig['destinationaction'] = "action"; }
+ //if ($_GET['a'] == "antiaction"){ $pconfig['destinationaction'] = "anti-action"; }
+ }
+}
+
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+
+ if (!$input_errors) {
+
+ $huntgroupdestinationent = array();
+ $huntgroupdestinationent['huntgroupid'] = $_POST['huntgroupid'];
+ $huntgroupdestinationent['destinationnumber'] = $_POST['destinationnumber'];
+ $huntgroupdestinationent['destinationtype'] = $_POST['destinationtype'];
+ $huntgroupdestinationent['destinationorder'] = $_POST['destinationorder'];
+ $huntgroupdestinationent['destinationdescr'] = $_POST['destinationdescr'];
+
+ if (isset($id) && $a_hunt_group_destinations[$id]) {
+ //update
+ $a_hunt_group_destinations[$id] = $huntgroupdestinationent;
+ }
+ else {
+ //add
+ $a_hunt_group_destinations[] = $huntgroupdestinationent;
+ }
+
+
+ write_config();
+ sync_package_freeswitch_hunt_group();
+
+ header("Location: freeswitch_hunt_group_edit.php?id=".$parentid);
+ exit;
+ }
+}
+
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Hunt Group: Destinations: Edit</p>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+display_top_tabs(build_menu());
+
+?>
+</td></tr>
+</table>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+ <br />
+ <form action="freeswitch_hunt_group_destinations_edit.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Destination</td>
+ <td width="78%" class="vtable">
+ <input name="destinationnumber" type="text" class="formfld" id="destinationnumber" size="40" value="<?=htmlspecialchars($pconfig['destinationnumber']);?>">
+ <br> <span class="vexpl">Destination<br>
+ e.g. <em>1001</em></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Type</td>
+ <td width="78%" class="vtable">
+ <?php
+ echo " <select name='destinationtype' class='formfld'>\n";
+ echo " <option></option>\n";
+ if (htmlspecialchars($pconfig['destinationtype']) == "extension") {
+ echo " <option selected='yes'>extension</option>\n";
+ }
+ else {
+ echo " <option>extension</option>\n";
+ }
+ if (htmlspecialchars($pconfig['destinationtype']) == "voicemail") {
+ echo " <option selected='yes'>voicemail</option>\n";
+ }
+ else {
+ echo " <option>voicemail</option>\n";
+ }
+ if (htmlspecialchars($pconfig['destinationtype']) == "sip uri") {
+ echo " <option selected='yes'>sip uri</option>\n";
+ }
+ else {
+ echo " <option>sip uri</option>\n";
+ }
+ echo " </select>\n";
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Order</td>
+ <td width="78%" class="vtable">
+ <?php
+ echo " <select name='destinationorder' class='formfld'>\n";
+ //echo " <option></option>\n";
+ if (strlen(htmlspecialchars($pconfig['destinationorder']))> 0) {
+ echo " <option selected='yes' value='".htmlspecialchars($pconfig['destinationorder'])."'>".htmlspecialchars($pconfig['destinationorder'])."</option>\n";
+ }
+ $i=0;
+ while($i<=999) {
+ if (strlen($i) == 1) {
+ echo " <option value='00$i'>00$i</option>\n";
+ }
+ if (strlen($i) == 2) {
+ echo " <option value='0$i'>0$i</option>\n";
+ }
+ if (strlen($i) == 3) {
+ echo " <option value='$i'>$i</option>\n";
+ }
+
+ $i++;
+ }
+ echo " </select>\n";
+ ?>
+ <br />
+ Processing of each destination is determined by this order.
+
+ <br> <span class="vexpl"></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Description</td>
+ <td width="78%" class="vtable">
+ <input name="destinationdescr" type="text" class="formfld" id="destinationdescr" size="40" value="<?=htmlspecialchars($pconfig['destinationdescr']);?>">
+ <br> <span class="vexpl">You may enter a description here
+ for your reference (not parsed).</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="huntgroupid" type="hidden" value="<?=$huntgroupid;?>">
+ <input name="parentid" type="hidden" value="<?=$parentid;?>">
+ <?php if (isset($id) && $a_hunt_group_destinations[$id]): ?>
+ <input name="id" type="hidden" value="<?=$id;?>">
+ <?php endif; ?>
+ <input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
+ </td>
+ </tr>
+ </table>
+ </form>
+
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+
+ </td>
+ </tr>
+</table>
+
+</div>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>