aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch/freeswitch_recordings_edit.tmp
diff options
context:
space:
mode:
Diffstat (limited to 'config/freeswitch/freeswitch_recordings_edit.tmp')
-rw-r--r--config/freeswitch/freeswitch_recordings_edit.tmp186
1 files changed, 186 insertions, 0 deletions
diff --git a/config/freeswitch/freeswitch_recordings_edit.tmp b/config/freeswitch/freeswitch_recordings_edit.tmp
new file mode 100644
index 00000000..18612b93
--- /dev/null
+++ b/config/freeswitch/freeswitch_recordings_edit.tmp
@@ -0,0 +1,186 @@
+<?php
+/* $Id$ */
+/*
+
+ freeswitch_recordings_edit.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+require("/usr/local/pkg/freeswitch.inc");
+
+
+$a_recordings = &$config['installedpackages']['freeswitchrecordings']['config'];
+
+
+$id = $_GET['id'];
+if (isset($_POST['id'])) {
+ $id = $_POST['id'];
+}
+
+if (isset($id) && $a_recordings[$id]) {
+ $pconfig['filename'] = $a_recordings[$id]['filename'];
+ $pconfig['recordingname'] = $a_recordings[$id]['recordingname'];
+ $pconfig['recordingid'] = $a_recordings[$id]['recordingid'];
+ $pconfig['descr'] = $a_recordings[$id]['descr'];
+}
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+
+ if (!$input_errors) {
+
+
+ $recordingent = array();
+ $recordingent['recordingname'] = $_POST['recordingname'];
+ $recordingent['descr'] = $_POST['descr'];
+
+
+ if (isset($id) && $a_recordings[$id]) {
+ //update
+ if (strlen($_POST['recordingid']) > 0) {
+ $recordingent['recordingid'] = $_POST['recordingid'];
+ }
+ else {
+ $recordingent['recordingid'] = guid();
+ }
+
+ $recordingent['filename'] = $_POST['filename'];
+
+ //if file name is not the same then rename the file
+ if ($_POST['filename'] != $_POST['filename_orig']) {
+ rename('/usr/local/freeswitch/recordings/'.$_POST['filename_orig'], '/usr/local/freeswitch/recordings/'.$_POST['filename']);
+ }
+ $a_recordings[$id] = $recordingent;
+ }
+ else {
+ //add
+ $recordingent['filename'] = $_POST['filename'];
+ $a_recordings[] = $recordingent;
+ }
+
+ write_config();
+
+ header("Location: freeswitch_recordings.php");
+ exit;
+ }
+}
+
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Recordings: Edit</p>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
+ $tab_array[] = array(gettext("Dialplan"), false, "/freeswitch/freeswitch_dialplan_includes.php");
+ $tab_array[] = array(gettext("Extensions"), false, "/freeswitch/freeswitch_extensions.php");
+ $tab_array[] = array(gettext("External"), false, "/pkg_edit.php?xml=freeswitch_external.xml&amp;id=0");
+ $tab_array[] = array(gettext("Gateways"), false, "/freeswitch/freeswitch_gateways.php");
+ $tab_array[] = array(gettext("Internal"), false, "/pkg_edit.php?xml=freeswitch_internal.xml&amp;id=0");
+ $tab_array[] = array(gettext("IVR"), false, "/freeswitch/freeswitch_ivr.php");
+ $tab_array[] = array(gettext("Modules"), false, "/pkg_edit.php?xml=freeswitch_modules.xml&amp;id=0");
+ $tab_array[] = array(gettext("Public"), false, "/freeswitch/freeswitch_public_includes.php");
+ $tab_array[] = array(gettext("Rec"), true, "/freeswitch/freeswitch_recordings.php");
+ $tab_array[] = array(gettext("Status"), false, "/freeswitch/freeswitch_status.php");
+ $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
+ display_top_tabs($tab_array);
+
+?>
+</td></tr>
+</table>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+ <form action="freeswitch_recordings_edit.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Filename</td>
+ <td width="78%" class="vtable">
+ <input name="filename" type="text" class="formfld" id="filename" size="40" value="<?=htmlspecialchars($pconfig['filename']);?>">
+ <br> <span class="vexpl">Name of the file<br>
+ e.g. <em>example.wav</em></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Recording Name</td>
+ <td width="78%" class="vtable">
+ <input name="recordingname" type="text" class="formfld" id="recordingname" size="40" value="<?=htmlspecialchars($pconfig['recordingname']);?>">
+ <br> <span class="vexpl">Recording Name<br>
+ e.g. <em>recordingx</em></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Description</td>
+ <td width="78%" class="vtable">
+ <input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
+ <br> <span class="vexpl">You may enter a description here
+ for your reference (not parsed).</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
+ <?php if (isset($id) && $a_recordings[$id]): ?>
+ <input name="filename_orig" type="hidden" value="<?=htmlspecialchars($pconfig['filename']);?>">
+ <input name="id" type="hidden" value="<?=$id;?>">
+ <input name="recordingid" type="hidden" value="<?=htmlspecialchars($pconfig['recordingid']);?>">
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
+ </form>
+
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+
+ </td>
+ </tr>
+</table>
+
+</div>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>