diff options
Diffstat (limited to 'config/freeswitch/freeswitch_profiles.tmp')
-rw-r--r-- | config/freeswitch/freeswitch_profiles.tmp | 243 |
1 files changed, 243 insertions, 0 deletions
diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp new file mode 100644 index 00000000..da57b249 --- /dev/null +++ b/config/freeswitch/freeswitch_profiles.tmp @@ -0,0 +1,243 @@ +<?php +/* $Id$ */ +/* + freeswitch_profiles.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_extensions = &$config['installedpackages']['freeswitchextensions']['config']; + +function ListFiles($dir) { + + if($dh = opendir($dir)) { + + $files = Array(); + $inner_files = Array(); + + while($file = readdir($dh)) { + if($file != "." && $file != ".." && $file[0] != '.') { + if(is_dir($dir . "/" . $file)) { + //$inner_files = ListFiles($dir . "/" . $file); //recursive + if(is_array($inner_files)) $files = array_merge($files, $inner_files); + } else { + array_push($files, $file); + //array_push($files, $dir . "/" . $file); + } + } + } + + closedir($dh); + return $files; + } +} + + +if ($_POST['a'] == "save") { + conf_mount_rw(); + $content = ereg_replace("\r","",$_POST['code']); + $fd = fopen("/usr/local/freeswitch/conf/sip_profiles/".$_POST['f'], "w"); + fwrite($fd, $content); + fclose($fd); + $savemsg = "Saved text to " . $_POST['f']; + conf_mount_ro(); +} + + +if ($_GET['a'] == "del") { + if ($_GET['type'] == 'profile') { + //if ($a_profiles[$_GET['id']]) { + //unset($a_extensions[$_GET['id']]); + //write_config(); + + exec("rm /usr/local/freeswitch/conf/sip_profiles/".$_GET['f']); + header("Location: freeswitch_profiles.php"); + exit; + //} + } +} + +include("head.inc"); + +?> + + +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<?php include("fbegin.inc"); ?> +<p class="pgtitle">FreeSWITCH: Profiles</p> + +<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&id=0"); + $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php"); + $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php"); + $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php"); + $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php"); + $tab_array[] = array(gettext("Profiles"), true, "/packages/freeswitch/freeswitch_profiles.php"); + $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php"); + $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php"); + $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&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_profiles.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td><p><span class="vexpl"><span class="red"><strong>Profiles<br> + </strong></span> + Use this to configure your SIP profiles. + </p></td> + </tr> + </table> + <br /> + + + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td width="25%" class="listhdrr">Name</td> + <td width="70%" class="listhdr">Description</td> + <td width="5%" class="list"> + </td> + </tr> + + + <?php + + + + foreach (ListFiles('/usr/local/freeswitch/conf/sip_profiles') as $key=>$file){ + ?> + <tr> + <td class="listr" ondblclick="document.location='freeswitch_profile_edit.php?f=<?=$file;?>';" valign="middle"> + <?=$file;?> + </td> + <td class="listbg" ondblclick="document.location='freeswitch_profile_edit.php?f=<?=$file;?>';"> + <?php + + switch ($file) { + case "internal.xml": + echo "<font color='#FFFFFF'>"; + echo "The Internal profile by default requires registration which is most often used for extensions. "; + echo "By default the Internal profile binds to the WAN IP which is accessible to the internal network. "; + echo "A rule can be set from PFSense -> Firewall -> Rules -> WAN to the the WAN IP for port 5060 which "; + echo "enables phones register from outside the network."; + echo ""; + echo "</font>"; + echo " "; + break; + case "internal-ipv6.xml": + echo "<font color='#FFFFFF'>The Internal IPV6 profile binds to the IP version 6 address and is similar to the Internal profile.</font> "; + break; + case "external.xml": + echo "<font color='#FFFFFF'>"; + echo "The External profile handles outbound registrations to a SIP provider or other SIP Server. The SIP provider sends calls to you, and you "; + echo "send calls to your provider, through the external profile. The external profile allows anonymous calling, which is "; + echo "required as your provider will never authenticate with you to send you a call. Calls can be sent using a SIP URL \"my.domain.com:5080\" "; + echo "</font> "; + break; + case "lan.xml": + echo "<font color='#FFFFFF'>The LAN profile is the same as the Internal profile except that it is bound to the LAN IP.</font> "; + break; + default: + echo "<font color='#FFFFFF'>default</font> "; + } + ?> + </td> + <td valign="middle" nowrap class="list" valign="top"> + <table border="0" cellspacing="0" cellpadding="1"> + <tr> + <td valign="middle"><a href="freeswitch_profile_edit.php?type=profile&f=<?=$file;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td><a href="freeswitch_profiles.php?type=profile&a=del&f=<?=$file;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + </tr> + </table> + </td> + </tr> + <?php + $i++; + } + + ?> + + <tr> + <td class="list" colspan="4"></td> + <td class="list"> + <table border="0" cellspacing="0" cellpadding="1"> + <tr> + <td width="17"></td> + <td valign="middle"></td> + </tr> + </table> + </td> + </tr> + + + <tr> + <td class="list" colspan="4"></td> + <td class="list"></td> + </tr> + </table> + +</form> + +<br> +<br> +/usr/local/freeswitch/conf/sip_profiles +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> + +</td> +</tr> +</table> + +</div> + + + +<?php include("fend.inc"); ?> +</body> +</html> |