aboutsummaryrefslogtreecommitdiffstats
path: root/packages/freeswitch
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-12-31 01:25:36 +0000
committerMark Crane <mcrane@pfsense.org>2008-12-31 01:25:36 +0000
commit18967860d5f1a38f02f34cf2d790d6dfd1b1a99d (patch)
tree09353d8f468c9ba8433fa84767d7973c17330f36 /packages/freeswitch
parent955b31a1f0b5cd40c80cec9b8e4ae436820621a0 (diff)
downloadpfsense-packages-18967860d5f1a38f02f34cf2d790d6dfd1b1a99d.tar.gz
pfsense-packages-18967860d5f1a38f02f34cf2d790d6dfd1b1a99d.tar.bz2
pfsense-packages-18967860d5f1a38f02f34cf2d790d6dfd1b1a99d.zip
FreeSWITCH package add music on hold to rec tab add upload for rec and moh, add acl, cidr, and callgroup to extensions.
Diffstat (limited to 'packages/freeswitch')
-rw-r--r--packages/freeswitch/freeswitch.inc24
-rw-r--r--packages/freeswitch/freeswitch.xml2
-rw-r--r--packages/freeswitch/freeswitch_extensions.tmp4
-rw-r--r--packages/freeswitch/freeswitch_extensions_edit.tmp60
-rw-r--r--packages/freeswitch/freeswitch_recordings.tmp279
-rw-r--r--packages/freeswitch/freeswitch_recordings_play.tmp19
6 files changed, 326 insertions, 62 deletions
diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc
index 8b92536a..cca8e0c1 100644
--- a/packages/freeswitch/freeswitch.inc
+++ b/packages/freeswitch/freeswitch.inc
@@ -177,6 +177,16 @@ function event_socket_request_cmd($cmd)
}
+function byte_convert( $bytes ) {
+
+ if ($bytes<=0)
+ return '0 Byte';
+
+ $convention=1000; //[1000->10^x|1024->2^x]
+ $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
+ $e=floor(log($bytes,$convention));
+ return round($bytes/pow($convention,$e),2).' '.$s[$e];
+}
function recording_js()
{
@@ -401,7 +411,12 @@ function sync_package_freeswitch_extensions()
$fout = fopen("/usr/local/freeswitch/conf/directory/default/".$rowhelper['extension'].".xml","w");
$tmpxml = "<include>\n";
- $tmpxml .= " <user id=\"" . $rowhelper['extension'] . "\" mailbox=\"" . $rowhelper['mailbox'] . "\">\n";
+ if (strlen($rowhelper['cidr']) == 0) {
+ $tmpxml .= " <user id=\"" . $rowhelper['extension'] . "\" mailbox=\"" . $rowhelper['mailbox'] . "\">\n";
+ }
+ else {
+ $tmpxml .= " <user id=\"" . $rowhelper['extension'] . "\" mailbox=\"" . $rowhelper['mailbox'] . "\" cidr=\"" . $rowhelper['cidr'] . "\">\n";
+ }
$tmpxml .= " <params>\n";
$tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n";
$tmpxml .= " <param name=\"vm-password\" value=\"" . $rowhelper['vm-password'] . "\"/>\n";
@@ -420,7 +435,10 @@ function sync_package_freeswitch_extensions()
}
$tmpxml .= " <param name=\"vm-mailto\" value=\"" . $rowhelper['vm-mailto'] . "\"/>\n";
- }
+ }
+ if (strlen($rowhelper['auth-acl']) > 0) {
+ $tmpxml .= " <param name=\"auth-acl\" value=\"" . $rowhelper['auth-acl'] . "\"/>\n";
+ }
$tmpxml .= " </params>\n";
$tmpxml .= " <variables>\n";
$tmpxml .= " <variable name=\"toll_allow\" value=\"domestic,international,local\"/>\n";
@@ -2066,7 +2084,7 @@ function freeswitch_php_install_command()
}
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = "1.0.1 revision 10638.";
- $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.5.7.1";
+ $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.5.8";
conf_mount_ro();
diff --git a/packages/freeswitch/freeswitch.xml b/packages/freeswitch/freeswitch.xml
index e512273e..ba3b2d39 100644
--- a/packages/freeswitch/freeswitch.xml
+++ b/packages/freeswitch/freeswitch.xml
@@ -44,7 +44,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>FreeSWITCH Settings</name>
- <version>0.5.7.2</version>
+ <version>0.5.8</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>
diff --git a/packages/freeswitch/freeswitch_extensions.tmp b/packages/freeswitch/freeswitch_extensions.tmp
index 00131836..ca6f3d73 100644
--- a/packages/freeswitch/freeswitch_extensions.tmp
+++ b/packages/freeswitch/freeswitch_extensions.tmp
@@ -113,7 +113,7 @@ if ($config_change == 1) {
<tr>
<td width="20%" class="listhdrr">Extension</td>
<td width="25%" class="listhdrr">Mail To</td>
- <td width="25%" class="listhdrr">Context</td>
+ <td width="25%" class="listhdrr">Call Group</td>
<td width="25%" class="listhdr">Description</td>
<td width="10%" class="list">
@@ -144,7 +144,7 @@ if ($config_change == 1) {
<?=$ent['vm-mailto'];?>&nbsp;
</td>
<td class="listr" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
- <?=$ent['user_context'];?>&nbsp;
+ <?=$ent['callgroup'];?>&nbsp;
</td>
<td class="listbg" ondblclick="document.location='freeswitch_extensions_edit.php?id=<?=$i;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?>&nbsp;
diff --git a/packages/freeswitch/freeswitch_extensions_edit.tmp b/packages/freeswitch/freeswitch_extensions_edit.tmp
index c5619d19..ae931c49 100644
--- a/packages/freeswitch/freeswitch_extensions_edit.tmp
+++ b/packages/freeswitch/freeswitch_extensions_edit.tmp
@@ -57,6 +57,9 @@ if (isset($id) && $a_extensions[$id]) {
$pconfig['vm-mailto'] = $a_extensions[$id]['vm-mailto'];
$pconfig['vm-attach-file'] = $a_extensions[$id]['vm-attach-file'];
$pconfig['user_context'] = $a_extensions[$id]['user_context'];
+ $pconfig['callgroup'] = $a_extensions[$id]['callgroup'];
+ $pconfig['auth-acl'] = $a_extensions[$id]['auth-acl'];
+ $pconfig['cidr'] = $a_extensions[$id]['cidr'];
$pconfig['description'] = $a_extensions[$id]['description'];
}
@@ -82,6 +85,10 @@ if ($_POST) {
$ent['vm-mailto'] = $_POST['vm-mailto'];
$ent['vm-attach-file'] = $_POST['vm-attach-file'];
$ent['user_context'] = $_POST['user_context'];
+ $ent['callgroup'] = $_POST['callgroup'];
+ $ent['auth-acl'] = $_POST['auth-acl'];
+ $ent['cidr'] = $_POST['cidr'];
+
$ent['description'] = $_POST['description'];
if (isset($id) && $a_extensions[$id]) {
@@ -105,6 +112,15 @@ include("head.inc");
?>
+<script type="text/javascript" language="JavaScript">
+
+function show_advanced_config() {
+ document.getElementById("showadvancedbox").innerHTML='';
+ aodiv = document.getElementById('showadvanced');
+ aodiv.style.display = "block";
+}
+
+</script>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
@@ -248,14 +264,52 @@ include("head.inc");
Choose whether to attach the file to the email.
</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq">User Context</td>
<td width="78%" class="vtable">
<input name="user_context" type="text" class="formfld" id="user_context" size="40" value="<?=htmlspecialchars($pconfig['user_context']);?>">
<br><span class="vexpl">Enter the user context here. Example: default<br></span>
</td>
- </tr>
- <tr>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Call Group</td>
+ <td width="78%" class="vtable">
+ <input name="callgroup" type="text" class="formfld" id="callgroup" size="40" value="<?=htmlspecialchars($pconfig['callgroup']);?>">
+ <br><span class="vexpl">Enter the user call group here. Example: sales<br></span>
+ </td>
+ </tr>
+
+ <div id="showadvancedbox">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncell">Show Advanced</td>
+ <td width="78%" class="vtable">
+ <input type="button" onClick="show_advanced_config()" value="Advanced"></input></a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div id="showadvanced" style="display:none">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncell">Auth-ACL</td>
+ <td width="78%" class="vtable">
+ <input name="auth-acl" type="text" class="formfld" id="auth-acl" size="40" value="<?=htmlspecialchars($pconfig['auth-acl']);?>">
+ <br> <span class="vexpl">Enter the auth acl here.<br></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">CIDR</td>
+ <td width="78%" class="vtable">
+ <input name="cidr" type="text" class="formfld" id="cidr" size="40" value="<?=htmlspecialchars($pconfig['cidr']);?>">
+ <br> <span class="vexpl">Enter the cidr here.<br></span>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <tr>
<td width="22%" valign="top" class="vncellreq">Extension Description</td>
<td width="78%" class="vtable">
<input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>">
diff --git a/packages/freeswitch/freeswitch_recordings.tmp b/packages/freeswitch/freeswitch_recordings.tmp
index 9e2d0446..a56c92a6 100644
--- a/packages/freeswitch/freeswitch_recordings.tmp
+++ b/packages/freeswitch/freeswitch_recordings.tmp
@@ -33,47 +33,112 @@
require("guiconfig.inc");
require("/usr/local/pkg/freeswitch.inc");
-$recording_dir = '/usr/local/freeswitch/recordings/';
+$a_recordings = &$config['installedpackages']['freeswitchrecordings']['config'];
+$dir_recordings = '/usr/local/freeswitch/recordings/';
+$dir_music_on_hold_8000 = '/usr/local/freeswitch/sounds/music/8000/';
+
+if ($_GET['a'] == "download") {
-if (($_GET['a'] == "download") && file_exists($recording_dir.$_GET['filename'])) {
session_cache_limiter('public');
- $fd = fopen($recording_dir.$_GET['filename'], "rb");
- if ($_GET['t'] == "bin") {
- header("Content-Type: application/force-download");
- header("Content-Type: application/octet-stream");
- header("Content-Type: application/download");
- header("Content-Description: File Transfer");
- header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
- }
- else {
- header("Content-Type: audio/x-wav");
- }
- header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- header("Content-Length: " . filesize($recording_dir.$_GET['filename']));
- fpassthru($fd);
+
+ if ($_GET['type'] = "rec") {
+ if (file_exists($dir_recordings.$_GET['filename'])) {
+ $fd = fopen($dir_recordings.$_GET['filename'], "rb");
+ if ($_GET['t'] == "bin") {
+ header("Content-Type: application/force-download");
+ header("Content-Type: application/octet-stream");
+ header("Content-Type: application/download");
+ header("Content-Description: File Transfer");
+ header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
+ }
+ else {
+ $file_ext = substr($_GET['filename'], -3);
+ if ($file_ext == "wav") {
+ header("Content-Type: audio/x-wav");
+ }
+ if ($file_ext == "mp3") {
+ header("Content-Type: audio/mp3");
+ }
+ }
+ header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
+ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+ header("Content-Length: " . filesize($dir_recordings.$_GET['filename']));
+ fpassthru($fd);
+ }
+ }
+
+ if ($_GET['type'] = "moh") {
+ if (file_exists($dir_music_on_hold_8000.$_GET['filename'])) {
+ $fd = fopen($dir_music_on_hold_8000.$_GET['filename'], "rb");
+ if ($_GET['t'] == "bin") {
+ header("Content-Type: application/force-download");
+ header("Content-Type: application/octet-stream");
+ header("Content-Type: application/download");
+ header("Content-Description: File Transfer");
+ header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"');
+ }
+ else {
+ $file_ext = substr($_GET['filename'], -3);
+ if ($file_ext == "wav") {
+ header("Content-Type: audio/x-wav");
+ }
+ if ($file_ext == "mp3") {
+ header("Content-Type: audio/mp3");
+ }
+ }
+ header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
+ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+ header("Content-Length: " . filesize($dir_music_on_hold_8000.$_GET['filename']));
+ fpassthru($fd);
+ }
+ }
+
exit;
}
else {
- //echo $recording_dir.$_GET['filename'];
+ //echo $dir_recordings.$_GET['filename'];
+}
+
+if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
+
+ if ($_POST['type'] == 'moh') {
+ move_uploaded_file($_FILES['ulfile']['tmp_name'], $dir_music_on_hold_8000 . $_FILES['ulfile']['name']);
+ $savemsg = "Uploaded file to $dir_music_on_hold_8000" . htmlentities($_FILES['ulfile']['name']);
+ //system('chmod -R 744 $dir_music_on_hold_8000*');
+ unset($_POST['txtCommand']);
+ }
+ if ($_POST['type'] == 'rec') {
+ move_uploaded_file($_FILES['ulfile']['tmp_name'], $dir_recordings . $_FILES['ulfile']['name']);
+ $savemsg = "Uploaded file to $dir_recordings" . htmlentities($_FILES['ulfile']['name']);
+ //system('chmod -R 744 $dir_recordings*');
+ unset($_POST['txtCommand']);
+ }
}
-$a_recordings = &$config['installedpackages']['freeswitchrecordings']['config'];
if ($_GET['act'] == "del") {
- if ($_GET['type'] == 'recordings') {
+ if ($_GET['type'] == 'rec') {
if ($a_recordings[$_GET['id']]) {
- unlink('/usr/local/freeswitch/recordings/'.$a_recordings[$_GET['id']]['filename']);
+ unlink_if_exists('/usr/local/freeswitch/recordings/'.$a_recordings[$_GET['id']]['filename']);
unset($a_recordings[$_GET['id']]);
write_config();
header("Location: freeswitch_recordings.php");
exit;
}
}
+
+ if ($_GET['type'] == 'moh') {
+ unlink_if_exists($dir_music_on_hold_8000.$_GET['filename']);
+ header("Location: freeswitch_recordings.php");
+ exit;
+ }
+
}
+
+
include("head.inc");
?>
@@ -117,7 +182,6 @@ function EvalSound(soundobj) {
<tr>
<td class="tabcont" >
-<form action="freeswitch_recordings.php" method="post" name="iform" id="iform">
<?php
@@ -134,15 +198,15 @@ if (count($a_recordings) > 0) {
$config_change = 0;
-if (is_dir($recording_dir)) {
- if ($dh = opendir($recording_dir)) {
+if (is_dir($dir_recordings)) {
+ if ($dh = opendir($dir_recordings)) {
while (($file = readdir($dh)) !== false) {
- if (filetype($recording_dir . $file) == "file") {
+ if (filetype($dir_recordings . $file) == "file") {
if (strpos($config_recording_list, $file) === false) {
- //$handle = fopen($recording_dir.$file,'rb');
- //$file_content = fread($handle,filesize($recording_dir.$file));
+ //$handle = fopen($dir_recordings.$file,'rb');
+ //$file_content = fread($handle,filesize($dir_recordings.$file));
//fclose($handle);
$a_file = split("\.", $file);
@@ -177,12 +241,12 @@ if (is_dir($recording_dir)) {
//if (count($a_recordings) > 0) {
// foreach ($a_recordings as $recordingent) {
-// if (!is_file($recording_dir.$recordingent['filename'])) {
+// if (!is_file($dir_recordings.$recordingent['filename'])) {
//echo "not found: ".$recordingent['filename']."<br />";
//recording not found restore the file from the config.xml
//$file_content = $recordingent['filecontent'];
- //$handle = fopen($recording_dir.$recordingent['filename'],'w');
+ //$handle = fopen($dir_recordings.$recordingent['filename'],'w');
//fwrite ($handle, base64_decode($file_content));
//unset($file_content);
//fclose($handle);
@@ -214,28 +278,44 @@ if ($config_change == 1) {
//endif;
?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td><p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>
- To make a recording dial extension 732673 (record) or you can make a
- 16bit 8khz/16khz Mono WAV file then copy it to the
- following directory then refresh the page to play it back.
- Click on the 'Filename' to download it or the 'Recording Name' to
- play the audio.
- <br>
- <br>
- /usr/local/freeswitch/recordings/
- </span></p></td>
- </tr>
- </table>
- <br />
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td><p><span class="vexpl"><span class="red"><strong>Recordings:<br>
+ </strong></span>
+ To make a recording dial extension 732673 (record) or you can make a
+ 16bit 8khz/16khz Mono WAV file then copy it to the
+ following directory then refresh the page to play it back.
+ Click on the 'Filename' to download it or the 'Recording Name' to
+ play the audio.
+ </span></p></td>
+ </tr>
+ </table>
+
+ <br />
+
+ <div id="niftyOutter">
+ <form action="" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
+ <table border='0'>
+ <tr>
+ <td width='50%'><b>location:</b> <?php echo $dir_recordings; ?></td>
+ <td valign="top" class="label">
+ <input name="type" type="hidden" value="rec">
+ </td>
+ <td align="right">File to upload:</td>
+ <td valign="top" class="label">
+ <input name="ulfile" type="file" class="button" id="ulfile">
+ <input name="submit" type="submit" class="button" id="upload" value="Upload">
+ </td>
+ </tr>
+ </table>
+ </div>
+ </form>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td width="20%" class="listhdrr">Filename (download)</td>
- <td width="25%" class="listhdrr">Recording Name (play)</td>
- <td width="25%" class="listhdr">Description</td>
+ <td width="30%" class="listhdrr">Filename (download)</td>
+ <td width="30%" class="listhdrr">Recording Name (play)</td>
+ <td width="30%" class="listhdr">Description</td>
<td width="10%" class="list">
<!--
<table border="0" cellspacing="0" cellpadding="1">
@@ -255,12 +335,12 @@ if ($config_change == 1) {
?>
<tr>
<td class="listlr" ondblclick="document.location='freeswitch_recordings_edit.php?id=<?=$i;?>'">
- <a href="freeswitch_recordings.php?a=download&t=bin&filename=<?=$recordingent['filename'];?>">
+ <a href="freeswitch_recordings.php?a=download&type=rec&t=bin&filename=<?=$recordingent['filename'];?>">
<?=$recordingent['filename']?>
</a>
</td>
<td class="listr" ondblclick="document.location='freeswitch_recordings_edit.php?id=<?=$i;?>';">
- <a href="javascript:void(0)" onclick="window.open('freeswitch_recordings_play.php?a=download&t=wav&filename=<?=$recordingent['filename'];?>', 'play',' width=300,height=40,menubar=no,status=no,toolbar=no')">
+ <a href="javascript:void(0);" onclick="window.open('freeswitch_recordings_play.php?a=download&type=rec&filename=<?=$recordingent['filename'];?>', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')">
<?=$recordingent['recordingname'];?>&nbsp;
</a>
</td>
@@ -271,7 +351,7 @@ if ($config_change == 1) {
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td valign="middle"><a href="freeswitch_recordings_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td><a href="freeswitch_recordings.php?type=recordings&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
+ <td><a href="freeswitch_recordings.php?type=rec&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
@@ -302,7 +382,102 @@ if ($config_change == 1) {
</tr>
</table>
-</form>
+
+
+ <br />
+ <br />
+ <br />
+
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td><p><span class="vexpl"><span class="red"><strong>Music on Hold:<br>
+ </strong></span>
+ Music on hold can be in WAV or MP3 format. To play MP3 you must have
+ mod_shout enabled on the 'Modules' tab. For best performance
+ upload 16bit 8khz/16khz Mono WAV files.
+ <!--Click on the 'Filename' to download it or the 'Recording Name' to
+ play the audio.-->
+ </span></p></td>
+ </tr>
+ </table>
+
+ <br />
+
+ <div id="niftyOutter">
+ <form action="" method="POST" enctype="multipart/form-data" name="frmUpload" onSubmit="">
+ <table border='0'>
+ <tr>
+ <td width='50%'><b>location:</b> <?php echo $dir_music_on_hold_8000; ?></td>
+ <td valign="top" class="label">
+ <input name="type" type="hidden" value="moh">
+ </td>
+ <td align="right">File to upload:</td>
+ <td valign="top" class="label">
+ <input name="ulfile" type="file" class="button" id="ulfile">
+ <input name="submit" type="submit" class="button" id="upload" value="Upload">
+ </td>
+ </tr>
+ </table>
+ </div>
+ </form>
+
+
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="28%" class="listhdrr">File Name (download)</td>
+ <td width="28%" class="listhdrr">Name (play)</td>
+ <td width="25%" class="listhdr">Last Modified</td>
+ <td width="10%" class="listhdr" nowrap>Size</td>
+ </tr>
+
+ <?php
+
+ if ($handle = opendir($dir_music_on_hold_8000)) {
+ while (false !== ($file = readdir($handle))) {
+ if ($file != "." && $file != ".." && is_file($dir_music_on_hold_8000.$file)) {
+
+ $tmp_filesize = filesize($dir_music_on_hold_8000.$file);
+ $tmp_filesize = byte_convert($tmp_filesize);
+
+ echo "<tr>\n";
+ echo " <td class=\"listlr\" ondblclick=\"\">\n";
+ echo " <a href=\"freeswitch_recordings.php?a=download&type=moh&t=bin&filename=".$file."\">\n";
+ echo " $file";
+ echo " </a>";
+ echo " </td>\n";
+ echo " <td class=\"listlr\" ondblclick=\"\">\n";
+ echo " <a href=\"javascript:void(0);\" onclick=\"window.open('freeswitch_recordings_play.php?a=download&type=moh&filename=".$file."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
+ $tmp_file_array = split("\.",$file);
+ echo " ".$tmp_file_array[0];
+ echo " </a>";
+ echo " </td>\n";
+ echo " <td class=\"listlr\" ondblclick=\"\">\n";
+ echo date ("F d Y H:i:s", filemtime($dir_music_on_hold_8000.$file));
+ echo " </td>\n";
+ echo " <td class=\"listlr\" ondblclick=\"\">\n";
+ echo " ".$tmp_filesize;
+ echo " </td>\n";
+ echo " <td valign=\"middle\" nowrap class=\"list\">\n";
+ echo " <table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n";
+ echo " <tr>\n";
+ //echo " <td valign=\"middle\"><a href=\"freeswitch_recordings.php?id=$i\"><img src=\"/themes/".$g['theme']."/images/icons/icon_e.gif\" width=\"17\" height=\"17\" border=\"0\"></a></td>\n";
+ echo " <td><a href=\"freeswitch_recordings.php?type=moh&act=del&filename=".$file."\" onclick=\"return confirm('Do you really want to delete this file?')\"><img src=\"/themes/". $g['theme']."/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\"></a></td>\n";
+ echo " </tr>\n";
+ echo " </table>\n";
+ echo " </td>\n";
+ echo "</tr>\n";
+
+ }
+ }
+ closedir($handle);
+ }
+ ?>
+
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list"></td>
+ </tr>
+ </table>
<br>
<br>
diff --git a/packages/freeswitch/freeswitch_recordings_play.tmp b/packages/freeswitch/freeswitch_recordings_play.tmp
index aa837c58..4135362d 100644
--- a/packages/freeswitch/freeswitch_recordings_play.tmp
+++ b/packages/freeswitch/freeswitch_recordings_play.tmp
@@ -32,9 +32,12 @@
*/
$filename = $_GET['filename'];
+$type = $_GET['type']; //moh //rec
?>
<html>
+<head>
+</head>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -45,7 +48,21 @@ $filename = $_GET['filename'];
</tr>
<tr>
<td align='center'>
- <embed src="freeswitch_recordings.php?a=download&filename=<?=$filename;?>" autostart=true width=200 height=40 name="sound<?=$$filename;?>" enablejavascript="true">
+ <?php
+
+ $file_ext = substr($_GET['filename'], -3);
+ if ($file_ext == "wav") {
+ echo "<embed src=\"freeswitch_recordings.php?a=download&type=".$type."&filename=".$filename."\" autostart=true width=200 height=40 name=\"sound".$$filename."\" enablejavascript=\"true\">\n";
+ }
+ if ($file_ext == "mp3") {
+ echo "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"17\" data=\"slim.swf?song_url=".urlencode("/freeswitch/freeswitch_recordings.php?a=download&type=".$type."&filename=".$filename)."\">\n";
+ echo "<param name=\"movie\" value=\"slim.swf?song_url=".urlencode("/freeswitch/freeswitch_recordings.php?a=download&type=".$type."&filename=".$filename)."\" />\n";
+ echo "<param name=\"quality\" value=\"high\"/>\n";
+ echo "<param name=\"bgcolor\" value=\"#E6E6E6\"/>\n";
+ echo "</object>\n";
+ }
+
+ ?>
</td>
</tr>
</table>