diff options
author | mcrane <mctch@yahoo.com> | 2009-07-28 07:07:15 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-07-28 07:07:15 -0600 |
commit | 7ccc368017533ea47ba728ad7a84215b149944ed (patch) | |
tree | 10136917f064664446f9452bf89610e8094804b3 /config/freeswitch_dev/v_extensions_edit.tmp | |
parent | f805de2a0fdc3e888f0144bfff6dab58f5e0b132 (diff) | |
download | pfsense-packages-7ccc368017533ea47ba728ad7a84215b149944ed.tar.gz pfsense-packages-7ccc368017533ea47ba728ad7a84215b149944ed.tar.bz2 pfsense-packages-7ccc368017533ea47ba728ad7a84215b149944ed.zip |
FreeSWITCH package finish package file rename.
Diffstat (limited to 'config/freeswitch_dev/v_extensions_edit.tmp')
-rw-r--r-- | config/freeswitch_dev/v_extensions_edit.tmp | 418 |
1 files changed, 418 insertions, 0 deletions
diff --git a/config/freeswitch_dev/v_extensions_edit.tmp b/config/freeswitch_dev/v_extensions_edit.tmp new file mode 100644 index 00000000..e8bb341d --- /dev/null +++ b/config/freeswitch_dev/v_extensions_edit.tmp @@ -0,0 +1,418 @@ +<?php +/* $Id$ */ +/* + v_extensions_edit.php + Copyright (C) 2008 Mark J Crane + All rights reserved. + + 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/v_config.inc"); + + +$a_extensions = &$config['installedpackages']['freeswitchextensions']['config']; + +$id = $_GET['id']; +if (isset($_POST['id'])) { + $id = $_POST['id']; +} + +if (isset($id) && $a_extensions[$id]) { + + $pconfig['extension'] = $a_extensions[$id]['extension']; + $pconfig['password'] = $a_extensions[$id]['password']; + $pconfig['mailbox'] = $a_extensions[$id]['mailbox']; + $pconfig['vm-password'] = $a_extensions[$id]['vm-password']; + $pconfig['accountcode'] = $a_extensions[$id]['accountcode']; + $pconfig['effective_caller_id_name'] = $a_extensions[$id]['effective_caller_id_name']; + $pconfig['effective_caller_id_number'] = $a_extensions[$id]['effective_caller_id_number']; + $pconfig['effective_caller_id_number'] = $a_extensions[$id]['effective_caller_id_number']; + $pconfig['outbound_caller_id_name'] = $a_extensions[$id]['outbound_caller_id_name']; + $pconfig['outbound_caller_id_number'] = $a_extensions[$id]['outbound_caller_id_number']; + $pconfig['vm-mailto'] = $a_extensions[$id]['vm-mailto']; + $pconfig['vm-attach-file'] = $a_extensions[$id]['vm-attach-file']; + $pconfig['vm-keep-local-after-email'] = $a_extensions[$id]['vm-keep-local-after-email']; + $pconfig['user_context'] = $a_extensions[$id]['user_context']; + $pconfig['callgroup'] = $a_extensions[$id]['callgroup']; + $pconfig['auth-acl'] = $a_extensions[$id]['auth-acl']; + $pconfig['cidr'] = $a_extensions[$id]['cidr']; + $pconfig['sip-force-contact'] = $a_extensions[$id]['sip-force-contact']; + $pconfig['enabled'] = $a_extensions[$id]['enabled']; + $pconfig['description'] = $a_extensions[$id]['description']; + +} + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + + if (!$input_errors) { + + $effective_caller_id_number = $_POST['effective_caller_id_number']; + $outbound_caller_id_number = $_POST['outbound_caller_id_number']; + $replace_array = array("(", ")", " ", "-"); + $effective_caller_id_number = str_replace($replace_array, "", $effective_caller_id_number); + $outbound_caller_id_number = str_replace($replace_array, "", $outbound_caller_id_number); + + $ent = array(); + $ent['extension'] = $_POST['extension']; + $ent['password'] = $_POST['password']; + $ent['mailbox'] = $_POST['mailbox']; + $ent['vm-password'] = $_POST['vm-password']; + $ent['accountcode'] = $_POST['accountcode']; + $ent['effective_caller_id_name'] = $_POST['effective_caller_id_name']; + $ent['effective_caller_id_number'] = $effective_caller_id_number; + $ent['outbound_caller_id_name'] = $_POST['outbound_caller_id_name']; + $ent['outbound_caller_id_number'] = $outbound_caller_id_number; + $ent['vm-mailto'] = $_POST['vm-mailto']; + $ent['vm-attach-file'] = $_POST['vm-attach-file']; + $ent['vm-keep-local-after-email'] = $_POST['vm-keep-local-after-email']; + $ent['user_context'] = $_POST['user_context']; + $ent['callgroup'] = $_POST['callgroup']; + $ent['auth-acl'] = $_POST['auth-acl']; + $ent['cidr'] = $_POST['cidr']; + $ent['sip-force-contact'] = $_POST['sip-force-contact']; + $ent['enabled'] = $_POST['enabled']; + $ent['description'] = $_POST['description']; + + if (isset($id) && $a_extensions[$id]) { + //update + $a_extensions[$id] = $ent; + } + else { + //add + $a_extensions[] = $ent; + } + + write_config(); + sync_package_v_extensions(); + + header("Location: v_extensions.php"); + exit; + } +} + +include("head.inc"); + +?> + +<script type="text/javascript" language="JavaScript"> + +function show_advanced_config() { + document.getElementById("showadvancedbox").innerHTML=''; + aodiv = document.getElementById('showadvanced'); + aodiv.style.display = "block"; +} + +</script> + +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> + +<?php +include("fbegin.inc"); +echo "<p class=\"pgtitle\">$v_project_label: Extensions: Edit</p>\n"; +?> + +<?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" > + + + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td><p><span class="vexpl"><span class="red"><strong>Extension Setup<br> + </strong></span> + /usr/local/freeswitch/conf/directory/default/ + </p></td> + </tr> + </table> + <br /> + + <form action="v_extensions_edit.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + + <tr> + <td width="25%" valign="top" class="vncellreq">Extension</td> + <td width="75%" class="vtable"> + <input name="extension" type="text" class="formfld" id="extension" size="40" value="<?=htmlspecialchars($pconfig['extension']);?>"> + <br><span class="vexpl">Enter the extension here. The default configuration allows 3, 4, or 5 digit extensions.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Password</td> + <td width="75%" class="vtable"> + <input name="password" type="password" class="formfld" id="password" size="40" value="<?=htmlspecialchars($pconfig['password']);?>"> + <br><span class="vexpl">Enter the password here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Mailbox</td> + <td width="75%" class="vtable"> + <input name="mailbox" type="text" class="formfld" id="mailbox" size="40" value="<?=htmlspecialchars($pconfig['mailbox']);?>"> + <br><span class="vexpl">Enter the mailbox here. Example: extension 1001 then mailbox 1001<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Voicemail Password</td> + <td width="75%" class="vtable"> + <input name="vm-password" type="password" class="formfld" id="vm-password" size="40" value="<?=htmlspecialchars($pconfig['vm-password']);?>"> + <br><span class="vexpl">Enter the voicemail password here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Account Code</td> + <td width="75%" class="vtable"> + <input name="accountcode" type="text" class="formfld" id="accountcode" size="40" value="<?=htmlspecialchars($pconfig['accountcode']);?>"> + <br><span class="vexpl">Enter the account code here. Example: extension 1001 then accountcode 1001<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq" nowrap>Effective Caller ID Name</td> + <td width="75%" class="vtable"> + <input name="effective_caller_id_name" type="text" class="formfld" id="effective_caller_id_name" size="40" value="<?=htmlspecialchars($pconfig['effective_caller_id_name']);?>"> + <br><span class="vexpl">Enter the effective caller id name here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq" nowrap>Effective Caller ID Number</td> + <td width="75%" class="vtable"> + <input name="effective_caller_id_number" type="text" class="formfld" id="effective_caller_id_number" size="40" value="<?=htmlspecialchars($pconfig['effective_caller_id_number']);?>"> + <br><span class="vexpl">Enter the effective caller id number here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq" nowrap>Voicemail Mail To</td> + <td width="75%" class="vtable"> + <input name="vm-mailto" type="text" class="formfld" id="vm-mailto" size="40" value="<?=htmlspecialchars($pconfig['vm-mailto']);?>"> + <br><span class="vexpl">Optional: Enter the email address to send voicemail to.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq" nowrap>Voicemail Attach File</td> + <td width="75%" class="vtable"> + <?php + echo " <select name='vm-attach-file' class='formfld'>\n"; + echo " <option></option>\n"; + switch (htmlspecialchars($pconfig['vm-attach-file'])) { + case "true": + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + break; + case "false": + echo " <option value='true'>true</option>\n"; + echo " <option value='false' selected='yes'>false</option>\n"; + + break; + default: + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + } + echo " </select>\n"; + ?> + Choose whether to attach the file to the email. + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq" nowrap>VM Keep Local After Email</td> + <td width="75%" class="vtable"> + <?php + echo " <select name='vm-keep-local-after-email' class='formfld'>\n"; + echo " <option></option>\n"; + switch (htmlspecialchars($pconfig['vm-keep-local-after-email'])) { + case "true": + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + break; + case "false": + echo " <option value='true'>true</option>\n"; + echo " <option value='false' selected='yes'>false</option>\n"; + + break; + default: + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + } + echo " </select>\n"; + ?> + Keep local file after sending the email. + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">User Context</td> + <td width="75%" class="vtable"> + <input name="user_context" type="text" class="formfld" id="user_context" size="40" value="<?=htmlspecialchars($pconfig['user_context']);?>"> + <br><span class="vexpl">Enter the user context here. Example: default<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Call Group</td> + <td width="75%" class="vtable"> + <input name="callgroup" type="text" class="formfld" id="callgroup" size="40" value="<?=htmlspecialchars($pconfig['callgroup']);?>"> + <br><span class="vexpl">Enter the user call group here. Example: sales, support<br></span> + </td> + </tr> + </table> + + <div id="showadvancedbox"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td width="25%" valign="top" class="vncell">Show Advanced</td> + <td width="75%" class="vtable"> + <input type="button" onClick="show_advanced_config()" value="Advanced"></input></a> + </td> + </tr> + </table> + </div> + <div id="showadvanced" style="display:none"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td width="25%" valign="top" class="vncell">Auth-ACL</td> + <td width="75%" class="vtable"> + <input name="auth-acl" type="text" class="formfld" id="auth-acl" size="40" value="<?=htmlspecialchars($pconfig['auth-acl']);?>"> + <br> <span class="vexpl">Enter the auth acl here.<br></span> + </td> + </tr> + <tr> + <td valign="top" class="vncell">CIDR</td> + <td class="vtable"> + <input name="cidr" type="text" class="formfld" id="cidr" size="40" value="<?=htmlspecialchars($pconfig['cidr']);?>"> + <br> <span class="vexpl">Enter the cidr here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncell" nowrap>Outbound Caller ID Name</td> + <td width="75%" class="vtable"> + <input name="outbound_caller_id_name" type="text" class="formfld" id="outbound_caller_id_name" size="40" value="<?=htmlspecialchars($pconfig['outbound_caller_id_name']);?>"> + <br><span class="vexpl">Enter the outbound caller id name here.<br></span> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncell" nowrap>Outbound Caller ID Number</td> + <td width="75%" class="vtable"> + <input name="outbound_caller_id_number" type="text" class="formfld" id="outbound_caller_id_number" size="40" value="<?=htmlspecialchars($pconfig['outbound_caller_id_number']);?>"> + <br><span class="vexpl">Enter the outbound caller id number here.<br></span> + </td> + </tr> + <tr> + <td width="22%" valign="top" class="vncell">SIP-Force-Contact</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='sip-force-contact' class='formfld'>\n"; + echo " <option></option>\n"; + switch (htmlspecialchars($pconfig['sip-force-contact'])) { + case "NDLB-connectile-dysfunction": + echo " <option value='NDLB-connectile-dysfunction' selected='yes'>Rewrite contact IP and port</option>\n"; + echo " <option value='NDLB-tls-connectile-dysfunction'>Rewrite contact port</option>\n"; + break; + case "NDLB-tls-connectile-dysfunction": + echo " <option value='NDLB-connectile-dysfunction'>Rewrite contact IP and port</option>\n"; + echo " <option value='NDLB-tls-connectile-dysfunction' selected='yes'>Rewrite contact port</option>\n"; + default: + echo " <option value='NDLB-connectile-dysfunction'>Rewrite contact IP and port</option>\n"; + echo " <option value='NDLB-tls-connectile-dysfunction'>Rewrite contact port</option>\n"; + } + echo " </select>\n"; + ?> + <br /> + Choose sip-force-contact can be used to NDLB-connectile-dysfunction rewrites contact IP and port, <br />and NDLB-tls-connectile-dysfunction rewrites the contact port.<br /> + </td> + </tr> + </table> + </div> + + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td width="22%" valign="top" class="vncellreq">Enabled</td> + <td width="78%" class="vtable"> + <?php + echo " <select name='enabled' class='formfld'>\n"; + echo " <option></option>\n"; + switch (htmlspecialchars($pconfig['enabled'])) { + case "true": + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + break; + case "false": + echo " <option value='true'>true</option>\n"; + echo " <option value='false' selected='yes'>false</option>\n"; + + break; + default: + echo " <option value='true' selected='yes'>true</option>\n"; + echo " <option value='false'>false</option>\n"; + } + echo " </select>\n"; + ?> + </td> + </tr> + <tr> + <td width="25%" valign="top" class="vncellreq">Extension Description</td> + <td width="75%" class="vtable"> + <input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>"> + <br><span class="vexpl">Enter the description of the extension here.<br></span> + </td> + </tr> + <tr> + <td valign="top"> </td> + <td> + <input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()"> + <?php if (isset($id) && $a_extensions[$id]): ?> + <input name="id" type="hidden" value="<?=$id;?>"> + <?php endif; ?> + </td> + </tr> + </table> + </form> + + <br> + <br> + <br> + <br> + <br> + <br> + + </td> + </tr> +</table> + +</div> + +<?php include("fend.inc"); ?> +</body> +</html> |