mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
Get the uuid and record, use both to improve recordings.
This commit is contained in:
@@ -41,6 +41,7 @@ else {
|
||||
if (count($_GET)>0) {
|
||||
$cmd = trim(check_str($_GET["cmd"]));
|
||||
$name = trim(check_str($_GET["name"]));
|
||||
$uuid = trim(check_str($_GET["uuid"]));
|
||||
$data = trim(check_str($_GET["data"]));
|
||||
$id = trim(check_str($_GET["id"]));
|
||||
$direction = trim(check_str($_GET["direction"]));
|
||||
@@ -103,22 +104,21 @@ if (count($_GET)>0) {
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
|
||||
}
|
||||
elseif ($data == "record") {
|
||||
$switch_cmd .= $_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav";
|
||||
if (!file_exists($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav")) {
|
||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
||||
if (!file_exists($recording_dir."/".$uuid.".wav")) {
|
||||
$switch_result = event_socket_request($fp, "api ".$switch_cmd);
|
||||
}
|
||||
}
|
||||
elseif ($data == "norecord") {
|
||||
//stop recording and rename the file
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav")) {
|
||||
rename($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav", $_SESSION['switch']['recordings']['dir']."/".$name."-".date("Y").".".date("M").".".date("d")."-".uuid().".wav");
|
||||
}
|
||||
$switch_cmd .= $_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav";
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
}
|
||||
else {
|
||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||
$switch_cmd .= $recording_dir."/".$uuid.".wav";
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
}
|
||||
//else {
|
||||
// $switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,32 +43,32 @@ else {
|
||||
}
|
||||
else {
|
||||
//get the conference_uuid from the coference_name
|
||||
$sql = "select conference_uuid from v_conferences ";
|
||||
$sql .= "where conference_name = '".$conference_name."' ";
|
||||
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$conference_uuid = $row['conference_uuid'];
|
||||
}
|
||||
$sql = "select conference_uuid from v_conferences ";
|
||||
$sql .= "where conference_name = '".$conference_name."' ";
|
||||
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$conference_uuid = $row['conference_uuid'];
|
||||
}
|
||||
|
||||
//show only assigned extensions
|
||||
$sql = "select count(*) as num_rows from v_conferences as c, v_conference_users as u ";
|
||||
$sql .= "where c.conference_uuid = u.conference_uuid ";
|
||||
$sql .= "and c.conference_uuid = '".$conference_uuid."' ";
|
||||
$sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
$sql = "select count(*) as num_rows from v_conferences as c, v_conference_users as u ";
|
||||
$sql .= "where c.conference_uuid = u.conference_uuid ";
|
||||
$sql .= "and c.conference_uuid = '".$conference_uuid."' ";
|
||||
$sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//replace the space with underscore
|
||||
@@ -102,8 +102,10 @@ else {
|
||||
//echo $e->getMessage();
|
||||
}
|
||||
//$name = $xml->conference['name'];
|
||||
$session_uuid = $xml->conference['uuid'];
|
||||
$member_count = $xml->conference['member-count'];
|
||||
$locked = $xml->conference['locked'];
|
||||
$recording = $xml->conference['recording'];
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
@@ -124,12 +126,30 @@ else {
|
||||
if (permission_exists('conferences_active_record') || permission_exists('conferences_active_lock')) {
|
||||
echo " <strong>Conference Tools:</strong> \n";
|
||||
}
|
||||
|
||||
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||
$recording_name = '';
|
||||
if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) {
|
||||
$recording_name = $session_uuid.".wav";
|
||||
}
|
||||
elseif (file_exists($recording_dir.'/'.$row['uuid'].'.mp3')) {
|
||||
$recording_name = $session_uuid.".mp3";
|
||||
}
|
||||
|
||||
if (permission_exists('conferences_active_record')) {
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$conference_name."-tmp.wav")) {
|
||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=norecord');\">Stop Record</a> \n";
|
||||
if ($recording == "true") {
|
||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&uuid=".$session_uuid."&data=norecord');\">Stop Record</a> \n";
|
||||
}
|
||||
else {
|
||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=record');\">Start Record</a> \n";
|
||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&uuid=".$session_uuid."&data=record');\">Start Record</a> \n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($recording == "true") {
|
||||
echo " Recording ";
|
||||
}
|
||||
else {
|
||||
echo " Not Recording ";
|
||||
}
|
||||
}
|
||||
if (permission_exists('conferences_active_lock')) {
|
||||
|
||||
Reference in New Issue
Block a user