Change kick and kick all to uuid_kill so that the participant's call is logged to the database. Fix recordings and the announce that the call is being recorded for the first person to join the conference. Add a permission to control the conference session 'details' column in the conference sessions so CDR link can be hidden from the user. Don't allow a conference moderator and participant to use the same pin number.

This commit is contained in:
Mark Crane
2013-03-15 17:12:13 +00:00
parent 16223677ef
commit faeee96624
8 changed files with 128 additions and 67 deletions
+4
View File
@@ -85,6 +85,10 @@
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_session_details';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_room_profile';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
@@ -179,7 +179,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (strlen($moderator_pin) > 0) {
$sql = "select count(*) as num_rows from v_meeting_pins ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and meeting_uuid <> '".$meeting_uuid."' ";
//$sql .= "and meeting_uuid = '".$meeting_uuid."' ";
$sql .= "and member_pin = '".$moderator_pin."' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
@@ -191,7 +191,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
$sql = "select count(*) as num_rows from v_meeting_pins ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and meeting_uuid <> '".$meeting_uuid."' ";
//$sql .= "and meeting_uuid = '".$meeting_uuid."' ";
$sql .= "and member_pin = '".$participant_pin."' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
@@ -201,11 +201,14 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$msg .= "Please provide a unique participant pin number.<br>\n";
}
}
if ($moderator_pin == $participant_pin) {
$msg .= "Moderator and Participant PIN number must be unique.\n";
}
if (strlen($moderator_pin) != $pin_length) {
$msg .= "Please provide a moderator PIN number that is the required length\n";
$msg .= "Please provide a moderator PIN number that is the required length.\n";
}
if (strlen($participant_pin) != $pin_length) {
$msg .= "Please provide a participant PIN number that is the required length\n";
$msg .= "Please provide a participant PIN number that is the required length.\n";
}
}
@@ -177,7 +177,9 @@ else {
echo "<th>".$text['label-time']."</th>\n";
echo th_order_by('start_epoch', $text['label-start'], $order_by, $order);
echo th_order_by('end_epoch', $text['label-end'], $order_by, $order);
echo "<th>".$text['label-details']."</th>\n";
if (permission_exists('conference_session_details')) {
echo "<th>".$text['label-details']."</th>\n";
}
echo "<tr>\n";
if ($result_count > 0) {
@@ -204,7 +206,9 @@ else {
echo " <td valign='top' class='".$row_style[$c]."'>".$time_difference."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$start_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$end_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href='/app/xml_cdr/xml_cdr_details.php?uuid=".$row['uuid']."'>".$text['label-cdr']."</a>&nbsp;</td>\n";
if (permission_exists('conference_session_details')) {
echo " <td valign='top' class='".$row_style[$c]."'><a href='/app/xml_cdr/xml_cdr_details.php?uuid=".$row['uuid']."'>".$text['label-cdr']."</a>&nbsp;</td>\n";
}
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
+27 -25
View File
@@ -147,35 +147,37 @@ else {
$time_difference = gmdate("G:i:s", $time_difference);
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$time_difference."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$start_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$end_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile']."&nbsp;</td>\n";
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
$tmp_name = $row['conference_session_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.wav')) {
$tmp_name = $row['conference_session_uuid'].".wav";
}
echo " <td valign='top' class='".$row_style[$c]."'>\n";
echo " <a href='conference_session_details.php?uuid=".$row['conference_session_uuid']."'>".$text['label-details']."</a>&nbsp;\n";
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name)) {
if (permission_exists('conference_session_play')) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/recordings_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";
if (strlen( $row['start_epoch']) > 0) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$time_difference."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$start_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$end_date."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile']."&nbsp;</td>\n";
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
$tmp_name = $row['conference_session_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.wav')) {
$tmp_name = $row['conference_session_uuid'].".wav";
}
echo " <td valign='top' class='".$row_style[$c]."'>\n";
echo " <a href='conference_session_details.php?uuid=".$row['conference_session_uuid']."'>".$text['label-details']."</a>&nbsp;\n";
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name)) {
if (permission_exists('conference_session_play')) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/recordings_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";
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";
echo " &nbsp;\n";
echo " </td>\n";
echo "</tr>\n";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
+30 -2
View File
@@ -74,6 +74,30 @@ else {
exit;
}
//define an alternative kick all
function conference_end($fp, $name) {
$switch_cmd = "conference '".$name."' xml_list";
$xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
try {
$xml = new SimpleXMLElement($xml_str);
}
catch(Exception $e) {
//echo $e->getMessage();
}
$session_uuid = $xml->conference['uuid'];
$x = 0;
foreach ($xml->conference->members->member as $row) {
$switch_result = event_socket_request($fp, 'api uuid_kill '.$row->uuid);
if ($x < 1) {
usleep(500000); //500000 = 0.5 seconds
}
else {
usleep(10000); //1000000 = 0.01 seconds
}
$x++;
}
}
//execute the command
if (count($_GET) > 0) {
if (strlen($cmd) > 0) {
@@ -129,8 +153,12 @@ else {
$switch_cmd .= $recording_dir."/".$uuid.".wav";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
elseif ($data == "kick" || $data == "kick all") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
elseif ($data == "kick") {
$switch_result = event_socket_request($fp, 'api uuid_kill '.$uuid);
}
elseif ($data == "kick all") {
//$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
conference_end($fp, $name);
}
elseif ($data == "mute" || $data == "unmute" || $data == "mute non_moderator" || $data == "unmute non_moderator") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
@@ -268,7 +268,7 @@ else {
}
//kick someone from the conference
if (permission_exists('conferences_active_kick')) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=kick&id=".$id."');\">".$text['label-kick']."</a>&nbsp;\n";
echo " <a href='javascript:void(0);' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=kick&id=".$id."&uuid=".$uuid."');\">".$text['label-kick']."</a>&nbsp;\n";
}
echo " &nbsp;";
echo "</td>\n";
+2
View File
@@ -779,6 +779,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "and u.user_enabled = 'true' ";
$sql .= "and e.domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and e.extension_uuid = '".$extension_uuid."' ";
$sql .= "order by u.username asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@@ -797,6 +798,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql = "SELECT * FROM v_users ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and user_enabled = 'true' ";
$sql .= "order by username asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
echo " <select name=\"user_uuid\" class='frm'>\n";