This commit is contained in:
markjcrane 2015-12-09 17:19:26 -07:00
commit db12c8ebe5
11 changed files with 160 additions and 8 deletions

View File

@ -122,6 +122,17 @@ $text['label-no_answer']['sv-se'] = "Inget Svar ";
$text['label-no_answer']['uk'] = "Без відповіді";
$text['label-no_answer']['de-at'] = "Keine Antwort";
$text['label-not_registered']['en-us'] = "Not Registered";
$text['label-not_registered']['es-cl'] = "";
$text['label-not_registered']['pt-pt'] = "";
$text['label-not_registered']['fr-fr'] = "";
$text['label-not_registered']['it-it'] = "";
$text['label-not_registered']['pt-br'] = "";
$text['label-not_registered']['pl'] = "";
$text['label-not_registered']['sv-se'] = "";
$text['label-not_registered']['uk'] = "";
$text['label-not_registered']['de-at'] = "";
$text['label-ignore-busy']['en-us'] = "Ignore Busy";
$text['label-ignore-busy']['es-cl'] = "";
$text['label-ignore-busy']['pt-pt'] = "";
@ -335,6 +346,17 @@ $text['description-no_answer']['sv-se'] = "Om aktiverad, så tar den överhand f
$text['description-no_answer']['uk'] = "";
$text['description-no_answer']['de-at'] = "Falls aktiv, wird der Wert 'Mailbox eingeschaltet' in der Nebenstelle überschrieben";
$text['description-not_registered']['en-us'] = "If endpoint is not reachable, forward to this destination before going to voicemail.";
$text['description-not_registered']['es-cl'] = "";
$text['description-not_registered']['pt-pt'] = "";
$text['description-not_registered']['fr-fr'] = "";
$text['description-not_registered']['it-it'] = "";
$text['description-not_registered']['pt-br'] = "";
$text['description-not_registered']['pl'] = "";
$text['description-not_registered']['sv-se'] = "";
$text['description-not_registered']['uk'] = "";
$text['description-not_registered']['de-at'] = "";
$text['description-cid-number-prefix']['en-us'] = "Set the caller ID number prefix.";
$text['description-cid-number-prefix']['es-cl'] = "Configure el prefijo de número de caller ID.";
$text['description-cid-number-prefix']['pt-pt'] = "Defina o número do Chamador";
@ -493,4 +515,4 @@ $text['button-back']['sv-se'] = "Tillbaka ";
$text['button-back']['uk'] = "Назад";
$text['button-back']['de-at'] = "Zurück";
?>
?>

View File

