Add destinations playback option for recordings

This commit is contained in:
markjcrane
2026-05-15 19:25:13 +00:00
parent 21b55e229b
commit 980a8d5b2d
3 changed files with 73 additions and 3 deletions
@@ -400,17 +400,20 @@
$response .= " <option value='' ".(!empty($placeholder) ? "selected='selected' disabled='disabled'" : null).">".(!empty($placeholder) ? $placeholder : null)."</option>\n";
foreach ($this->destinations as $row) {
//set variables to simplify the code
$name = $row['name'];
$label = $row['label'];
$destination = $row['field']['destination'] ?? '';
//add multi-lingual support
if (file_exists(dirname(__DIR__, 4)."/app/".$name."/app_languages.php")) {
$text2 = $language2->get($this->language, 'app/'.$name);
}
//set the group label
$group_label = ($text2['label-'.$name] ?? $text2['title-'.$name]);
if (!empty($row['result']['data']) && !empty($row['select_value'][$destination_type])) {
$response .= " <optgroup label='".$text2['title-'.$name]."'>\n";
$response .= " <optgroup label='".$group_label."'>\n";
$label2 = $label;
foreach ($row['result']['data'] as $data) {
$select_value = $row['select_value'][$destination_type];
@@ -530,6 +533,9 @@
//add the language object
$language2 = new text;
//pre-define the array
$text2 = [];
//build the destination select list in html
$response .= " <select id='{$destination_id}_type' class='formfld' style='".$select_style."' onchange=\"get_destinations('".$destination_id."', '".$destination_type."', this.value);\">\n";
$response .= " <option value=''></option>\n";
@@ -547,8 +553,12 @@
if ($key == 'other') {
$text2 = $language2->get($this->language, 'app/dialplans');
}
//set the group label
$group_label = ($text2['label-'.$key] ?? $text2['title-'.$key]);
//add the application to the select list
$response .= " <option id='{$singular}' class='{$key}' value='".$key."' $selected>".$text2['title-'.$key]."</option>\n";
$response .= " <option id='{$singular}' class='{$key}' value='".$key."' $selected>".$group_label."</option>\n";
}
}
$response .= " </select>\n";
+33
View File
@@ -45,6 +45,34 @@
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "lua:streamfile.lua \${destination}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:lua streamfile.lua \${destination}";
$apps[$x]['destinations'][$y]['select_label'] = "\${name}";
$y++;
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "playback";
$apps[$x]['destinations'][$y]['name'] = "playback";
$apps[$x]['destinations'][$y]['sql'] = "SELECT ";
$apps[$x]['destinations'][$y]['sql'] .= " r.recording_uuid, r.recording_name AS name, ";
$apps[$x]['destinations'][$y]['sql'] .= " s.recording_path || '/' || d.domain_name || '/' || r.recording_filename AS destination ";
$apps[$x]['destinations'][$y]['sql'] .= "FROM ";
$apps[$x]['destinations'][$y]['sql'] .= " v_recordings AS r ";
$apps[$x]['destinations'][$y]['sql'] .= "INNER JOIN ";
$apps[$x]['destinations'][$y]['sql'] .= " v_domains AS d ON r.domain_uuid = d.domain_uuid ";
$apps[$x]['destinations'][$y]['sql'] .= "CROSS JOIN ( ";
$apps[$x]['destinations'][$y]['sql'] .= " SELECT default_setting_value AS recording_path ";
$apps[$x]['destinations'][$y]['sql'] .= " FROM v_default_settings ";
$apps[$x]['destinations'][$y]['sql'] .= " WHERE default_setting_category = 'switch' ";
$apps[$x]['destinations'][$y]['sql'] .= " AND default_setting_subcategory = 'recordings' ";
$apps[$x]['destinations'][$y]['sql'] .= ") AS s ";
$apps[$x]['destinations'][$y]['sql'] .= "WHERE ";
$apps[$x]['destinations'][$y]['sql'] .= " r.domain_uuid = '\${domain_uuid}' ";
$apps[$x]['destinations'][$y]['sql'] .= " AND d.domain_uuid = '\${domain_uuid}' ";
$apps[$x]['destinations'][$y]['order_by'] = "recording_name asc";
$apps[$x]['destinations'][$y]['field']['uuid'] = "recording_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "recording_name";
$apps[$x]['destinations'][$y]['field']['destination'] = "recording_filename";
$apps[$x]['destinations'][$y]['field']['description'] = "recording_description";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "playback:\${destination}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:playback \${destination}";
$apps[$x]['destinations'][$y]['select_label'] = "\${name}";
//permission details
$y=0;
@@ -90,6 +118,11 @@
$apps[$x]['permissions'][$y]['name'] = "recording_password";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "playback_destinations";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//default settings
$y=0;
+27
View File
@@ -4507,6 +4507,33 @@ $text['label-recordings']['zh-cn'] = "录音";
$text['label-recordings']['ja-jp'] = "録音";
$text['label-recordings']['ko-kr'] = "녹음";
$text['label-playback']['en-us'] = "Playback";
$text['label-playback']['en-gb'] = "Playback";
$text['label-playback']['ka-ge'] = "დაკვრა";
$text['label-playback']['ar-eg'] = "التشغيل";
$text['label-playback']['de-at'] = "Wiedergabe";
$text['label-playback']['de-ch'] = "Wiedergabe";
$text['label-playback']['de-de'] = "Wiedergabe";
$text['label-playback']['el-gr'] = "Αναπαραγωγή";
$text['label-playback']['es-cl'] = "Reproducción";
$text['label-playback']['es-mx'] = "Reproducción";
$text['label-playback']['fr-ca'] = "Lecture";
$text['label-playback']['fr-fr'] = "Lecture";
$text['label-playback']['he-il'] = "הפעלה";
$text['label-playback']['it-it'] = "Riproduzione";
$text['label-playback']['nl-nl'] = "Afspelen";
$text['label-playback']['pl-pl'] = "Odtwarzanie";
$text['label-playback']['pt-br'] = "Reprodução";
$text['label-playback']['pt-pt'] = "Reprodução";
$text['label-playback']['ro-ro'] = "Redare";
$text['label-playback']['ru-ru'] = "Воспроизведение";
$text['label-playback']['sv-se'] = "Uppspelning";
$text['label-playback']['uk-ua'] = "Відтворення";
$text['label-playback']['tr-tr'] = "Oynatma";
$text['label-playback']['zh-cn'] = "播放";
$text['label-playback']['ja-jp'] = "再生";
$text['label-playback']['ko-kr'] = "재생";
$text['label-ringtones']['en-us'] = "Ringtones";
$text['label-ringtones']['ka-ge'] = "ზარის მელოდიები";
$text['label-ringtones']['en-gb'] = "Ringtones";