CDR: Added new HTML5 recording playback and download controls.

This commit is contained in:
Nate Jones
2014-09-11 03:14:52 +00:00
parent 25a97fbb77
commit cc1d6afb6e
13 changed files with 109 additions and 24 deletions

View File

@@ -115,6 +115,11 @@
$text['label-play']['pt-pt'] = "Tocar";
$text['label-play']['fr-fr'] = "Jouer";
$text['label-pause']['en-us'] = "Pause";
$text['label-pause']['es-cl'] = "Pausa";
$text['label-pause']['pt-pt'] = "Pausa";
$text['label-pause']['fr-fr'] = "Pause";
$text['label-download']['en-us'] = "Download";
$text['label-download']['es-cl'] = "Descargar";
$text['label-download']['pt-pt'] = "Descarregar";

View File

@@ -348,7 +348,6 @@ else {
echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order);
echo th_order_by('destination_number', $text['label-destination'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order);
echo th_order_by('tta', 'TTA', $order_by, $order);
//echo th_order_by('end_stamp', 'End', $order_by, $order);
@@ -364,6 +363,7 @@ else {
echo th_order_by('rtp_audio_in_mos', 'MOS', $order_by, $order);
}
echo th_order_by('hangup_cause', $text['label-status'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<td class='list_control_icon'>&nbsp;</td>\n";
}
@@ -486,22 +486,6 @@ else {
}
echo " </a>\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' nowrap=\"nowrap\">";
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
echo " ".$text['label-play']."\n";
echo " </a>\n";
echo " &nbsp;\n";
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
echo " ".$text['label-download']."\n";
echo " </a>\n";
}
else {
echo " &nbsp;\n";
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$tmp_start_epoch."</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['end_stamp']."</td>\n";
@@ -551,9 +535,28 @@ else {
echo $hangup_cause;
}
echo " </td>\n";
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
$recording_file_path = '/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name;
$recording_file_name = strtolower(pathinfo($tmp_name, PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
switch ($recording_file_ext) {
case "wav" : $recording_type = "audio/wave"; break;
case "mp3" : $recording_type = "audio/mpeg"; break;
case "ogg" : $recording_type = "audio/ogg"; break;
}
echo "<audio id='recording_audio_".$row['uuid']."' style='display: none;' controls='controls' onended=\"recording_reset('".$row['uuid']."');\" src=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&filename=".base64_encode($recording_file_path)."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['uuid']."' onclick=\"recording_play('".$row['uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
echo "<a href=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode($recording_file_path)."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
}
else {
echo " <td valign='top' class='".$row_style[$c]." tr_link_void'>";
echo "&nbsp;";
}
echo " </td>\n";
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo " <td class='list_control_icon'>";
echo " <a href='xml_cdr_details.php?uuid=".$row['uuid']."' alt='".$text['button-view']."'>$v_link_label_view</a>";
echo " <a href='xml_cdr_details.php?uuid=".$row['uuid']."' title='".$text['button-view']."'>$v_link_label_view</a>";
echo " </td>\n";
}
echo "</tr>\n";

View File

@@ -267,5 +267,6 @@ else {
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$row_style["2"] = "row_style2";
?>