@ -102,6 +102,8 @@ else {
$forward_busy_enabled = $row["forward_busy_enabled"];
$forward_no_answer_destination = $row["forward_no_answer_destination"];
$forward_no_answer_enabled = $row["forward_no_answer_enabled"];
$forward_user_not_registered_destination = $row["forward_user_not_registered_destination"];
$forward_user_not_registered_enabled = $row["forward_user_not_registered_enabled"];
$follow_me_uuid = $row["follow_me_uuid"];
$forward_caller_id_uuid = $row["forward_caller_id_uuid"];
break; //limit to 1 row
@ -122,6 +124,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$forward_busy_destination = check_str($_POST["forward_busy_destination"]);
$forward_no_answer_enabled = check_str($_POST["forward_no_answer_enabled"]);
$forward_no_answer_destination = check_str($_POST["forward_no_answer_destination"]);
$forward_user_not_registered_destination = check_str($_POST["forward_user_not_registered_destination"]);
$forward_user_not_registered_enabled = check_str($_POST["forward_user_not_registered_enabled"]);
$forward_caller_id_uuid = check_str($_POST["forward_caller_id_uuid"]);
$cid_name_prefix = check_str($_POST["cid_name_prefix"]);
$cid_number_prefix = check_str($_POST["cid_number_prefix"]);
@ -371,6 +375,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "forward_busy_enabled = '".$forward_busy_enabled."', ";
$sql .= "forward_no_answer_destination = '".$forward_no_answer_destination."', ";
$sql .= "forward_no_answer_enabled = '".$forward_no_answer_enabled."', ";
$sql .= "forward_user_not_registered_destination = '".$forward_user_not_registered_destination."', ";
$sql .= "forward_user_not_registered_enabled = '".$forward_user_not_registered_enabled."', ";
$sql .= "forward_caller_id_uuid = ".(($forward_caller_id_uuid != '') ? "'".$forward_caller_id_uuid."' " : "null ");
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and extension_uuid = '".$extension_uuid."'";
@ -596,6 +602,24 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "</tr>\n";
//CJB
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-not_registered']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$on_click = "document.getElementById('dnd_disabled').checked=true;";
$on_click .= "document.getElementById('forward_user_not_registered_destination').focus();";
echo " <label for='forward_user_not_registered_disabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_disabled' onclick=\"\" value='false' ".(($forward_user_not_registered_enabled == "false" || $forward_user_not_registered_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_user_not_registered_enabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_enabled' onclick=\"$on_click\" value='true' ".(($forward_user_not_registered_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;&nbsp;";
echo " <input class='formfld' type='text' name='forward_user_not_registered_destination' id='forward_user_not_registered_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".$forward_user_not_registered_destination."\">\n";
echo " <br />".$text['description-not_registered'].".\n";
echo "</td>\n";
echo "</tr>\n";
//CJB
echo "<tr><td colspan='2'><br /></td></tr>\n";
echo "<tr>\n";
@ -833,4 +857,4 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@ -99,7 +99,11 @@ else {
//prepare to page the results
$rows_per_page = 150;
$param = "";
if ($_GET['showall'] && permission_exists('device_all')) {
$param = "&showall=true";
} else {
$param = "";
}
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
@ -271,4 +275,4 @@ else {
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@ -12,6 +12,8 @@
<action application="set" data="forward_busy_destination=${user_data ${destination_number}@${domain_name} var forward_busy_destination}"/>
<action application="set" data="forward_no_answer_enabled=${user_data ${destination_number}@${domain_name} var forward_no_answer_enabled}"/>
<action application="set" data="forward_no_answer_destination=${user_data ${destination_number}@${domain_name} var forward_no_answer_destination}"/>
<action application="set" data="forward_user_not_registered_enabled=${user_data ${destination_number}@${domain_name} var forward_user_not_registered_enabled}"/>
<action application="set" data="forward_user_not_registered_destination=${user_data ${destination_number}@${domain_name} var forward_user_not_registered_destination}"/>
<action application="set" data="do_not_disturb=${user_data ${destination_number}@${domain_name} var do_not_disturb}"/>
<action application="set" data="call_timeout=${user_data ${destination_number}@${domain_name} var call_timeout}"/>
<action application="set" data="missed_call_app=${user_data ${destination_number}@${domain_name} var missed_call_app}"/>
@ -19,4 +21,4 @@
<action application="set" data="call_screen_enabled=${user_data ${destination_number}@${domain_name} var call_screen_enabled}" inline="true"/>
</condition>
</extension>
</context>
</context>

View File

@ -366,6 +366,14 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_destination";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";

View File

@ -382,6 +382,13 @@
if (strlen($row['forward_no_answer_destination']) > 0) {
$xml .= " <variable name=\"forward_no_answer_destination\" value=\"" . $row['forward_no_answer_destination'] . "\"/>\n";
}
if (strlen($row['forward_user_not_registered_enabled']) > 0) {
$xml .= " <variable name=\"forward_user_not_registered_enabled\" value=\"" . $row['forward_user_not_registered_enabled'] . "\"/>\n";
}
if (strlen($row['forward_user_not_registered_destination']) > 0) {
$xml .= " <variable name=\"forward_user_not_registered_destination\" value=\"" . $row['forward_user_not_registered_destination'] . "\"/>\n";
}
if (strlen($row['do_not_disturb']) > 0) {
$xml .= " <variable name=\"do_not_disturb\" value=\"" . $row['do_not_disturb'] . "\"/>\n";
}

View File

@ -615,6 +615,17 @@ $text['label-network_addr']['uk'] = "";
$text['label-network_addr']['de-at'] = "Netzwerk Adresse";
$text['label-network_addr']['he'] = "כתובת רשת";
$text['label-mos_score']['en-us'] = "MOS Score";
$text['label-mos_score']['es-cl'] = "";
$text['label-mos_score']['pt-pt'] = "";
$text['label-mos_score']['fr-fr'] = "";
$text['label-mos_score']['pt-br'] = "";
$text['label-mos_score']['pl'] = "";
$text['label-mos_score']['sv-se'] = "";
$text['label-mos_score']['uk'] = "";
$text['label-mos_score']['de-at'] = "";
$text['label-mos_score']['he'] = "";
$text['label-name']['en-us'] = "Name";
$text['label-name']['es-cl'] = "Nombre";
$text['label-name']['pt-pt'] = "Nome";
@ -1362,4 +1373,4 @@ $text['button-advanced_search']['uk'] = "";
$text['button-advanced_search']['de-at'] = "Erweiterte Suche";
$text['button-advanced_search']['he'] = "חיפוש מתקדם";
?>
?>

View File

@ -74,8 +74,36 @@ else {
$bridge_uuid = check_str($_REQUEST["network_addr"]);
$order_by = check_str($_REQUEST["order_by"]);
$order = check_str($_REQUEST["order"]);
if (strlen(check_str($_REQUEST["mos_comparison"])) > 0) {
switch(check_str($_REQUEST["mos_comparison"])) {
case 'less':
$mos_comparison = "<";
break;
case 'greater':
$mos_comparison = ">";
break;
case 'lessorequal':
$mos_comparison = "<=";
break;
case 'greaterorequal':
$mos_comparison = ">=";
break;
case 'equal':
$mos_comparison = "<";
break;
case 'notequal':
$mos_comparison = "<>";
break;
}
} else {
$mos_comparison = '';
}
//$mos_comparison = check_str($_REQUEST["mos_comparison"]);
$mos_score = check_str($_REQUEST["mos_score"]);
}
//build the sql where string
if ($missed == true) {
$sql_where_ands[] = "billsec = '0'";
@ -126,6 +154,7 @@ else {
if (strlen($write_codec) > 0) { $sql_where_ands[] = "write_codec like '%".$write_codec."%'"; }
if (strlen($remote_media_ip) > 0) { $sql_where_ands[] = "remote_media_ip like '%".$remote_media_ip."%'"; }
if (strlen($network_addr) > 0) { $sql_where_ands[] = "network_addr like '%".$network_addr."%'"; }
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) { $sql_where_ands[] = "rtp_audio_in_mos " . $mos_comparison . " ".$mos_score.""; }
//if not admin or superadmin, only show own calls
if (!permission_exists('xml_cdr_domain')) {
@ -201,6 +230,9 @@ else {
$param .= "&remote_media_ip=".$remote_media_ip;
$param .= "&network_addr=".$network_addr;
$param .= "&bridge_uuid=".$bridge_uuid;
$param .= "&mos_comparison=".$mos_comparison;
$param .= "&mos_score=".$mos_score;
if ($_GET['showall'] && permission_exists('xml_cdr_all')) {
$param .= "&showall=" . $_GET['showall'];
}
@ -297,6 +329,7 @@ else {
else {
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);

View File

@ -53,7 +53,7 @@ echo " if ($('#caller_id_number').is(':visible')) { $('#caller_id_number').foc
echo " }";
echo " }";
echo "</script>";
echo "<form method='post' action='xml_cdr.php'>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
@ -203,6 +203,20 @@ echo " <td class='vncell'>".$text['label-network_addr']."</td>";
echo " <td class='vtable'><input type='text' class='formfld' name='network_addr' value='$network_addr'></td>";
echo " </tr>";
echo " <tr>";
echo " <td class='vncell'>".$text['label-mos_score']."</td>";
echo " <td class='vtable'>";
echo " <select name='mos_comparison' class='formfld'>\n";
echo " <option value=''></option>\n";
echo " <option value='less'>&lt;</option>\n";
echo " <option value='greater'>&gt;</option>\n";
echo " <option value='lessorequal'>&lt;&#61;</option>\n";
echo " <option value='greaterorequal'>&gt;&#61;</option>\n";
echo " <option value='equal'>&#61;</option>\n";
echo " <option value='notequal'>&lt;&gt;</option>\n";
echo " </select>\n";
echo " <input type='text' class='formfld' name='mos_score' value='$mos_score'></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'><br><input type='submit' name='submit' class='btn' value='".$text['button-search']."'></td>";
echo " </tr>";
echo "</table>";

View File

@ -188,8 +188,25 @@
end
elseif (originate_disposition == "USER_NOT_REGISTERED") then
--handle USER_NOT_REGISTERED
forward_user_not_registered_enabled = session:getVariable("forward_user_not_registered_enabled");
if (forward_user_not_registered_enabled == "true") then
forward_user_not_registered_destination = session:getVariable("forward_user_not_registered_destination");
if (forward_user_not_registered_destination == nil) then
freeswitch.consoleLog("NOTICE", "[failure_handler] forwarding user not registered to hangup\n");
session:hangup("NO_ANSWER");
else
freeswitch.consoleLog("NOTICE", "[failure_handler] forwarding user not registerd to: " .. forward_user_not_registered_destination .. "\n");
session:transfer(forward_user_not_registered_destination, "XML", context);
end
else
--send missed call notification
missed();
end
--send missed call notification
missed();
--missed();
--handle USER_NOT_REGISTERED
if (debug["info"] ) then

View File

@ -251,6 +251,9 @@
forward_busy_destination = row.forward_busy_destination;
forward_no_answer_enabled = row.forward_no_answer_enabled;
forward_no_answer_destination = row.forward_no_answer_destination;
forward_user_not_registered_enabled = row.forward_user_not_registered_enabled;
forward_user_not_registered_destination = row.forward_user_not_registered_destination;
do_not_disturb = row.do_not_disturb;
--set the dial_string
@ -477,6 +480,13 @@
if (string.len(forward_no_answer_destination) > 0) then
table.insert(xml, [[ <variable name="forward_no_answer_destination" value="]] .. forward_no_answer_destination .. [["/>]]);
end
if (string.len(forward_user_not_registered_enabled) > 0) then
table.insert(xml, [[ <variable name="forward_user_not_registered_enabled" value="]] .. forward_user_not_registered_enabled .. [["/>]]);
end
if (string.len(forward_user_not_registered_destination) > 0) then
table.insert(xml, [[ <variable name="forward_user_not_registered_destination" value="]] .. forward_user_not_registered_destination .. [["/>]]);
end
if (string.len(do_not_disturb) > 0) then
table.insert(xml, [[ <variable name="do_not_disturb" value="]] .. do_not_disturb .. [["/>]]);
end