aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-10-07 03:20:59 +0000
committerMark Crane <mcrane@pfsense.org>2008-10-07 03:20:59 +0000
commitf0fbaedf848ba8478191ff335f32c8146d89dc5a (patch)
tree5912f7342bdd84b3f6d38669800fca588aa350b6 /packages
parentf1220b9074dc3411e6ae9f4c6917edfd8bd23ba6 (diff)
downloadpfsense-packages-f0fbaedf848ba8478191ff335f32c8146d89dc5a.tar.gz
pfsense-packages-f0fbaedf848ba8478191ff335f32c8146d89dc5a.tar.bz2
pfsense-packages-f0fbaedf848ba8478191ff335f32c8146d89dc5a.zip
freeswitch package files
Diffstat (limited to 'packages')
-rw-r--r--packages/freeswitch/freeswitch.inc631
-rw-r--r--packages/freeswitch/freeswitch.xml249
-rw-r--r--packages/freeswitch/freeswitch_dialplan.xml129
-rw-r--r--packages/freeswitch/freeswitch_extensions.xml195
-rw-r--r--packages/freeswitch/freeswitch_external.xml129
-rw-r--r--packages/freeswitch/freeswitch_gateways.xml222
-rw-r--r--packages/freeswitch/freeswitch_internal.xml129
-rw-r--r--packages/freeswitch/freeswitch_modules.xml128
-rw-r--r--packages/freeswitch/freeswitch_public.xml129
-rw-r--r--packages/freeswitch/freeswitch_status.tmp225
-rw-r--r--packages/freeswitch/freeswitch_vars.xml129
-rw-r--r--packages/freeswitch/libncurses.so.5.6bin0 -> 127748 bytes
-rw-r--r--packages/freeswitch/libtinfo.so.5.6bin0 -> 187069 bytes
13 files changed, 2295 insertions, 0 deletions
diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc
new file mode 100644
index 00000000..14cdc759
--- /dev/null
+++ b/packages/freeswitch/freeswitch.inc
@@ -0,0 +1,631 @@
+<?php
+/* $Id$ */
+/*
+/* ========================================================================== */
+/*
+ freeswitch.xml
+ 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.
+*/
+
+
+function pkg_is_service_running($servicename)
+{
+ exec("/bin/ps ax | awk '{ print $5 }'", $psout);
+ array_shift($psout);
+ foreach($psout as $line) {
+ $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
+ }
+ if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+
+function event_socket_create($host, $port, $password)
+{
+ $fp = fsockopen($host, $port, $errno, $errdesc)
+ or die("Connection to $host failed");
+ socket_set_blocking($fp,false);
+
+ if ($fp) {
+ while (!feof($fp)) {
+ $buffer = fgets($fp, 1024);
+ usleep(100); //allow time for reponse
+ if (trim($buffer) == "Content-Type: auth/request") {
+ fputs($fp, "auth $password\n\n");
+ break;
+ }
+ }
+ return $fp;
+ }
+ else {
+ return false;
+ }
+}
+
+
+function event_socket_request($fp, $cmd)
+{
+ if ($fp) {
+ fputs($fp, $cmd."\n\n");
+ usleep(100); //allow time for reponse
+
+ $response = "";
+ $i = 0;
+ $contentlength = 0;
+ while (!feof($fp)) {
+ $buffer = fgets($fp, 4096);
+ if ($contentlength > 0) {
+ $response .= $buffer;
+ }
+
+ if ($contentlength == 0) { //if contentlenght is already don't process again
+ if (strlen(trim($buffer)) > 0) { //run only if buffer has content
+ $temparray = split(":", trim($buffer));
+ if ($temparray[0] == "Content-Length") {
+ $contentlength = trim($temparray[1]);
+ }
+ }
+ }
+
+ usleep(100); //allow time for reponse
+
+ //optional because of script timeout //don't let while loop become endless
+ if ($i > 10000) { break; }
+
+ if ($contentlength > 0) { //is contentlength set
+ //stop reading if all content has been read.
+ if (strlen($response) >= $contentlength) {
+ break;
+ }
+ }
+ $i++;
+ }
+
+ return $response;
+ }
+ else {
+ echo "no handle";
+ }
+}
+
+
+function event_socket_request_reloadxml()
+{
+ global $config;
+
+ $password = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'];
+ $port = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'];
+ $host = $config['interfaces']['lan']['ipaddr'];
+
+ if (pkg_is_service_running('freeswitch'))
+ {
+ $fp = event_socket_create($host, $port, $password);
+ $cmd = "api reloadxml";
+ $response = event_socket_request($fp, $cmd);
+ fclose($fp);
+ }
+ unset($host, $port, $password);
+
+}
+
+
+
+function sync_package_freeswitch_settings()
+{
+ global $config;
+
+ if($config['installedpackages']['freeswitchsettings']['config'] != "") {
+
+ conf_mount_rw();
+ config_unlock();
+
+ foreach($config['installedpackages']['freeswitchsettings']['config'] as $rowhelper) {
+
+ $fout = fopen("/usr/local/freeswitch/conf/directory/default/default.xml","w");
+ $tmpxml = "<include>\n";
+ $tmpxml .= " <user id=\"default\"> <!--if id is numeric mailbox param is not necessary-->\n";
+ $tmpxml .= " <variables>\n";
+ $tmpxml .= " <!--all variables here will be set on all inbound calls that originate from this user -->\n";
+ $tmpxml .= " <!-- set these to take advantage of a dialplan localized to this user -->\n";
+ $tmpxml .= " <variable name=\"numbering_plan\" value=\"" . $rowhelper['numbering_plan'] . "\"/>\n";
+ $tmpxml .= " <variable name=\"default_gateway\" value=\"" . $rowhelper['default_gateway'] . "\"/>\n";
+ $tmpxml .= " <variable name=\"default_area_code\" value=\"" . $rowhelper['default_area_code'] . "\"/>\n";
+ $tmpxml .= " </variables>\n";
+ $tmpxml .= " </user>\n";
+ $tmpxml .= "</include>\n";
+ fwrite($fout, $tmpxml);
+ unset($tmpxml);
+ fclose($fout);
+
+ $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml","w");
+ $tmpxml = "<configuration name=\"event_socket.conf\" description=\"Socket Client\">\n";
+ $tmpxml .= " <settings>\n";
+ $tmpxml .= " <param name=\"listen-ip\" value=\"". $config['interfaces']['lan']['ipaddr'] ."\"/>\n";
+ $tmpxml .= " <param name=\"listen-port\" value=\"" . $rowhelper['event_socket_port'] . "\"/>\n";
+ $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['event_socket_password'] . "\"/>\n";
+ $tmpxml .= " <!--<param name=\"apply-inbound-acl\" value=\"lan\"/>-->\n";
+ $tmpxml .= " </settings>\n";
+ $tmpxml .= "</configuration>";
+ fwrite($fout, $tmpxml);
+ unset($tmpxml, $event_socket_password);
+ fclose($fout);
+
+ $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/xml_rpc.conf","w");
+ $tmpxml = "<configuration name=\"xml_rpc.conf\" description=\"XML RPC\">\n";
+ $tmpxml .= " <settings>\n";
+ $tmpxml .= " <!-- The port where you want to run the http service (default 8080) -->\n";
+ $tmpxml .= " <param name=\"http-port\" value=\"" . $rowhelper['xml_rpc_http_port'] . "\"/>\n";
+ $tmpxml .= " <!-- if all 3 of the following params exist all http traffic will require auth -->\n";
+ $tmpxml .= " <param name=\"auth-realm\" value=\"" . $rowhelper['xml_rpc_auth_realm'] . "\"/>\n";
+ $tmpxml .= " <param name=\"auth-user\" value=\"" . $rowhelper['xml_rpc_auth_user'] . "\"/>\n";
+ $tmpxml .= " <param name=\"auth-pass\" value=\"" . $rowhelper['xml_rpc_auth_pass'] . "\"/>\n";
+ $tmpxml .= " </settings>\n";
+ $tmpxml .= "</configuration>\n";
+ fwrite($fout, $tmpxml);
+ unset($tmpxml, $event_socket_password);
+ fclose($fout);
+
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+ }
+}
+
+
+function sync_package_freeswitch_dialplan()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchdialplan']['config'][0]['dialplan_default_xml']) == 0) {
+ /* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/dialplan/default.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchdialplan']['config'][0]['dialplan_default_xml'] = base64_encode($tmpxml);
+ unset($filename, $dialplan);
+ fclose($fout);
+ }
+ else {
+ /* found the dialplan in the pfsense config.xml save it to default.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/dialplan/default.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchdialplan']['config'][0]['dialplan_default_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+
+function sync_package_freeswitch_extensions()
+{
+ global $config;
+
+ if($config['installedpackages']['freeswitchextensions']['config'] != "") {
+
+ conf_mount_rw();
+ config_unlock();
+
+ /* delete all old extensions to prepare for new ones */
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/1*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/2*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/3*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/4*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/5*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/6*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/7*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/8*.xml");
+ unlink_if_exists("/usr/local/freeswitch/conf/directory/default/9*.xml");
+
+ foreach($config['installedpackages']['freeswitchextensions']['config'] as $rowhelper) {
+
+ $fout = fopen("/usr/local/freeswitch/conf/directory/default/".$rowhelper['extension'].".xml","w");
+
+ $tmpxml = "<include>\n";
+ $tmpxml .= " <user id=\"" . $rowhelper['extension'] . "\" mailbox=\"" . $rowhelper['mailbox'] . "\">\n";
+ $tmpxml .= " <params>\n";
+ $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n";
+ $tmpxml .= " <param name=\"vm-password\" value=\"" . $rowhelper['vm-password'] . "\"/>\n";
+ /* Disabled until further testing */
+ /* if (strlen($rowhelper['vm-mailto']) > 0) { */
+ /* $tmpxml .= " <param name=\"vm-email-all-messages\" value=\"true\"/>\n"; */
+ /* $tmpxml .= " <param name=\"vm-attach-file\" value=\"true\"/>\n"; */
+ /* $tmpxml .= " <param name=\"vm-mailto\" value=\"" . $rowhelper['vm-mailto'] . "\"/>\n"; */
+ /* } */
+ /* <field> */
+ /* <fielddescr>Voicemail Mail To</fielddescr> */
+ /* <fieldname>vm-mailto</fieldname> */
+ /* <description>Optional: Enter the email address to send voicemail to.</description> */
+ /* <type>input</type> */
+ /* </field> */
+ $tmpxml .= " </params>>\n";
+ $tmpxml .= " <variables>\n";
+ $tmpxml .= " <variable name=\"toll_allow\" value=\"domestic,international,local\"/>\n";
+ $tmpxml .= " <variable name=\"accountcode\" value=\"" . $rowhelper['accountcode'] . "\"/>\n";
+ $tmpxml .= " <variable name=\"user_context\" value=\"" . $rowhelper['user_context'] . "\"/>\n";
+ if (strlen($rowhelper['effective_caller_id_number']) > 0) {
+ $tmpxml .= " <variable name=\"effective_caller_id_name\" value=\"" . $rowhelper['effective_caller_id_name'] . "\"/>\n";
+ $tmpxml .= " <variable name=\"effective_caller_id_number\" value=\"" . $rowhelper['effective_caller_id_number'] . "\"/>\n";
+ }
+ if (strlen($rowhelper['outbound_caller_id_number']) > 0) {
+ $tmpxml .= " <variable name=\"outbound_caller_id_name\" value=\"" . $rowhelper['outbound_caller_id_name'] . "\"/>\n";
+ $tmpxml .= " <variable name=\"outbound_caller_id_number\" value=\"" . $rowhelper['outbound_caller_id_number'] . "\"/>\n";
+ }
+ $tmpxml .= " </variables>\n";
+ $tmpxml .= " </user>\n";
+ $tmpxml .= "</include>\n";
+ fwrite($fout, $tmpxml);
+ unset($tmpxml);
+ fclose($fout);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+ }
+}
+
+
+function sync_package_freeswitch_gateways()
+{
+ global $config;
+
+ if($config['installedpackages']['freeswitchgateways']['config'] != "") {
+
+ conf_mount_rw();
+ config_unlock();
+
+ /* delete all old gateways to prepare for new ones */
+ unlink_if_exists("/usr/local/freeswitch/conf/sip_profiles/external/*.xml");
+
+ foreach($config['installedpackages']['freeswitchgateways']['config'] as $rowhelper) {
+ $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/external/".$rowhelper['gateway'].".xml","w");
+
+ $tmpxml .= "<include>\n";
+ $tmpxml .= " <gateway name=\"" . $rowhelper['gateway'] . "\">\n";
+ $tmpxml .= " <param name=\"username\" value=\"" . $rowhelper['username'] . "\"/>\n";
+ $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n";
+ $tmpxml .= " <param name=\"from-user\" value=\"" . $rowhelper['from-user'] . "\"/>\n";
+ $tmpxml .= " <param name=\"from-domain\" value=\"" . $rowhelper['from-domain'] . "\"/>\n";
+ $tmpxml .= " <param name=\"proxy\" value=\"" . $rowhelper['proxy'] . "\"/>\n";
+ $tmpxml .= " <param name=\"expire-seconds\" value=\"" . $rowhelper['expire-seconds'] . "\"/>\n";
+ $tmpxml .= " <param name=\"register\" value=\"" . $rowhelper['register'] . "\"/>\n";
+ $tmpxml .= " <param name=\"retry_seconds\" value=\"" . $rowhelper['retry_seconds'] . "\"/>\n";
+ $tmpxml .= " <param name=\"extension\" value=\"" . $rowhelper['extension'] . "\"/>\n";
+ $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n";
+ $tmpxml .= " </gateway>\n";
+ $tmpxml .= "</include>";
+
+ fwrite($fout, $tmpxml);
+ unset($tmpxml);
+ fclose($fout);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+ }
+
+}
+
+
+function sync_package_freeswitch_modules()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml']) == 0) {
+ /* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml'] = base64_encode($tmpxml);
+ unset($filename, $dialplan);
+ fclose($fout);
+ }
+ else {
+ /* found the dialplan in the pfsense config.xml save it to default.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+
+function sync_package_freeswitch_public()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchpublic']['config'][0]['public_xml']) == 0) {
+ /* dialplan_public_xml not found in the pfsense config.xml get the default public.xml and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/dialplan/public/00_inbound_did.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchpublic']['config'][0]['public_xml'] = base64_encode($tmpxml);
+ unset($filename, $tmpxml);
+ fclose($fout);
+ }
+ else {
+ /* found dialplan_public_xml in the pfsense config.xml save it to public.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/dialplan/public/00_inbound_did.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchpublic']['config'][0]['public_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+
+function sync_package_freeswitch_vars()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchvars']['config'][0]['vars_xml']) == 0) {
+ /* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/vars.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchvars']['config'][0]['vars_xml'] = base64_encode($tmpxml);
+ unset($filename, $dialplan);
+ fclose($fout);
+ }
+ else {
+ /* found the dialplan in the pfsense config.xml save it to default.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/vars.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchvars']['config'][0]['vars_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+function sync_package_freeswitch_internal()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchinternal']['config'][0]['internal_xml']) == 0) {
+ /* internal_xml not found in the pfsense config.xml get the internal.xml and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/sip_profiles/internal.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchinternal']['config'][0]['internal_xml'] = base64_encode($tmpxml);
+ unset($filename, $dialplan);
+ fclose($fout);
+ }
+ else {
+ /* found the internal_xml in the pfsense config.xml save it to internal.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/internal.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchinternal']['config'][0]['internal_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+function sync_package_freeswitch_external()
+{
+ global $config;
+ conf_mount_rw();
+ config_unlock();
+
+ if(strlen($config['installedpackages']['freeswitchexternal']['config'][0]['external_xml']) == 0) {
+ /* external_xml not found in the pfsense config.xml get the external.xml and save to config.xml. */
+ $filename = "/usr/local/freeswitch/conf/sip_profiles/external.xml";
+ $fout = fopen($filename,"r");
+ $tmpxml = fread($fout, filesize($filename));
+ $config['installedpackages']['freeswitchexternal']['config'][0]['external_xml'] = base64_encode($tmpxml);
+ unset($filename, $dialplan);
+ fclose($fout);
+ }
+ else {
+ /* found the external_xml in the pfsense config.xml save it to external.xml. */
+ $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/external.xml","w");
+ $tmpxml = $config['installedpackages']['freeswitchexternal']['config'][0]['external_xml'];
+ fwrite($fout, base64_decode($tmpxml));
+ fclose($fout);
+ unset($tmpxml);
+ }
+
+ conf_mount_ro();
+ event_socket_request_reloadxml();
+
+}
+
+function sync_package_freeswitch()
+{
+ global $config;
+ sync_package_freeswitch_settings();
+ sync_package_freeswitch_dialplan();
+ sync_package_freeswitch_extensions();
+ sync_package_freeswitch_gateways();
+ sync_package_freeswitch_modules();
+ sync_package_freeswitch_public();
+ sync_package_freeswitch_vars();
+ sync_package_freeswitch_internal();
+ sync_package_freeswitch_external();
+
+}
+
+
+function freeswitch_php_install_command()
+{
+
+ global $config;
+ conf_mount_rw();
+ config_lock();
+
+ if (!is_dir('/usr/local/www/freeswitch/')) {
+ exec("mkdir /usr/local/www/freeswitch/");
+ }
+ exec("cp /tmp/freeswitch_status.tmp /usr/local/www/freeswitch/freeswitch_status.php");
+ unlink_if_exists("/tmp/freeswitch_status.tmp");
+
+ exec("tar zxvf /tmp/freeswitch.tgz -C /usr/local/");
+ unlink_if_exists("/tmp/freeswitch.tgz");
+
+ /* set default numbering_plan */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan'] = "US";
+ }
+
+ /* set default event_socket_password */
+ if(strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'] = "ClueCon";
+ }
+
+ /* set default event_socket_port */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'] = "8021";
+ }
+
+ /* set default xml_rpc_http_port */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port'] = "8787";
+ }
+
+ /* set default xml_rpc_auth_realm */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm'] = "freeswitch";
+ }
+
+ /* set default xml_rpc_auth_user */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user'] = "freeswitch";
+ }
+
+ /* set default xml_rpc_auth_pass */
+ if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass']) == 0) {
+ $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass'] = "works";
+ }
+
+ $numbering_plan = $config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan'];
+ $event_socket_password = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'];
+ $event_socket_port = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'];
+ $xml_rpc_http_port = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port'];
+ $xml_rpc_auth_realm = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm'];
+ $xml_rpc_auth_user = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user'];
+ $xml_rpc_auth_pass = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass'];
+
+ $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml","w");
+ $tmpxml = "<configuration name=\"event_socket.conf\" description=\"Socket Client\">\n";
+ $tmpxml .= " <settings>\n";
+ $tmpxml .= " <param name=\"listen-ip\" value=\"". $config['interfaces']['lan']['ipaddr'] ."\"/>\n";
+ $tmpxml .= " <param name=\"listen-port\" value=\"". $event_socket_port ."\"/>\n";
+ $tmpxml .= " <param name=\"password\" value=\"". $event_socket_password ."\"/>\n";
+ $tmpxml .= " <!--<param name=\"apply-inbound-acl\" value=\"lan\"/>-->\n";
+ $tmpxml .= " </settings>\n";
+ $tmpxml .= "</configuration>";
+ fwrite($fout, $tmpxml);
+ unset($tmpxml);
+ fclose($fout);
+
+ write_rcfile(array(
+ "file" => "freeswitch.sh",
+ "start" => "/usr/local/freeswitch/bin/./freeswitch -nc",
+ "stop" => "/usr/local/freeswitch/bin/./freeswitch -stop"
+ )
+ );
+
+ sync_package_freeswitch();
+ $handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r");
+ pclose($handle);
+
+ $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = "1.0.1 revision 9759.";
+ $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.1";
+ conf_mount_ro();
+ config_unlock();
+
+}
+
+
+function freeswitch_deinstall_command()
+{
+ conf_mount_rw();
+ config_lock();
+ exec("killall -9 freeswitch");
+ unlink_if_exists("/usr/local/pkg/freeswitch.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch.inc");
+ unlink_if_exists("/usr/local/pkg/freeswitch_dialplan.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_extensions.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_external.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_gateways.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_internal.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_modules.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_public.xml");
+ unlink_if_exists("/usr/local/pkg/freeswitch_vars.xml");
+ unlink_if_exists("/usr/local/www/freeswitch/freeswitch_status.xml");
+ exec("rm -R /usr/local/freeswitch/");
+ exec("rm -R /usr/local/www/freeswitch/");
+ unlink_if_exists("/usr/local/etc/rc.d/freeswitch.sh");
+ unlink_if_exists("/tmp/freeswitch.tar.gz");
+ unlink_if_exists("/tmp/pkg_mgr_FreeSWITCH.log");
+ conf_mount_ro();
+ config_unlock();
+}
+
+
+
+
+?> \ No newline at end of file
diff --git a/packages/freeswitch/freeswitch.xml b/packages/freeswitch/freeswitch.xml
new file mode 100644
index 00000000..493acd14
--- /dev/null
+++ b/packages/freeswitch/freeswitch.xml
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ freeswitch.xml
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>FreeSWITCH Settings</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Settings</title>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <menu>
+ <name>FreeSWITCH</name>
+ <tooltiptext>Modify FreeSWITCH settings.</tooltiptext>
+ <section>Services</section>
+ <configfile>freeswitch.xml</configfile>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </menu>
+ <service>
+ <name>freeswitch</name>
+ <rcfile>freeswitch.sh</rcfile>
+ <executable>freeswitch</executable>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. </description>
+ </service>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchsettings</configpath>
+ <additional_files_needed>
+ <prefix>/tmp/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch.tgz</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/tmp/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_status.tmp</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_external.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_gateways.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_internal.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_modules.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_public.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch_vars.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/freeswitch.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/lib/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/libtinfo.so.5.6</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/lib/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/freeswitch/libncurses.so.5.6</item>
+ </additional_files_needed>
+ <fields>
+ <field>
+ <fielddescr>Numbering Plan</fielddescr>
+ <fieldname>numbering_plan</fieldname>
+ <description>Enter the numbering plan here. example: US</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Default Gateway</fielddescr>
+ <fieldname>default_gateway</fieldname>
+ <description>Enter the default gateway name here. example: asterlink.com</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Default Area Code</fielddescr>
+ <fieldname>default_area_code</fieldname>
+ <description>Enter the area code here. example: 918</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Event Socket Port</fielddescr>
+ <fieldname>event_socket_port</fieldname>
+ <description>Enter the event socket port here. default: 8021</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Event Socket Password</fielddescr>
+ <fieldname>event_socket_password</fieldname>
+ <description>Enter the event socket password here. default: ClueCon</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>XML RPC HTTP Port</fielddescr>
+ <fieldname>xml_rpc_http_port</fieldname>
+ <description>Enter the XML RPC HTTP Port here. default: 8787</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>XML RPC Auth Realm</fielddescr>
+ <fieldname>xml_rpc_auth_realm</fieldname>
+ <description>Enter the XML RPC Auth Realm here. default: freeswitch</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>XML RPC Auth User</fielddescr>
+ <fieldname>xml_rpc_auth_user</fieldname>
+ <description>Enter the XML RPC Auth User here. default: freeswitch</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>XML RPC Auth Password</fielddescr>
+ <fieldname>xml_rpc_auth_pass</fieldname>
+ <description>Enter the XML RPC Auth Password here. default: works</description>
+ <type>input</type>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_add_php_command>
+ sync_package_freeswitch();
+ </custom_add_php_command>
+ <custom_delete_php_command>
+ sync_package_freeswitch();
+ </custom_delete_php_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch();
+ </custom_php_resync_config_command>
+ <custom_php_install_command>
+ freeswitch_php_install_command();
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ freeswitch_deinstall_command();
+ </custom_php_deinstall_command>
+</packagegui> \ No newline at end of file
diff --git a/packages/freeswitch/freeswitch_dialplan.xml b/packages/freeswitch/freeswitch_dialplan.xml
new file mode 100644
index 00000000..5559c3b6
--- /dev/null
+++ b/packages/freeswitch/freeswitch_dialplan.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ freeswitch_dialplan.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchdialplan</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Dialplan</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchdialplan</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;Default Dialplan&lt;/b&gt; &lt;br /&gt; &lt;br /&gt; The default dialplan is used to setup call destinations based on conditions and context. You can use the dialplan to send calls to gateways, IVRs, external numbers, to scripts, or any destination. </fielddescr>
+ <fieldname>dialplan_default_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/dialplan/default.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_dialplan();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_dialplan();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_extensions.xml b/packages/freeswitch/freeswitch_extensions.xml
new file mode 100644
index 00000000..635bf309
--- /dev/null
+++ b/packages/freeswitch/freeswitch_extensions.xml
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+
+ freeswitch_extensions.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchextensions</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Extensions</title>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->extensions</configpath>
+ <adddeleteeditpagefields>
+ <columnitem>
+ <fielddescr>Extension</fielddescr>
+ <fieldname>extension</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Mailbox</fielddescr>
+ <fieldname>mailbox</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ </columnitem>
+ </adddeleteeditpagefields>
+ <fields>
+ <field>
+ <fielddescr>Extension</fielddescr>
+ <fieldname>extension</fieldname>
+ <description>Enter the extension here. The default configuration expects extension numbers between 1001 -1019. To use additional numbers for the extensions by adjusting the dialplan. In the in the dialplan under name="Local_Extension" adjust the regular expression="^(10[01][0-9])$".</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Enter the password here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Mailbox</fielddescr>
+ <fieldname>mailbox</fieldname>
+ <description>Enter the mailbox here. Example: extension 1001 then mailbox 1001</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Voicemail Password</fielddescr>
+ <fieldname>vm-password</fieldname>
+ <description>Enter the voicemail password here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Account Code</fielddescr>
+ <fieldname>accountcode</fieldname>
+ <description>Enter the account code here. Example: extension 1001 then accountcode 1001</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Effective Caller ID Name</fielddescr>
+ <fieldname>effective_caller_id_name</fieldname>
+ <description>Enter the effective caller id name here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Effective Caller ID Number</fielddescr>
+ <fieldname>effective_caller_id_number</fieldname>
+ <description>Enter the effective caller id number here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Outbound Caller ID Name</fielddescr>
+ <fieldname>outbound_caller_id_name</fieldname>
+ <description>Enter the outbound caller id name here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Outbound Caller ID Number</fielddescr>
+ <fieldname>outbound_caller_id_number</fieldname>
+ <description>Enter the outbound caller id number here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>User Context</fielddescr>
+ <fieldname>user_context</fieldname>
+ <description>Enter the user context here. Example: default</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Extension Description</fielddescr>
+ <fieldname>description</fieldname>
+ <description>Enter the description of the extension here.</description>
+ <type>input</type>
+ </field>
+ </fields>
+ <custom_add_php_command>
+ </custom_add_php_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_extensions();
+ </custom_php_resync_config_command>
+ <custom_delete_php_command>
+ sync_package_freeswitch_extensions();
+ </custom_delete_php_command>
+ <custom_php_deinstall_command>
+ </custom_php_deinstall_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_external.xml b/packages/freeswitch/freeswitch_external.xml
new file mode 100644
index 00000000..9e4a733d
--- /dev/null
+++ b/packages/freeswitch/freeswitch_external.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+
+ freeswitch_external.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchexternal</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: External</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchexternal</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;External&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;SIP external profile for outbound registrations.</fielddescr>
+ <fieldname>external_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/sip_profiles/external.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_external();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_external();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_gateways.xml b/packages/freeswitch/freeswitch_gateways.xml
new file mode 100644
index 00000000..0975eccb
--- /dev/null
+++ b/packages/freeswitch/freeswitch_gateways.xml
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+
+ freeswitch_gateways.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchgateways</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Gateways</title>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->gateways</configpath>
+ <adddeleteeditpagefields>
+ <columnitem>
+ <fielddescr>Gateway</fielddescr>
+ <fieldname>gateway</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Context</fielddescr>
+ <fieldname>context</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ </columnitem>
+ </adddeleteeditpagefields>
+ <fields>
+ <field>
+ <fielddescr>Gateway</fielddescr>
+ <fieldname>gateway</fieldname>
+ <description>Enter the gateway name here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>Username</fielddescr>
+ <fieldname>username</fieldname>
+ <description>Enter the username here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Enter the password here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>From-user</fielddescr>
+ <fieldname>from-user</fieldname>
+ <description>Enter the from-user here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>From-domain</fielddescr>
+ <fieldname>from-domain</fieldname>
+ <description>Enter the from-domain here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>Proxy</fielddescr>
+ <fieldname>proxy</fieldname>
+ <description>Enter the proxy here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>Expire-seconds</fielddescr>
+ <fieldname>expire-seconds</fieldname>
+ <description>Enter the expire-seconds here. Example: 600</description>
+ <type>input</type>
+ <value>600</value>
+ </field>
+ <field>
+ <fielddescr>Register</fielddescr>
+ <fieldname>register</fieldname>
+ <description>Choose whether to register.</description>
+ <type>select</type>
+ <options>
+ <option>
+ <name>True</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>False</name>
+ <value>false</value>
+ </option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Retry_seconds</fielddescr>
+ <fieldname>retry_seconds</fieldname>
+ <description>Enter the retry_seconds here. Example: 30</description>
+ <type>input</type>
+ <value>30</value>
+ </field>
+ <field>
+ <fielddescr>Extension</fielddescr>
+ <fieldname>extension</fieldname>
+ <description>Enter the extension here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ <field>
+ <fielddescr>Context</fielddescr>
+ <fieldname>context</fieldname>
+ <description>Enter the context here. Example: public</description>
+ <type>input</type>
+ <value>public</value>
+ </field>
+ <field>
+ <fielddescr>Gateway Description</fielddescr>
+ <fieldname>description</fieldname>
+ <description>Enter the description of the gateway here.</description>
+ <type>input</type>
+ <value></value>
+ </field>
+ </fields>
+ <custom_add_php_command>
+ </custom_add_php_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_gateways();
+ </custom_php_resync_config_command>
+ <custom_delete_php_command>
+ sync_package_freeswitch_gateways();
+ </custom_delete_php_command>
+ <custom_php_deinstall_command>
+ </custom_php_deinstall_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_internal.xml b/packages/freeswitch/freeswitch_internal.xml
new file mode 100644
index 00000000..12d828a5
--- /dev/null
+++ b/packages/freeswitch/freeswitch_internal.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+
+ freeswitch_internal.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchinternal</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Internal</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchinternal</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;Internal&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;SIP internal profile. </fielddescr>
+ <fieldname>internal_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/sip_profiles/internal.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_internal();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_internal();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_modules.xml b/packages/freeswitch/freeswitch_modules.xml
new file mode 100644
index 00000000..ac7635a0
--- /dev/null
+++ b/packages/freeswitch/freeswitch_modules.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ freeswitch_modules.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchmodules</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Modules</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchmodules</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;Modules&lt;/b&gt; &lt;br /&gt; &lt;br /&gt; Modules add additional features to FreeSwitch. modules.conf.xml file allows you to enable or disable certain modules. Some modules have additional dependencies. Please see wiki.freeswith.org for more details. </fielddescr>
+ <fieldname>modules_conf_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_modules();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_modules();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_public.xml b/packages/freeswitch/freeswitch_public.xml
new file mode 100644
index 00000000..fd30ae4e
--- /dev/null
+++ b/packages/freeswitch/freeswitch_public.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ freeswitch_public.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchpublic</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Public</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchpublic</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;Public&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;Directs inbound calls to extensions, IVRs, external numbers, and scripts. </fielddescr>
+ <fieldname>public_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/dialplan/public/00_inbound_did.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_public();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_public();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/freeswitch_status.tmp b/packages/freeswitch/freeswitch_status.tmp
new file mode 100644
index 00000000..dcdeede3
--- /dev/null
+++ b/packages/freeswitch/freeswitch_status.tmp
@@ -0,0 +1,225 @@
+<?php
+/* $Id$ */
+/*
+ tinydns_view_logs.php
+ part of pfSense (http://www.pfsense.com/)
+
+ Copyright (C) 2006 Scott Ullrich <sullrich@gmail.com>
+ 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");
+
+/* Defaults to this page but if no settings are present, redirect to setup page */
+//if(!$config['installedpackages']['tinydns']['config'][0]) {
+// Header("Location: /pkg_edit.php?xml=tinydns.xml&id=0");
+//}
+
+function event_socket_create($host, $port, $password) {
+ $fp = fsockopen($host, $port, $errno, $errdesc)
+ or die("Connection to $host failed");
+ socket_set_blocking($fp,false);
+
+ if ($fp) {
+ while (!feof($fp)) {
+ $buffer = fgets($fp, 1024);
+ usleep(100); //allow time for reponse
+ if (trim($buffer) == "Content-Type: auth/request") {
+ fputs($fp, "auth $password\n\n");
+ break;
+ }
+ }
+ return $fp;
+ }
+ else {
+ return false;
+ }
+}
+
+
+function event_socket_request($fp, $cmd) {
+
+ if ($fp) {
+ fputs($fp, $cmd."\n\n");
+ usleep(100); //allow time for reponse
+
+ $response = "";
+ $i = 0;
+ $contentlength = 0;
+ while (!feof($fp)) {
+ $buffer = fgets($fp, 4096);
+ if ($contentlength > 0) {
+ $response .= $buffer;
+ }
+
+ if ($contentlength == 0) { //if contentlenght is already don't process again
+ if (strlen(trim($buffer)) > 0) { //run only if buffer has content
+ $temparray = split(":", trim($buffer));
+ if ($temparray[0] == "Content-Length") {
+ $contentlength = trim($temparray[1]);
+ }
+ }
+ }
+
+ usleep(100); //allow time for reponse
+
+ //optional because of script timeout //don't let while loop become endless
+ if ($i > 10000) { break; }
+
+ if ($contentlength > 0) { //is contentlength set
+ //stop reading if all content has been read.
+ if (strlen($response) >= $contentlength) {
+ break;
+ }
+ }
+ $i++;
+ }
+
+ return $response;
+ }
+ else {
+ echo "no handle";
+ }
+}
+
+
+$pgtitle = "FreeSWITCH: Status";
+include("head.inc");
+
+$password = "ClueCon";
+$port = "8021";
+$host = "192.168.1.1";
+
+
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle"><?=$pgtitle?></font></p>
+<?php if ($savemsg) print_info_box($savemsg); ?>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<?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, "/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0");
+ $tab_array[] = array(gettext("Extensions"), false, "/pkg.php?xml=freeswitch_extensions.xml");
+ $tab_array[] = array(gettext("External"), false, "/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0");
+ $tab_array[] = array(gettext("Gateways"), false, "/pkg.php?xml=freeswitch_gateways.xml");
+ $tab_array[] = array(gettext("Internal"), false, "/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0");
+ $tab_array[] = array(gettext("Modules"), false, "/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0");
+ $tab_array[] = array(gettext("Public"), false, "/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0");
+ $tab_array[] = array(gettext("Status"), true, "/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);
+
+?>
+</table>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+<?php
+
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api sofia status";
+$response = event_socket_request($fp, $cmd);
+echo "<b>sofia status</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+fclose($fp);
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api sofia status profile internal";
+$response = event_socket_request($fp, $cmd);
+echo "<b>sofia status profile internal</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+fclose($fp);
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api sofia status profile external";
+$response = event_socket_request($fp, $cmd);
+echo "<b>sofia status profile external</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+fclose($fp);
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api status";
+$response = event_socket_request($fp, $cmd);
+echo "<b>status</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+fclose($fp);
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api show channels";
+$response = event_socket_request($fp, $cmd);
+echo "<b>show channels</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+/*
+$response = "<table border='0'><tr><td>".$response;
+$response = str_replace("\n", "</td></tr>\n<tr><td>", $response);
+$response = str_replace(",", "</td><td>", $response);
+$response = $response."</td></tr>\n<table>\n";
+echo $response;
+*/
+fclose($fp);
+echo "<br /><br />\n\n";
+
+$fp = event_socket_create($host, $port, $password);
+$cmd = "api show calls";
+$response = event_socket_request($fp, $cmd);
+echo "<b>show calls</b><br />\n";
+echo "<pre style=\"font-size: 9pt;\">\n";
+echo $response;
+echo "</pre>\n";
+fclose($fp);
+echo "<br /><br />\n\n";
+
+?>
+
+ </td>
+ </tr>
+</table>
+
+</div>
+<?php include("fend.inc"); ?>
+<meta http-equiv="refresh" content="60;url=<?php print $_SERVER['SCRIPT_NAME']; ?>">
+</body>
+</html>
diff --git a/packages/freeswitch/freeswitch_vars.xml b/packages/freeswitch/freeswitch_vars.xml
new file mode 100644
index 00000000..47f97401
--- /dev/null
+++ b/packages/freeswitch/freeswitch_vars.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+
+ freeswitch_vars.xml
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2007 to whom it may belong
+ All rights reserved.
+
+ Based on m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+ 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.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>freeswitchvars</name>
+ <version>0.1</version>
+ <title>FreeSWITCH: Vars</title>
+ <aftersaveredirect>pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/freeswitch.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Dialplan</text>
+ <url>/pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Extensions</text>
+ <url>/pkg.php?xml=freeswitch_extensions.xml</url>
+ </tab>
+ <tab>
+ <text>External</text>
+ <url>/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Gateways</text>
+ <url>/pkg.php?xml=freeswitch_gateways.xml</url>
+ </tab>
+ <tab>
+ <text>Internal</text>
+ <url>/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Modules</text>
+ <url>/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Public</text>
+ <url>/pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Status</text>
+ <url>/freeswitch/freeswitch_status.php</url>
+ </tab>
+ <tab>
+ <text>Vars</text>
+ <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->freeswitchvars</configpath>
+ <fields>
+ <field>
+ <fielddescr>&lt;b&gt;Vars&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;Define preprocessor variables here. Can be accessed in the xml configation with $${var_name}.</fielddescr>
+ <fieldname>vars_xml</fieldname>
+ <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/vars.xml &lt;br /&gt;&lt;br /&gt;</description>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <wrap>off</wrap>
+ <size>30</size>
+ <cols>70</cols>
+ <rows>33</rows>
+ </field>
+ </fields>
+ <custom_php_command_before_form>
+ </custom_php_command_before_form>
+ <custom_php_after_head_command>
+ sync_package_freeswitch_vars();
+ </custom_php_after_head_command>
+ <custom_php_after_form_command>
+ </custom_php_after_form_command>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_freeswitch_vars();
+ </custom_php_resync_config_command>
+</packagegui>
+
diff --git a/packages/freeswitch/libncurses.so.5.6 b/packages/freeswitch/libncurses.so.5.6
new file mode 100644
index 00000000..3b40374c
--- /dev/null
+++ b/packages/freeswitch/libncurses.so.5.6
Binary files differ
diff --git a/packages/freeswitch/libtinfo.so.5.6 b/packages/freeswitch/libtinfo.so.5.6
new file mode 100644
index 00000000..1263ec79
--- /dev/null
+++ b/packages/freeswitch/libtinfo.so.5.6
Binary files differ