mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
After removing domain name from the default recordings dir path need to add the domain name every where the recordings directory is currently used.
This commit is contained in:
@@ -260,10 +260,10 @@ require_once "resources/header.php";
|
|||||||
$phone_1 = preg_replace('{\D}', '', $tmp_value_array[0]);
|
$phone_1 = preg_replace('{\D}', '', $tmp_value_array[0]);
|
||||||
|
|
||||||
if ($gateway == "loopback") {
|
if ($gateway == "loopback") {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
echo $cmd."<br />\n";
|
echo $cmd."<br />\n";
|
||||||
cmd_async($cmd);
|
cmd_async($cmd);
|
||||||
@@ -335,20 +335,20 @@ require_once "resources/header.php";
|
|||||||
//make the call
|
//make the call
|
||||||
if (strlen($phone_1)> 0) {
|
if (strlen($phone_1)> 0) {
|
||||||
if ($gateway == "loopback") {
|
if ($gateway == "loopback") {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
//echo $cmd."<br />\n";
|
//echo $cmd."<br />\n";
|
||||||
cmd_async($cmd);
|
cmd_async($cmd);
|
||||||
}
|
}
|
||||||
if (strlen($phone_2)> 0) {
|
if (strlen($phone_2)> 0) {
|
||||||
if ($gateway == "loopback") {
|
if ($gateway == "loopback") {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_2."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_2."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_2." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
$cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_2." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
|
||||||
}
|
}
|
||||||
//echo $cmd."<br />\n";
|
//echo $cmd."<br />\n";
|
||||||
cmd_async($cmd);
|
cmd_async($cmd);
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td class='vtable' align='left'>\n";
|
||||||
$record_ext=($_SESSION['record_ext']=='mp3'?'mp3':'wav');
|
$record_ext=($_SESSION['record_ext']=='mp3'?'mp3':'wav');
|
||||||
$record_template = $_SESSION['switch']['recordings']['dir']."/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.".$record_ext;
|
$record_template = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.".$record_ext;
|
||||||
echo " <select class='formfld' name='queue_record_template'>\n";
|
echo " <select class='formfld' name='queue_record_template'>\n";
|
||||||
if (strlen($queue_record_template) > 0) {
|
if (strlen($queue_record_template) > 0) {
|
||||||
echo " <option value='$record_template' selected='selected' >".$text['option-true']."</option>\n";
|
echo " <option value='$record_template' selected='selected' >".$text['option-true']."</option>\n";
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ require_once "resources/footer.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_record_cmd(uuid, prefix, name) {
|
function get_record_cmd(uuid, prefix, name) {
|
||||||
cmd = \"uuid_record \"+uuid+\" start ".$_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/\"+uuid+\".wav\";
|
cmd = \"uuid_record \"+uuid+\" start ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/\"+uuid+\".wav\";
|
||||||
return escape(cmd);
|
return escape(cmd);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ else {
|
|||||||
//park
|
//park
|
||||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('calls_exec.php?cmd='+get_park_cmd(escape('$uuid'), '".$tmp_domain."'));\">".$text['label-park']."</a> \n";
|
echo " <a href='javascript:void(0);' onclick=\"send_cmd('calls_exec.php?cmd='+get_park_cmd(escape('$uuid'), '".$tmp_domain."'));\">".$text['label-park']."</a> \n";
|
||||||
//record start/stop
|
//record start/stop
|
||||||
$tmp_dir = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d");
|
$tmp_dir = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d");
|
||||||
mkdir($tmp_dir, 0777, true);
|
mkdir($tmp_dir, 0777, true);
|
||||||
$tmp_file = $tmp_dir."/".$uuid.".wav";
|
$tmp_file = $tmp_dir."/".$uuid.".wav";
|
||||||
if (file_exists($tmp_file)) {
|
if (file_exists($tmp_file)) {
|
||||||
|
|||||||
@@ -229,13 +229,13 @@ if (count($_GET)>0) {
|
|||||||
$x=0;
|
$x=0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if ($x > 0) {
|
if ($x > 0) {
|
||||||
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"]."_".$x.".wav";
|
$dest_file = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"]."_".$x.".wav";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav";
|
$dest_file = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav";
|
||||||
}
|
}
|
||||||
if (!file_exists($dest_file)) {
|
if (!file_exists($dest_file)) {
|
||||||
rename($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav", $dest_file);
|
rename($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav", $dest_file);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$x++;
|
$x++;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])
|
|||||||
//use the server's time zone to ensure it matches the time zone used by freeswitch
|
//use the server's time zone to ensure it matches the time zone used by freeswitch
|
||||||
date_default_timezone_set($_SESSION['time_zone']['system']);
|
date_default_timezone_set($_SESSION['time_zone']['system']);
|
||||||
//create the api record command and send it over event socket
|
//create the api record command and send it over event socket
|
||||||
$switch_cmd = "api uuid_record ".$uuid." start ".$_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$uuid.".wav";
|
$switch_cmd = "api uuid_record ".$uuid." start ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$uuid.".wav";
|
||||||
$result2 = trim(event_socket_request($fp, $switch_cmd));
|
$result2 = trim(event_socket_request($fp, $switch_cmd));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -340,15 +340,15 @@ else {
|
|||||||
echo " <select name='conference_center_greeting' class='formfld' ".((permission_exists('conference_center_add') || permission_exists('conference_center_edit')) ? "onchange='changeToInput(this);'" : null).">\n";
|
echo " <select name='conference_center_greeting' class='formfld' ".((permission_exists('conference_center_add') || permission_exists('conference_center_edit')) ? "onchange='changeToInput(this);'" : null).">\n";
|
||||||
echo " <option></option>\n";
|
echo " <option></option>\n";
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
$files = Array();
|
$files = Array();
|
||||||
echo "<optgroup label='Recordings'>\n";
|
echo "<optgroup label='Recordings'>\n";
|
||||||
while ($file = readdir($dh)) {
|
while ($file = readdir($dh)) {
|
||||||
if ($file != "." && $file != ".." && $file[0] != '.') {
|
if ($file != "." && $file != ".." && $file[0] != '.') {
|
||||||
if (!is_dir($_SESSION['switch']['recordings']['dir']."/".$file)) {
|
if (!is_dir($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file)) {
|
||||||
$selected = ($conference_center_greeting == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($conference_center_greeting) > 0) ? true : false;
|
$selected = ($conference_center_greeting == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file && strlen($conference_center_greeting) > 0) ? true : false;
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' ".(($selected) ? "selected='selected'" : null).">".$file."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file."' ".(($selected) ? "selected='selected'" : null).">".$file."</option>\n";
|
||||||
if ($selected) { $tmp_selected = true; }
|
if ($selected) { $tmp_selected = true; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,8 +393,8 @@ else {
|
|||||||
if (permission_exists('conference_center_add') || permission_exists('conference_center_edit')) {
|
if (permission_exists('conference_center_add') || permission_exists('conference_center_edit')) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='selected'>\n";
|
echo "<optgroup label='selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$conference_center_greeting)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$conference_center_greeting."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$conference_center_greeting."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
}
|
}
|
||||||
else if (substr($conference_center_greeting, -3) == "wav" || substr($conference_center_greeting, -3) == "mp3") {
|
else if (substr($conference_center_greeting, -3) == "wav" || substr($conference_center_greeting, -3) == "mp3") {
|
||||||
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
echo " <option value='".$conference_center_greeting."' selected='selected'>".$conference_center_greeting."</option>\n";
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ else {
|
|||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference_session_details']."</b></td>\n";
|
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference_session_details']."</b></td>\n";
|
||||||
echo " <td width='70%' align='right'>\n";
|
echo " <td width='70%' align='right'>\n";
|
||||||
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||||
$tmp_name = '';
|
$tmp_name = '';
|
||||||
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
|
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
|
||||||
$tmp_name = $row['conference_session_uuid'].".mp3";
|
$tmp_name = $row['conference_session_uuid'].".mp3";
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ else {
|
|||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$start_date." </td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$start_date." </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$end_date." </td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$end_date." </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile']." </td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile']." </td>\n";
|
||||||
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||||
$tmp_name = '';
|
$tmp_name = '';
|
||||||
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
|
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
|
||||||
$tmp_name = $row['conference_session_uuid'].".mp3";
|
$tmp_name = $row['conference_session_uuid'].".mp3";
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ else {
|
|||||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
|
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
|
||||||
}
|
}
|
||||||
elseif ($data == "record") {
|
elseif ($data == "record") {
|
||||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||||
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
||||||
if (!file_exists($recording_dir."/".$uuid.".wav")) {
|
if (!file_exists($recording_dir."/".$uuid.".wav")) {
|
||||||
$switch_result = event_socket_request($fp, "api ".$switch_cmd);
|
$switch_result = event_socket_request($fp, "api ".$switch_cmd);
|
||||||
@@ -149,7 +149,7 @@ else {
|
|||||||
}
|
}
|
||||||
elseif ($data == "norecord") {
|
elseif ($data == "norecord") {
|
||||||
//stop recording and rename the file
|
//stop recording and rename the file
|
||||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||||
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
||||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ else {
|
|||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo "<td align='right'>\n";
|
echo "<td align='right'>\n";
|
||||||
|
|
||||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||||
$recording_name = '';
|
$recording_name = '';
|
||||||
if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) {
|
if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) {
|
||||||
$recording_name = $session_uuid.".wav";
|
$recording_name = $session_uuid.".wav";
|
||||||
|
|||||||
@@ -440,9 +440,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
foreach ($recordings as &$row) {
|
foreach ($recordings as &$row) {
|
||||||
$recording_name = $row["recording_name"];
|
$recording_name = $row["recording_name"];
|
||||||
$recording_filename = $row["recording_filename"];
|
$recording_filename = $row["recording_filename"];
|
||||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||||
}
|
}
|
||||||
else if ($ivr_menu_greet_long == $recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
else if ($ivr_menu_greet_long == $recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
@@ -500,8 +500,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_long)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
}
|
}
|
||||||
else if (substr($ivr_menu_greet_long, -3) == "wav" || substr($ivr_menu_greet_long, -3) == "mp3") {
|
else if (substr($ivr_menu_greet_long, -3) == "wav" || substr($ivr_menu_greet_long, -3) == "mp3") {
|
||||||
echo " <option value='".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
echo " <option value='".$ivr_menu_greet_long."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
|
||||||
@@ -538,9 +538,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
foreach ($recordings as &$row) {
|
foreach ($recordings as &$row) {
|
||||||
$recording_name = $row["recording_name"];
|
$recording_name = $row["recording_name"];
|
||||||
$recording_filename = $row["recording_filename"];
|
$recording_filename = $row["recording_filename"];
|
||||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||||
}
|
}
|
||||||
else if ($ivr_menu_greet_short == $recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
else if ($ivr_menu_greet_short == $recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
@@ -599,8 +599,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected && strlen($ivr_menu_greet_short) > 0) {
|
if (!$tmp_selected && strlen($ivr_menu_greet_short) > 0) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_short)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_short)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||||
}
|
}
|
||||||
else if (substr($ivr_menu_greet_short, -3) == "wav" || substr($ivr_menu_greet_short, -3) == "mp3") {
|
else if (substr($ivr_menu_greet_short, -3) == "wav" || substr($ivr_menu_greet_short, -3) == "mp3") {
|
||||||
echo " <option value='".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
echo " <option value='".$ivr_menu_greet_short."' selected='selected'>".$ivr_menu_greet_short."</option>\n";
|
||||||
@@ -877,9 +877,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
foreach ($recordings as &$row) {
|
foreach ($recordings as &$row) {
|
||||||
$recording_name = $row["recording_name"];
|
$recording_name = $row["recording_name"];
|
||||||
$recording_filename = $row["recording_filename"];
|
$recording_filename = $row["recording_filename"];
|
||||||
if ($ivr_menu_invalid_sound == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
if ($ivr_menu_invalid_sound == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||||
}
|
}
|
||||||
else if ($ivr_menu_invalid_sound == $recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
else if ($ivr_menu_invalid_sound == $recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
@@ -935,8 +935,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_invalid_sound)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||||
}
|
}
|
||||||
else if (substr($ivr_menu_invalid_sound, -3) == "wav" || substr($ivr_menu_invalid_sound, -3) == "mp3") {
|
else if (substr($ivr_menu_invalid_sound, -3) == "wav" || substr($ivr_menu_invalid_sound, -3) == "mp3") {
|
||||||
echo " <option value='".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
echo " <option value='".$ivr_menu_invalid_sound."' selected='selected'>".$ivr_menu_invalid_sound."</option>\n";
|
||||||
@@ -973,9 +973,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
foreach ($recordings as &$row) {
|
foreach ($recordings as &$row) {
|
||||||
$recording_name = $row["recording_name"];
|
$recording_name = $row["recording_name"];
|
||||||
$recording_filename = $row["recording_filename"];
|
$recording_filename = $row["recording_filename"];
|
||||||
if ($ivr_menu_exit_sound == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
if ($ivr_menu_exit_sound == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||||
}
|
}
|
||||||
else if ($ivr_menu_exit_sound == $recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
else if ($ivr_menu_exit_sound == $recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
||||||
$tmp_selected = true;
|
$tmp_selected = true;
|
||||||
@@ -1031,8 +1031,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
if (!$tmp_selected) {
|
if (!$tmp_selected) {
|
||||||
echo "<optgroup label='Selected'>\n";
|
echo "<optgroup label='Selected'>\n";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_exit_sound)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound)) {
|
||||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
||||||
}
|
}
|
||||||
else if (substr($ivr_menu_exit_sound, -3) == "wav" || substr($ivr_menu_exit_sound, -3) == "mp3") {
|
else if (substr($ivr_menu_exit_sound, -3) == "wav" || substr($ivr_menu_exit_sound, -3) == "mp3") {
|
||||||
echo " <option value='".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
echo " <option value='".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//recordings
|
//recordings
|
||||||
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/")) {
|
||||||
$tmp_selected = false;
|
$tmp_selected = false;
|
||||||
$files = Array();
|
$files = Array();
|
||||||
//$select .= "<optgroup label='recordings'>\n";
|
//$select .= "<optgroup label='recordings'>\n";
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ require_once "resources/header.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_record_cmd(uuid) {
|
function get_record_cmd(uuid) {
|
||||||
cmd = "uuid_record " + uuid + " start <?php echo $_SESSION['switch']['recordings']['dir']?>/archive/<?php echo date('Y')?>/<?php echo date('M')?>/<?php echo date('d')?>/" + uuid + ".wav";
|
cmd = "uuid_record " + uuid + " start <?php echo $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']; ?>/archive/<?php echo date('Y')?>/<?php echo date('M')?>/<?php echo date('d')?>/" + uuid + ".wav";
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ if ($domains_processed == 1) {
|
|||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
$phrase_detail_uuid = $row['phrase_detail_uuid'];
|
$phrase_detail_uuid = $row['phrase_detail_uuid'];
|
||||||
$phrase_detail_data = $row['phrase_detail_data'];
|
$phrase_detail_data = $row['phrase_detail_data'];
|
||||||
if (substr_count($phrase_detail_data, $_SESSION['switch']['recordings']['dir']) > 0) {
|
if (substr_count($phrase_detail_data, $_SESSION['switch']['recordings']['dir'].'/'.$domain_name) > 0) {
|
||||||
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/', '', $phrase_detail_data);
|
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/', '', $phrase_detail_data);
|
||||||
}
|
}
|
||||||
//update function and data to be base64 compatible
|
//update function and data to be base64 compatible
|
||||||
$phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")";
|
$phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")";
|
||||||
@@ -141,7 +141,7 @@ if ($domains_processed == 1) {
|
|||||||
$phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data);
|
$phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data);
|
||||||
$phrase_detail_data = str_replace(')', '', $phrase_detail_data);
|
$phrase_detail_data = str_replace(')', '', $phrase_detail_data);
|
||||||
if (substr_count($phrase_detail_data, '/') === 0) {
|
if (substr_count($phrase_detail_data, '/') === 0) {
|
||||||
$phrase_detail_data = $_SESSION['switch']['recordings']['dir'].'/'.$phrase_detail_data;
|
$phrase_detail_data = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/'.$phrase_detail_data;
|
||||||
}
|
}
|
||||||
$sql = "update v_phrase_details set ";
|
$sql = "update v_phrase_details set ";
|
||||||
$sql .= "phrase_detail_function = 'play-file', ";
|
$sql .= "phrase_detail_function = 'play-file', ";
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"lua(streamfile.lua ".$row["recording_filename"].")\"));\n";
|
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"lua(streamfile.lua ".$row["recording_filename"].")\"));\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"".$_SESSION['switch']['recordings']['dir'].'/'.$row["recording_filename"]."\"));\n";
|
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"".$_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row["recording_filename"]."\"));\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "obj_action.appendChild(opt_group);\n";
|
echo "obj_action.appendChild(opt_group);\n";
|
||||||
@@ -470,7 +470,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
}
|
}
|
||||||
if ($field['phrase_detail_function'] == 'play-file') {
|
if ($field['phrase_detail_function'] == 'play-file') {
|
||||||
$phrase_detail_function = $text['label-play'];
|
$phrase_detail_function = $text['label-play'];
|
||||||
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/', '', $field['phrase_detail_data']);
|
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/', '', $field['phrase_detail_data']);
|
||||||
}
|
}
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo " <td class='vtable'>".$phrase_detail_function." </td>\n";
|
echo " <td class='vtable'>".$phrase_detail_function." </td>\n";
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//if the recordings directory doesn't exist then create it
|
//if the recordings directory doesn't exist then create it
|
||||||
if (strlen($_SESSION['switch']['recordings']['dir']) > 0) {
|
if (strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) {
|
||||||
if (!is_readable($_SESSION['switch']['recordings']['dir'])) { mkdir($_SESSION['switch']['recordings']['dir'],0777,true); }
|
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name,0777,true); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domains_processed == 1) {
|
if ($domains_processed == 1) {
|
||||||
@@ -45,7 +45,7 @@ if ($domains_processed == 1) {
|
|||||||
$recording_domain_uuid = $row['domain_uuid'];
|
$recording_domain_uuid = $row['domain_uuid'];
|
||||||
$recording_filename = $row['recording_filename'];
|
$recording_filename = $row['recording_filename'];
|
||||||
//set recording directory
|
//set recording directory
|
||||||
$recording_directory = $_SESSION['switch']['recordings']['dir'];
|
$recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name;
|
||||||
//encode recording file (if exists)
|
//encode recording file (if exists)
|
||||||
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
||||||
$recording_base64 = base64_encode(file_get_contents($recording_directory.'/'.$recording_filename));
|
$recording_base64 = base64_encode(file_get_contents($recording_directory.'/'.$recording_filename));
|
||||||
@@ -78,7 +78,7 @@ if ($domains_processed == 1) {
|
|||||||
$recording_filename = $row['recording_filename'];
|
$recording_filename = $row['recording_filename'];
|
||||||
$recording_base64 = $row['recording_base64'];
|
$recording_base64 = $row['recording_base64'];
|
||||||
//set recording directory
|
//set recording directory
|
||||||
$recording_directory = $_SESSION['switch']['recordings']['dir'];
|
$recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name;
|
||||||
//remove local file, if any
|
//remove local file, if any
|
||||||
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
if (file_exists($recording_directory.'/'.$recording_filename)) {
|
||||||
@unlink($recording_directory.'/'.$recording_filename);
|
@unlink($recording_directory.'/'.$recording_filename);
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ if (strlen($id)>0) {
|
|||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
//delete the recording
|
//delete the recording
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$filename)) {
|
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename)) {
|
||||||
@unlink($_SESSION['switch']['recordings']['dir']."/".$filename);
|
@unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (permission_exists('recording_edit')) {
|
if (permission_exists('recording_edit')) {
|
||||||
//if file name is not the same then rename the file
|
//if file name is not the same then rename the file
|
||||||
if ($recording_filename != $recording_filename_original) {
|
if ($recording_filename != $recording_filename_original) {
|
||||||
rename($_SESSION['switch']['recordings']['dir'].'/'.$recording_filename_original, $_SESSION['switch']['recordings']['dir'].'/'.$recording_filename);
|
rename($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename_original, $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update the database with the new data
|
//update the database with the new data
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ require_once "resources/check_auth.php";
|
|||||||
if ($_GET['a'] == "download" && (permission_exists('recording_play') || permission_exists('recording_download'))) {
|
if ($_GET['a'] == "download" && (permission_exists('recording_play') || permission_exists('recording_download'))) {
|
||||||
session_cache_limiter('public');
|
session_cache_limiter('public');
|
||||||
if ($_GET['type'] = "rec") {
|
if ($_GET['type'] = "rec") {
|
||||||
$path = $_SESSION['switch']['recordings']['dir'];
|
$path = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'];
|
||||||
|
|
||||||
//if from recordings, get recording details from db
|
//if from recordings, get recording details from db
|
||||||
$recording_uuid = check_str($_GET['id']); //recordings
|
$recording_uuid = check_str($_GET['id']); //recordings
|
||||||
@@ -115,7 +115,7 @@ require_once "resources/check_auth.php";
|
|||||||
if ($_POST['submit'] == $text['button-upload'] && $_POST['type'] == 'rec' && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
|
if ($_POST['submit'] == $text['button-upload'] && $_POST['type'] == 'rec' && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
|
||||||
$recording_filename = str_replace(" ", "_", $_FILES['ulfile']['name']);
|
$recording_filename = str_replace(" ", "_", $_FILES['ulfile']['name']);
|
||||||
$recording_filename = str_replace("'", "", $recording_filename);
|
$recording_filename = str_replace("'", "", $recording_filename);
|
||||||
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$recording_filename);
|
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename);
|
||||||
|
|
||||||
$_SESSION['message'] = $text['message-uploaded'].": ".htmlentities($recording_filename);
|
$_SESSION['message'] = $text['message-uploaded'].": ".htmlentities($recording_filename);
|
||||||
|
|
||||||
@@ -146,9 +146,9 @@ require_once "resources/check_auth.php";
|
|||||||
$array_base64_exists[$row['recording_uuid']] = ($row['recording_base64'] != '') ? true : false;
|
$array_base64_exists[$row['recording_uuid']] = ($row['recording_base64'] != '') ? true : false;
|
||||||
//if not base64, convert back to local files and remove base64 from db
|
//if not base64, convert back to local files and remove base64 from db
|
||||||
if ($_SESSION['recordings']['storage_type']['text'] != 'base64' && $row['recording_base64'] != '') {
|
if ($_SESSION['recordings']['storage_type']['text'] != 'base64' && $row['recording_base64'] != '') {
|
||||||
if (!file_exists($_SESSION['switch']['recordings']['dir'].'/'.$row['recording_filename'])) {
|
if (!file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row['recording_filename'])) {
|
||||||
$recording_decoded = base64_decode($row['recording_base64']);
|
$recording_decoded = base64_decode($row['recording_base64']);
|
||||||
file_put_contents($_SESSION['switch']['recordings']['dir'].'/'.$row['recording_filename'], $recording_decoded);
|
file_put_contents($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row['recording_filename'], $recording_decoded);
|
||||||
$sql = "update v_recordings set recording_base64 = null where domain_uuid = '".$domain_uuid."' and recording_uuid = '".$row['recording_uuid']."' ";
|
$sql = "update v_recordings set recording_base64 = null where domain_uuid = '".$domain_uuid."' and recording_uuid = '".$row['recording_uuid']."' ";
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($sql);
|
unset($sql);
|
||||||
@@ -158,10 +158,10 @@ require_once "resources/check_auth.php";
|
|||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
//add recordings to the database
|
//add recordings to the database
|
||||||
if (is_dir($_SESSION['switch']['recordings']['dir'].'/')) {
|
if (is_dir($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/')) {
|
||||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir'].'/')) {
|
if ($dh = opendir($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/')) {
|
||||||
while (($recording_filename = readdir($dh)) !== false) {
|
while (($recording_filename = readdir($dh)) !== false) {
|
||||||
if (filetype($_SESSION['switch']['recordings']['dir']."/".$recording_filename) == "file") {
|
if (filetype($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename) == "file") {
|
||||||
|
|
||||||
if (!in_array($recording_filename, $array_recordings)) {
|
if (!in_array($recording_filename, $array_recordings)) {
|
||||||
//file not found in db, add it
|
//file not found in db, add it
|
||||||
@@ -187,7 +187,7 @@ require_once "resources/check_auth.php";
|
|||||||
$sql .= "'".$recording_name."', ";
|
$sql .= "'".$recording_name."', ";
|
||||||
$sql .= "'".$recording_description."' ";
|
$sql .= "'".$recording_description."' ";
|
||||||
if ($_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
if ($_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
||||||
$recording_base64 = base64_encode(file_get_contents($_SESSION['switch']['recordings']['dir'].'/'.$recording_filename));
|
$recording_base64 = base64_encode(file_get_contents($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename));
|
||||||
$sql .= ", '".$recording_base64."' ";
|
$sql .= ", '".$recording_base64."' ";
|
||||||
}
|
}
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
@@ -199,7 +199,7 @@ require_once "resources/check_auth.php";
|
|||||||
if ($_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
if ($_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
||||||
$found_recording_uuid = array_search($recording_filename, $array_recordings);
|
$found_recording_uuid = array_search($recording_filename, $array_recordings);
|
||||||
if (!$array_base64_exists[$found_recording_uuid]) {
|
if (!$array_base64_exists[$found_recording_uuid]) {
|
||||||
$recording_base64 = base64_encode(file_get_contents($_SESSION['switch']['recordings']['dir'].'/'.$recording_filename));
|
$recording_base64 = base64_encode(file_get_contents($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename));
|
||||||
$sql = "update v_recordings set ";
|
$sql = "update v_recordings set ";
|
||||||
$sql .= "recording_base64 = '".$recording_base64."' ";
|
$sql .= "recording_base64 = '".$recording_base64."' ";
|
||||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||||
@@ -211,8 +211,8 @@ require_once "resources/check_auth.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if base64, remove local file
|
//if base64, remove local file
|
||||||
if ($_SESSION['recordings']['storage_type']['text'] == 'base64' && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$recording_filename)) {
|
if ($_SESSION['recordings']['storage_type']['text'] == 'base64' && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename)) {
|
||||||
@unlink($_SESSION['switch']['recordings']['dir'].'/'.$recording_filename);
|
@unlink($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ require_once "resources/check_auth.php";
|
|||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['recording_name']."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['recording_name']."</td>\n";
|
||||||
if ($_SESSION['recordings']['storage_type']['text'] != 'base64') {
|
if ($_SESSION['recordings']['storage_type']['text'] != 'base64') {
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['recording_filename']."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['recording_filename']."</td>\n";
|
||||||
$tmp_filesize = filesize($_SESSION['switch']['recordings']['dir'].'/'.$row['recording_filename']);
|
$tmp_filesize = filesize($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row['recording_filename']);
|
||||||
$tmp_filesize = byte_convert($tmp_filesize);
|
$tmp_filesize = byte_convert($tmp_filesize);
|
||||||
echo " <td class='".$row_style[$c]."' style='text-align: center;'>".$tmp_filesize."</td>\n";
|
echo " <td class='".$row_style[$c]."' style='text-align: center;'>".$tmp_filesize."</td>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@
|
|||||||
$database->fields['domain_name'] = $domain_name;
|
$database->fields['domain_name'] = $domain_name;
|
||||||
|
|
||||||
//check whether a recording exists
|
//check whether a recording exists
|
||||||
$recording_relative_path = '/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
$recording_relative_path = '/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir'].$recording_relative_path.'/'.$uuid.'.wav')) {
|
if (file_exists($_SESSION['switch']['recordings']['dir'].$recording_relative_path.'/'.$uuid.'.wav')) {
|
||||||
$recording_file = $recording_relative_path.'/'.$uuid.'.wav';
|
$recording_file = $recording_relative_path.'/'.$uuid.'.wav';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ else {
|
|||||||
|
|
||||||
//handle recordings
|
//handle recordings
|
||||||
if (permission_exists('recording_play') || permission_exists('recording_download')) {
|
if (permission_exists('recording_play') || permission_exists('recording_download')) {
|
||||||
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||||
$tmp_name = '';
|
$tmp_name = '';
|
||||||
if(!empty($row['recording_file']) && file_exists($row['recording_file'])){
|
if(!empty($row['recording_file']) && file_exists($row['recording_file'])){
|
||||||
$tmp_name=$row['recording_file'];
|
$tmp_name=$row['recording_file'];
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ if (sizeof($_REQUEST) > 0) {
|
|||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
unset($sql, $prep_statement);
|
unset($sql, $prep_statement);
|
||||||
//delete recording, if any
|
//delete recording, if any
|
||||||
if ($recording_file_path[$index] != '' && file_exists($_SESSION['switch']['recordings']['dir'].base64_decode($recording_file_path[$index]))) {
|
if ($recording_file_path[$index] != '' && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]))) {
|
||||||
@unlink($_SESSION['switch']['recordings']['dir'].base64_decode($recording_file_path[$index]));
|
@unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ else {
|
|||||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$language."</td>\n";
|
//echo " <td valign='top' class='".$row_style[$c]."'>".$language."</td>\n";
|
||||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$context."</td>\n";
|
//echo " <td valign='top' class='".$row_style[$c]."'>".$context."</td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
||||||
//echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
//echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||||
//echo " </a>";
|
//echo " </a>";
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ else {
|
|||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
||||||
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||||
echo $caller_id_number.' ';
|
echo $caller_id_number.' ';
|
||||||
echo " </a>";
|
echo " </a>";
|
||||||
@@ -276,7 +276,7 @@ else {
|
|||||||
if ($key == "bridge_uuid" || $key == "signal_bond") {
|
if ($key == "bridge_uuid" || $key == "signal_bond") {
|
||||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>\n";
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>\n";
|
||||||
echo " <a href='xml_cdr_details.php?uuid=$value'>".$value."</a> \n";
|
echo " <a href='xml_cdr_details.php?uuid=$value'>".$value."</a> \n";
|
||||||
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||||
$tmp_name = '';
|
$tmp_name = '';
|
||||||
if (file_exists($tmp_dir.'/'.$value.'.wav')) {
|
if (file_exists($tmp_dir.'/'.$value.'.wav')) {
|
||||||
$tmp_name = $value.".wav";
|
$tmp_name = $value.".wav";
|
||||||
@@ -290,12 +290,12 @@ else {
|
|||||||
elseif (file_exists($tmp_dir.'/'.$value.'_1.mp3')) {
|
elseif (file_exists($tmp_dir.'/'.$value.'_1.mp3')) {
|
||||||
$tmp_name = $value."_1.mp3";
|
$tmp_name = $value."_1.mp3";
|
||||||
}
|
}
|
||||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_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 " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_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 " play";
|
echo " play";
|
||||||
echo " </a> ";
|
echo " </a> ";
|
||||||
}
|
}
|
||||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||||
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
||||||
echo " download";
|
echo " download";
|
||||||
echo " </a>";
|
echo " </a>";
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ if (strlen($id) > 0) {
|
|||||||
|
|
||||||
//delete the recordings
|
//delete the recordings
|
||||||
if (strlen($_SESSION['switch'][recordings]['dir']) > 0) {
|
if (strlen($_SESSION['switch'][recordings]['dir']) > 0) {
|
||||||
system('rm -rf '.$_SESSION['switch']['recordings']['dir'].'/'.$domain_name);
|
system('rm -rf '.$_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$domain_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//delete voicemail
|
//delete voicemail
|
||||||
|
|||||||
@@ -234,8 +234,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rename switch/recordings/[domain] (folder)
|
// rename switch/recordings/[domain] (folder)
|
||||||
if ( isset($_SESSION['switch']['recordings']['dir']) ) {
|
if ( isset($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']) ) {
|
||||||
$switch_recordings_dir = str_replace("/".$_SESSION["domain_name"], "", $_SESSION['switch']['recordings']['dir']);
|
$switch_recordings_dir = str_replace("/".$_SESSION["domain_name"], "", $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']);
|
||||||
if ( file_exists($switch_recordings_dir."/".$original_domain_name) ) {
|
if ( file_exists($switch_recordings_dir."/".$original_domain_name) ) {
|
||||||
@rename($switch_recordings_dir."/".$original_domain_name, $switch_recordings_dir."/".$domain_name); // folder
|
@rename($switch_recordings_dir."/".$original_domain_name, $switch_recordings_dir."/".$domain_name); // folder
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,10 @@
|
|||||||
default_language = session:getVariable("default_language");
|
default_language = session:getVariable("default_language");
|
||||||
default_dialect = session:getVariable("default_dialect");
|
default_dialect = session:getVariable("default_dialect");
|
||||||
--recording = session:getVariable("recording");
|
--recording = session:getVariable("recording");
|
||||||
|
domain_name = session:getVariable("domain_name");
|
||||||
|
|
||||||
|
--add the domain name to the recordings directory
|
||||||
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
|
|
||||||
--set the end epoch
|
--set the end epoch
|
||||||
end_epoch = os.time();
|
end_epoch = os.time();
|
||||||
@@ -339,6 +343,9 @@
|
|||||||
--freeswitch.consoleLog("notice", "[conference center] destination_number: " .. destination_number .. "\n");
|
--freeswitch.consoleLog("notice", "[conference center] destination_number: " .. destination_number .. "\n");
|
||||||
--freeswitch.consoleLog("notice", "[conference center] caller_id_number: " .. caller_id_number .. "\n");
|
--freeswitch.consoleLog("notice", "[conference center] caller_id_number: " .. caller_id_number .. "\n");
|
||||||
|
|
||||||
|
--add the domain name to the recordings directory
|
||||||
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
|
|
||||||
--set the sounds path for the language, dialect and voice
|
--set the sounds path for the language, dialect and voice
|
||||||
default_language = session:getVariable("default_language");
|
default_language = session:getVariable("default_language");
|
||||||
default_dialect = session:getVariable("default_dialect");
|
default_dialect = session:getVariable("default_dialect");
|
||||||
@@ -411,10 +418,6 @@
|
|||||||
|
|
||||||
--add the domain to the recording directory
|
--add the domain to the recording directory
|
||||||
freeswitch.consoleLog("notice", "[conference center] domain_count: " .. domain_count .. "\n");
|
freeswitch.consoleLog("notice", "[conference center] domain_count: " .. domain_count .. "\n");
|
||||||
if (domain_count > 1) then
|
|
||||||
recordings_dir = recordings_dir.."/"..domain_name;
|
|
||||||
freeswitch.consoleLog("notice", "[conference center] recordings_dir: " .. recordings_dir .. "\n");
|
|
||||||
end
|
|
||||||
|
|
||||||
--sounds
|
--sounds
|
||||||
enter_sound = "tone_stream://v=-20;%(100,1000,100);v=-20;%(90,60,440);%(90,60,620)";
|
enter_sound = "tone_stream://v=-20;%(100,1000,100);v=-20;%(90,60,440);%(90,60,620)";
|
||||||
|
|||||||
@@ -36,10 +36,8 @@
|
|||||||
--get the current time
|
--get the current time
|
||||||
start_epoch = os.time();
|
start_epoch = os.time();
|
||||||
|
|
||||||
--set the recording variable
|
--add the domain name to the recordings directory
|
||||||
if (domain_count > 1) then
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
recordings_dir = recordings_dir.."/"..domain_name;
|
|
||||||
end
|
|
||||||
recordings_dir = recordings_dir.."/archive/"..os.date("%Y", start_epoch).."/"..os.date("%b", start_epoch).."/"..os.date("%d", start_epoch);
|
recordings_dir = recordings_dir.."/archive/"..os.date("%Y", start_epoch).."/"..os.date("%b", start_epoch).."/"..os.date("%d", start_epoch);
|
||||||
mkdir(recordings_dir);
|
mkdir(recordings_dir);
|
||||||
recording = recordings_dir.."/"..conference_session_uuid;
|
recording = recordings_dir.."/"..conference_session_uuid;
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
destination_number = session:getVariable("destination_number");
|
destination_number = session:getVariable("destination_number");
|
||||||
call_direction = session:getVariable("call_direction");
|
call_direction = session:getVariable("call_direction");
|
||||||
domain_name = session:getVariable("domain_name");
|
domain_name = session:getVariable("domain_name");
|
||||||
recordings_dir = session:getVariable("recordings_dir");
|
|
||||||
|
|
||||||
--determine the call direction
|
--determine the call direction
|
||||||
if (call_direction == nil) then
|
if (call_direction == nil) then
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
|
|
||||||
sounds_dir = "";
|
sounds_dir = "";
|
||||||
recordings_dir = "";
|
|
||||||
pin_number = "";
|
pin_number = "";
|
||||||
max_tries = "3";
|
max_tries = "3";
|
||||||
digit_timeout = "3000";
|
digit_timeout = "3000";
|
||||||
|
|||||||
@@ -76,10 +76,8 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--set the recordings directory
|
--add the domain name to the recordings directory
|
||||||
if (domain_count > 1) then
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
recordings_dir = recordings_dir .. "/"..domain_name;
|
|
||||||
end
|
|
||||||
|
|
||||||
--set default variable(s)
|
--set default variable(s)
|
||||||
tries = 0;
|
tries = 0;
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
recording_slots = session:getVariable("recording_slots");
|
recording_slots = session:getVariable("recording_slots");
|
||||||
recording_prefix = session:getVariable("recording_prefix");
|
recording_prefix = session:getVariable("recording_prefix");
|
||||||
recording_name = session:getVariable("recording_name");
|
recording_name = session:getVariable("recording_name");
|
||||||
|
domain_name = session:getVariable("domain_name");
|
||||||
|
|
||||||
--select the recording number
|
--select the recording number
|
||||||
if (recording_slots) then
|
if (recording_slots) then
|
||||||
@@ -256,20 +257,9 @@ if ( session:ready() ) then
|
|||||||
domain_name = session:getVariable("domain_name");
|
domain_name = session:getVariable("domain_name");
|
||||||
domain_uuid = session:getVariable("domain_uuid");
|
domain_uuid = session:getVariable("domain_uuid");
|
||||||
|
|
||||||
--set the base recordings dir
|
--add the domain name to the recordings directory
|
||||||
base_recordings_dir = recordings_dir;
|
recordings_dir = recordings_dir .. "/"..domain_name;
|
||||||
|
|
||||||
--use the recording_dir when the variable is set
|
|
||||||
if (session:getVariable("recordings_dir")) then
|
|
||||||
if (base_recordings_dir ~= session:getVariable("recordings_dir")) then
|
|
||||||
recordings_dir = session:getVariable("recordings_dir");
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--get the recordings from the config.lua and append the domain_name if the system is multi-tenant
|
|
||||||
if (domain_count > 1) then
|
|
||||||
recordings_dir = recordings_dir .. "/" .. domain_name;
|
|
||||||
end
|
|
||||||
--set the sounds path for the language, dialect and voice
|
--set the sounds path for the language, dialect and voice
|
||||||
default_language = session:getVariable("default_language");
|
default_language = session:getVariable("default_language");
|
||||||
default_dialect = session:getVariable("default_dialect");
|
default_dialect = session:getVariable("default_dialect");
|
||||||
|
|||||||
Reference in New Issue
Block a user