aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch/freeswitch_public_includes_details_edit.tmp
diff options
context:
space:
mode:
authorBill Marquette <bill.marquette@gmail.com>2009-02-06 19:18:00 -0600
committerBill Marquette <bill.marquette@gmail.com>2009-02-06 19:18:00 -0600
commit55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1 (patch)
treeba4783bab1dd65f1ceef2dfac9fdbd515531d18b /config/freeswitch/freeswitch_public_includes_details_edit.tmp
parent67780cc9d469288742aea5bc378c29a54edd5ec5 (diff)
downloadpfsense-packages-55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1.tar.gz
pfsense-packages-55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1.tar.bz2
pfsense-packages-55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1.zip
mv packages to config dir to match web layout
Diffstat (limited to 'config/freeswitch/freeswitch_public_includes_details_edit.tmp')
-rw-r--r--config/freeswitch/freeswitch_public_includes_details_edit.tmp410
1 files changed, 410 insertions, 0 deletions
diff --git a/config/freeswitch/freeswitch_public_includes_details_edit.tmp b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
new file mode 100644
index 00000000..821d9097
--- /dev/null
+++ b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
@@ -0,0 +1,410 @@
+<?php
+/* $Id$ */
+/*
+
+ freeswitch_public_includes_details_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_public_includes_details = &$config['installedpackages']['freeswitchpublicincludedetails']['config'];
+
+$id = $_GET['id'];
+if (isset($_POST['id'])) {
+ $id = $_POST['id'];
+}
+
+$parentid = $_GET['parentid'];
+if (isset($_POST['parentid'])) {
+ $parentid = $_POST['parentid'];
+}
+
+$publicincludeid = $_GET['publicincludeid'];
+if (isset($_POST['publicincludeid'])) {
+ $publicincludeid = $_POST['publicincludeid'];
+}
+
+
+ //publicincludeid
+ //tag
+ //condition
+ //action
+ //antiaction
+ //param
+ //tagorder
+ //1-20
+ //fieldtype
+
+ //fielddata
+
+
+if (isset($id) && $a_public_includes_details[$id]) {
+ $pconfig['publicincludeid'] = $a_public_includes_details[$id]['publicincludeid'];
+ $pconfig['tag'] = $a_public_includes_details[$id]['tag'];
+ //$pconfig['tagorder'] = $a_public_includes_details[$id]['tagorder'];
+ $pconfig['fieldtype'] = $a_public_includes_details[$id]['fieldtype'];
+ $pconfig['fielddata'] = $a_public_includes_details[$id]['fielddata'];
+}
+//else {
+// if (isset($_GET['a'])) {
+// if ($_GET['a'] == "action"){ $pconfig['optionaction'] = "action"; }
+// if ($_GET['a'] == "antiaction"){ $pconfig['optionaction'] = "anti-action"; }
+// }
+//}
+
+
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+
+ if (!$input_errors) {
+
+ $ent = array();
+ $ent['publicincludeid'] = $_POST['publicincludeid'];
+ $ent['tag'] = $_POST['tag'];
+ //$ent['tagorder'] = $_POST['tagorder'];
+ $ent['fieldtype'] = $_POST['fieldtype'];
+ $ent['fielddata'] = $_POST['fielddata'];
+
+
+ if (isset($id) && $a_public_includes_details[$id]) {
+ //update
+ $a_public_includes_details[$id] = $ent;
+ }
+ else {
+ //add
+ $a_public_includes_details[] = $ent;
+ }
+
+ //touch($d_hostsdirty_path);
+ write_config();
+ sync_package_freeswitch_public_includes();
+
+ header("Location: freeswitch_public_includes_edit.php?id=".$parentid);
+ exit;
+ }
+}
+
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Public: Details: 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
+
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
+ $tab_array[] = array(gettext("Dialplan"), false, "/freeswitch/freeswitch_dialplan_includes.php");
+ $tab_array[] = array(gettext("Extensions"), false, "/freeswitch/freeswitch_extensions.php");
+ $tab_array[] = array(gettext("External"), false, "/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0");
+ $tab_array[] = array(gettext("Gateways"), false, "/freeswitch/freeswitch_gateways.php");
+ $tab_array[] = array(gettext("Internal"), false, "/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0");
+ $tab_array[] = array(gettext("IVR"), false, "/freeswitch/freeswitch_ivr.php");
+ $tab_array[] = array(gettext("Modules"), false, "/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0");
+ $tab_array[] = array(gettext("Public"), true, "/freeswitch/freeswitch_public_includes.php");
+ $tab_array[] = array(gettext("Rec"), false, "/freeswitch/freeswitch_recordings.php");
+ $tab_array[] = array(gettext("Status"), false, "/freeswitch/freeswitch_status.php");
+ $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
+ display_top_tabs($tab_array);
+
+?>
+</td></tr>
+</table>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+ <form action="freeswitch_public_includes_details_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">Tag</td>
+ <td width="78%" class="vtable">
+ <script type="text/javascript">
+ function public_include_details_tag_onchange() {
+ var tag = document.getElementById("form_tag").value;
+ if (tag == "condition") {
+ document.getElementById("label_fieldtype").innerHTML = "Field";
+ document.getElementById("label_fielddata").innerHTML = "Expression";
+ }
+ else if (tag == "action") {
+ document.getElementById("label_fieldtype").innerHTML = "Application";
+ document.getElementById("label_fielddata").innerHTML = "Data";
+ }
+ else if (tag == "anti-action") {
+ document.getElementById("label_fieldtype").innerHTML = "Application";
+ document.getElementById("label_fielddata").innerHTML = "Data";
+ }
+ else if (tag == "param") {
+ document.getElementById("label_fieldtype").innerHTML = "Name";
+ document.getElementById("label_fielddata").innerHTML = "Value";
+ }
+ if (tag == "") {
+ document.getElementById("label_fieldtype").innerHTML = "Type";
+ document.getElementById("label_fielddata").innerHTML = "Data";
+ }
+ }
+ </script>
+ <?php
+ echo " <select name='tag' class='formfld' id='form_tag' onchange='public_include_details_tag_onchange();'>\n";
+ echo " <option></option>\n";
+ switch (htmlspecialchars($pconfig['tag'])) {
+ case "condition":
+ echo " <option selected='yes'>condition</option>\n";
+ echo " <option>action</option>\n";
+ echo " <option>anti-action</option>\n";
+ //echo " <option>param</option>\n";
+ break;
+ case "action":
+ echo " <option>condition</option>\n";
+ echo " <option selected='yes'>action</option>\n";
+ echo " <option>anti-action</option>\n";
+ //echo " <option>param</option>\n";
+ break;
+ case "anti-action":
+ echo " <option>condition</option>\n";
+ echo " <option>action</option>\n";
+ echo " <option selected='yes'>anti-action</option>\n";
+ //echo " <option>param</option>\n";
+ break;
+ case "param":
+ echo " <option>condition</option>\n";
+ echo " <option>action</option>\n";
+ echo " <option>anti-action</option>\n";
+ //echo " <option selected='yes'>param</option>\n";
+ break;
+ default:
+ echo " <option>condition</option>\n";
+ echo " <option>action</option>\n";
+ echo " <option>anti-action</option>\n";
+ //echo " <option>param</option>\n";
+ }
+ echo " </select>\n";
+
+ //condition
+ //field expression
+ //action
+ //application
+ //data
+ //antiaction
+ //application
+ //data
+ //param
+ //name
+ //value
+
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq" id="label_fieldtype">Type</td>
+ <td width="78%" class="vtable">
+ <input name="fieldtype" type="text" class="formfld" id="fieldtype" size="40" value="<?=htmlspecialchars($pconfig['fieldtype']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq" id="label_fielddata">Data</td>
+ <td width="78%" class="vtable">
+ <input name="fielddata" type="text" class="formfld" id="fielddata" size="40" value="<?=htmlspecialchars($pconfig['fielddata']);?>">
+ <br> <span class="vexpl"></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="publicincludeid" type="hidden" value="<?=$publicincludeid;?>">
+ <input name="parentid" type="hidden" value="<?=$parentid;?>">
+ <?php if (isset($id) && $a_public_includes_details[$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 />
+ <b>Example</b>
+ <br />
+ <br />
+ If the inbound call matches the DID 12085551234 then proceed to the action.
+ <br />
+ <br />
+ <table cellpadding='3'>
+ <tr><th class="vncellreq" width='75' align="left">Tag:</th><td class="vtable">condition</td></tr>
+ <tr><th class="vncellreq" align="left">Type:</th><td class="vtable">destination_number</td></tr>
+ <tr><th class="vncellreq" align="left">Data:</th><td class="vtable">^(12085551234)$</td></tr>
+ </table>
+
+ <br />
+ <br />
+
+ Transfer the inbound call to an IVR with extension of 5000.
+ <br />
+ <br />
+ <table cellpadding='3'>
+ <tr><th class="vncellreq" width='75' align="left">Tag:</th><td class="vtable">action</td></tr>
+ <tr><th class="vncellreq" align="left">Application:</th><td class="vtable">transfer</td></tr>
+ <tr><th class="vncellreq" align="left">Data:</th><td class="vtable">5000 XML default</td></tr>
+ </table>
+
+ <br />
+ <br />
+
+ Or transfer the inbound call to extension 1001.
+ <br />
+ <br />
+ <table cellpadding='3'>
+ <tr><th class="vncellreq" width='75' align="left">Tag:</th><td class="vtable">action</td></tr>
+ <tr><th class="vncellreq" align="left">Application:</th><td class="vtable">transfer</td></tr>
+ <tr><th class="vncellreq" align="left">Data:</th><td class="vtable">1001 XML default</td></tr>
+ </table>
+
+
+ <br />
+ <br />
+ <br />
+ <br />
+
+
+ <b>Conditions</b>
+ <br />
+ <br />
+ Conditions are pattern matching tags that help FreeSwitch decide if the current call should be processed in this extension or not. When matching conditions against the current call you have several <b>fields</b> that you can compare against.
+ <ul>
+ <li><b>context</b></li>
+ <li><b>rdnis</b> Redirected Number, the directory number to which the call was last presented.</li>
+ <li><b>destination_number</b> Called Number, the number this call is trying to reach (within a given context)</li>
+ <li><b>public</b> Name of the public module that are used, the name is provided by each public module. Example: XML</li>
+ <li><b>caller_id_name</b> Name of the caller (provided by the User Agent that has called us).</li>
+ <li><b>caller_id_number</b> Directory Number of the party who called (callee) -- can be masked (hidden)</li>
+ <li><b>ani</b> Automatic Number Identification, the number of the calling party (callee) -- cannot be masked</li>
+ <li><b>ani2</b> The type of device placing the call [1]</li>
+ <li><b>uuid</b> Unique identifier of the current call? (looks like a GUID)</li>
+ <li><b>source</b> Name of the FreeSwitch module that received the call (e.g. PortAudio)</li>
+ <li><b>chan_name</b> Name of the current channel (Example: PortAudio/1234). Give us examples when this one can be used.</li>
+ <li><b>network_addr</b> IP address of the signalling source for a VoIP call.</li>
+ </ul>
+ In addition to the above you can also do variables using the syntax ${variable} or api functions using the syntax %{api} {args}
+ <br />
+ <br />
+ Variables may be used in either the field or the expression, as follows
+
+ <br />
+ <br />
+ <br />
+ <br />
+
+ <b>Action and Anti-Actions</b>
+ <br />
+ <br />
+ Actions are executed when the <b>condition matches</b>. Anti-Actions are executed when the <b>condition does NOT match</b>.
+ Additional information on applications for Actions and Anti-Actions.<br />
+ <a href='http://wiki.freeswitch.org/wiki/Modules#Applications' target='_blank'>http://wiki.freeswitch.org/wiki/Modules#Applications</a>
+ <br />
+ <a href='http://wiki.freeswitch.org/wiki/public_Functions' target='_blank'>http://wiki.freeswitch.org/wiki/public_Functions</a>
+ <br />
+ <br />
+ <br />
+ The following is a partial list of <b>applications</b>.
+ <ul>
+ <li><b>answer</b> answer the call</li>
+ <li><b>bridge</b> bridge the call<li>
+ <li><b>cond</b></li>
+ <li><b>db</b> is a a runtime database either sqlite by default or odbc</li>
+ <li><b>global_set</b> allows setting of global vars similar to the ones found in vars.xml</li>
+ <li><b>group</b> allows grouping of several extensions for things like ring groups</li>
+ <li><b>expr</b></li>
+ <li><b>hangup</b> hangs up the call</li>
+ <li><b>info</b> sends call info to the console</li>
+ <li><b>javascript</b> run javascript .js files</li>
+ <li><b>playback</b></li>
+ <li><b>reject</b> reject the call</li>
+ <li><b>respond</b></li>
+ <li><b>ring_ready</b></li>
+ <li><b>set</b> set a variable</li>
+ <li><b>set_user</b></li>
+ <li><b>sleep</b></li>
+ <li><b>sofia_contact</b></li>
+ <li><b>transfer</b> transfer the call to another extension or number<li>
+ <li><b>voicemail</b> send the call to voicemail</li>
+ </ul>
+
+
+ <br />
+ <br />
+
+ <!--
+ <b>Param</b>
+ Example parameters by name and value
+ <br />
+ <a href='http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go' target='_blank'>http://wiki.freeswitch.org/wiki/Special:Search?search=param&go=Go</a>
+ <ul>
+ <li><b>codec-ms</b> 20</li>
+ <li><b>codec-prefs</b> PCMU@20i</li>
+ <li><b>debug</b> 1</li>
+ <li><b>public</b> XML</li>
+ <li><b>dtmf-duration</b> 100</li>
+ <li><b>rfc2833-pt</b>" 101</li>
+ <li><b>sip-port</b> 5060</li>
+ <li><b>use-rtp-timer</b> true</li>
+ </ul>
+ <br />
+ <br />
+ -->
+
+
+ <br />
+ <br />
+ <br />
+ <br />
+ <br />
+
+ </td>
+ </tr>
+</table>
+
+</div>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>