Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
@@ -3,9 +3,9 @@
|
|||||||
$apps[$x]['menu'][0]['title']['en-us'] = "Queues";
|
$apps[$x]['menu'][0]['title']['en-us'] = "Queues";
|
||||||
$apps[$x]['menu'][0]['title']['es-cl'] = "Colas";
|
$apps[$x]['menu'][0]['title']['es-cl'] = "Colas";
|
||||||
$apps[$x]['menu'][0]['title']['es-mx'] = "Colas";
|
$apps[$x]['menu'][0]['title']['es-mx'] = "Colas";
|
||||||
$apps[$x]['menu'][0]['title']['de-de'] = "";
|
$apps[$x]['menu'][0]['title']['de-de'] = "Warteschlangen";
|
||||||
$apps[$x]['menu'][0]['title']['de-ch'] = "";
|
$apps[$x]['menu'][0]['title']['de-ch'] = "Warteschlangen";
|
||||||
$apps[$x]['menu'][0]['title']['de-at'] = "";
|
$apps[$x]['menu'][0]['title']['de-at'] = "Warteschlangen";
|
||||||
$apps[$x]['menu'][0]['title']['fr-fr'] = "Queues";
|
$apps[$x]['menu'][0]['title']['fr-fr'] = "Queues";
|
||||||
$apps[$x]['menu'][0]['title']['fr-ca'] = "";
|
$apps[$x]['menu'][0]['title']['fr-ca'] = "";
|
||||||
$apps[$x]['menu'][0]['title']['fr-ch'] = "";
|
$apps[$x]['menu'][0]['title']['fr-ch'] = "";
|
||||||
@@ -19,4 +19,4 @@ $apps[$x]['menu'][0]['path'] = "/app/dialplan/dialplans.php?app_uuid=16589224-c8
|
|||||||
$apps[$x]['menu'][0]['groups'][] = "admin";
|
$apps[$x]['menu'][0]['groups'][] = "admin";
|
||||||
$apps[$x]['menu'][0]['groups'][] = "superadmin";
|
$apps[$x]['menu'][0]['groups'][] = "superadmin";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
$apps[$x]['menu'][0]['title']['en-us'] = "Follow Me";
|
$apps[$x]['menu'][0]['title']['en-us'] = "Follow Me";
|
||||||
$apps[$x]['menu'][0]['title']['es-mx'] = "Sígueme";
|
$apps[$x]['menu'][0]['title']['es-mx'] = "Sígueme";
|
||||||
$apps[$x]['menu'][0]['title']['de-de'] = "";
|
$apps[$x]['menu'][0]['title']['de-de'] = "Follow Me";
|
||||||
$apps[$x]['menu'][0]['title']['de-ch'] = "";
|
$apps[$x]['menu'][0]['title']['de-ch'] = "Follow Me";
|
||||||
$apps[$x]['menu'][0]['title']['de-at'] = "";
|
$apps[$x]['menu'][0]['title']['de-at'] = "Follow Me";
|
||||||
$apps[$x]['menu'][0]['title']['fr-fr'] = "Follow Me";
|
$apps[$x]['menu'][0]['title']['fr-fr'] = "Follow Me";
|
||||||
$apps[$x]['menu'][0]['title']['fr-ca'] = "";
|
$apps[$x]['menu'][0]['title']['fr-ca'] = "";
|
||||||
$apps[$x]['menu'][0]['title']['fr-ch'] = "";
|
$apps[$x]['menu'][0]['title']['fr-ch'] = "";
|
||||||
@@ -18,4 +18,4 @@
|
|||||||
$apps[$x]['menu'][0]['groups'][] = "admin";
|
$apps[$x]['menu'][0]['groups'][] = "admin";
|
||||||
$apps[$x]['menu'][0]['groups'][] = "superadmin";
|
$apps[$x]['menu'][0]['groups'][] = "superadmin";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|||||||
$domain_uuid = $row["domain_uuid"];
|
$domain_uuid = $row["domain_uuid"];
|
||||||
}
|
}
|
||||||
unset($result, $prep_statement);
|
unset($result, $prep_statement);
|
||||||
|
$_SESSION['domain_uuid'] = $domain_uuid;
|
||||||
|
|
||||||
//get the domain name
|
//get the domain name
|
||||||
$domain_name = $_SESSION['domains'][$domain_uuid]['domain_name'];
|
$domain_name = $_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||||
@@ -311,4 +312,4 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|||||||
return $needed_parts ? false : $data;
|
return $needed_parts ? false : $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -471,21 +471,21 @@ else {
|
|||||||
switch ($row['direction']) {
|
switch ($row['direction']) {
|
||||||
case "inbound" :
|
case "inbound" :
|
||||||
if ($row['billsec'] == 0)
|
if ($row['billsec'] == 0)
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_missed.png' style='border: none;' title='".$text['label-inbound']." ".$text['label-missed']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_missed.png' width='16' style='border: none;' title='".$text['label-inbound']." ".$text['label-missed']."'>\n";
|
||||||
else
|
else
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_connected.png' style='border: none;' title='".$text['label-inbound']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_connected.png' width='16' style='border: none;' title='".$text['label-inbound']."'>\n";
|
||||||
break;
|
break;
|
||||||
case "outbound" :
|
case "outbound" :
|
||||||
if ($row['billsec'] == 0)
|
if ($row['billsec'] == 0)
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_failed.png' style='border: none;' title='".$text['label-outbound']." ".$text['label-failed']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_failed.png' width='16' style='border: none;' title='".$text['label-outbound']." ".$text['label-failed']."'>\n";
|
||||||
else
|
else
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_connected.png' style='border: none;' title='".$text['label-outbound']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_outbound_connected.png' width='16' style='border: none;' title='".$text['label-outbound']."'>\n";
|
||||||
break;
|
break;
|
||||||
case "local" :
|
case "local" :
|
||||||
if ($row['billsec'] == 0)
|
if ($row['billsec'] == 0)
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_failed.png' style='border: none;' title='".$text['label-local']." ".$text['label-failed']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_failed.png' width='16' style='border: none;' title='".$text['label-local']." ".$text['label-failed']."'>\n";
|
||||||
else
|
else
|
||||||
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_connected.png' style='border: none;' title='".$text['label-local']."'>\n";
|
echo "<img src='/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_local_connected.png' width='16' style='border: none;' title='".$text['label-local']."'>\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
echo " ";
|
echo " ";
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
-- Luis Daniel Lucio Qurioz <dlucio@okay.com.mx>
|
-- Luis Daniel Lucio Qurioz <dlucio@okay.com.mx>
|
||||||
|
|
||||||
|
local log = require "resources.functions.log".ring_group
|
||||||
|
|
||||||
--connect to the database
|
--connect to the database
|
||||||
require "resources.functions.database_handle";
|
require "resources.functions.database_handle";
|
||||||
dbh = database_handle('system');
|
dbh = database_handle('system');
|
||||||
@@ -618,10 +620,23 @@
|
|||||||
end
|
end
|
||||||
freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
|
freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
|
||||||
session:execute("bridge", app_data);
|
session:execute("bridge", app_data);
|
||||||
|
-- log.noticef("bridge done: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false")
|
||||||
end
|
end
|
||||||
|
|
||||||
--timeout destination
|
--timeout destination
|
||||||
if (app_data ~= nil) then
|
if (app_data ~= nil) then
|
||||||
|
if ring_group_strategy == "enterprise"
|
||||||
|
and ( true
|
||||||
|
--- I see 2 errors here `failure` and `PICKED_OFF`
|
||||||
|
--- but they be more. I think check `answered` is enough.
|
||||||
|
-- or session:getVariable("originate_disposition") == "failure"
|
||||||
|
-- or session:getVariable("originate_disposition") == "PICKED_OFF"
|
||||||
|
)
|
||||||
|
and session:answered() then
|
||||||
|
-- for enterprise calls when intercept we get "failure" but session answered
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||||
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
||||||
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"
|
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"
|
||||||
|
|||||||
@@ -32,9 +32,9 @@
|
|||||||
sql = [[SELECT extension, number_alias from v_extensions
|
sql = [[SELECT extension, number_alias from v_extensions
|
||||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||||
AND (mwi_account = ']]..voicemail_id..[[' or mwi_account = ']]..voicemail_id..[[@]]..domain_name..[[')]];
|
AND (mwi_account = ']]..voicemail_id..[[' or mwi_account = ']]..voicemail_id..[[@]]..domain_name..[[')]];
|
||||||
--if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||||
--end
|
end
|
||||||
status = dbh:query(sql, function(row)
|
status = dbh:query(sql, function(row)
|
||||||
if (string.len(row["number_alias"]) > 0) then
|
if (string.len(row["number_alias"]) > 0) then
|
||||||
table.insert(accounts, row["number_alias"]);
|
table.insert(accounts, row["number_alias"]);
|
||||||
@@ -74,4 +74,4 @@
|
|||||||
event:addHeader("MWI-Voice-Message", message_count.."/0 ("..message_count.."/0)");
|
event:addHeader("MWI-Voice-Message", message_count.."/0 ("..message_count.."/0)");
|
||||||
event:fire();
|
event:fire();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
--add the function
|
--add the function
|
||||||
require "resources.functions.trim";
|
require "resources.functions.trim";
|
||||||
|
require "resources.functions.channel_utils";
|
||||||
|
|
||||||
--exits the script if we didn't connect properly
|
--exits the script if we didn't connect properly
|
||||||
assert(dbh:connected());
|
assert(dbh:connected());
|
||||||
@@ -119,7 +120,7 @@ if ( session:ready() ) then
|
|||||||
callee_num = '';
|
callee_num = '';
|
||||||
|
|
||||||
--check the database to get the uuid of a ringing call
|
--check the database to get the uuid of a ringing call
|
||||||
sql = "select call_uuid as uuid, hostname, callee_num, ip_addr from channels ";
|
sql = "select uuid, call_uuid, hostname, callee_num, ip_addr from channels ";
|
||||||
sql = sql .. "where callstate in ('RINGING', 'EARLY') ";
|
sql = sql .. "where callstate in ('RINGING', 'EARLY') ";
|
||||||
--sql = sql .. "AND direction = 'outbound' ";
|
--sql = sql .. "AND direction = 'outbound' ";
|
||||||
if (extension) then
|
if (extension) then
|
||||||
@@ -132,11 +133,18 @@ if ( session:ready() ) then
|
|||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("NOTICE", "sql "..sql.."\n");
|
freeswitch.consoleLog("NOTICE", "sql "..sql.."\n");
|
||||||
end
|
end
|
||||||
dbh:query(sql, function(result)
|
dbh:query(sql, function(result)
|
||||||
--for key, val in pairs(result) do
|
--for key, val in pairs(result) do
|
||||||
-- freeswitch.consoleLog("NOTICE", "result "..key.." "..val.."\n");
|
-- freeswitch.consoleLog("NOTICE", "result "..key.." "..val.."\n");
|
||||||
--end
|
--end
|
||||||
uuid = result.uuid;
|
if result.uuid == result.call_uuid then
|
||||||
|
uuid = channel_variable(result.uuid, 'ent_originate_aleg_uuid') or
|
||||||
|
channel_variable(result.uuid, 'cc_member_session_uuid') or
|
||||||
|
channel_variable(result.uuid, 'fifo_bridge_uuid') or
|
||||||
|
result.uuid
|
||||||
|
else
|
||||||
|
uuid = result.call_uuid;
|
||||||
|
end
|
||||||
call_hostname = result.hostname;
|
call_hostname = result.hostname;
|
||||||
callee_num = result.callee_num;
|
callee_num = result.callee_num;
|
||||||
end);
|
end);
|
||||||
|
|||||||
@@ -35,11 +35,19 @@
|
|||||||
|
|
||||||
--add the function
|
--add the function
|
||||||
require "resources.functions.explode";
|
require "resources.functions.explode";
|
||||||
|
require "resources.functions.trim";
|
||||||
|
require "resources.functions.channel_utils";
|
||||||
|
|
||||||
|
--prepare the api object
|
||||||
|
api = freeswitch.API();
|
||||||
|
|
||||||
--connect to the database
|
--connect to the database
|
||||||
require "resources.functions.database_handle";
|
require "resources.functions.database_handle";
|
||||||
dbh = database_handle('system');
|
dbh = database_handle('system');
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
hostname = trim(api:execute("switchname", ""));
|
||||||
|
|
||||||
--check if the session is ready
|
--check if the session is ready
|
||||||
if ( session:ready() ) then
|
if ( session:ready() ) then
|
||||||
--answer the session
|
--answer the session
|
||||||
@@ -163,7 +171,7 @@
|
|||||||
|
|
||||||
--check the database to get the uuid of a ringing call
|
--check the database to get the uuid of a ringing call
|
||||||
call_hostname = "";
|
call_hostname = "";
|
||||||
sql = "SELECT call_uuid AS uuid, hostname, ip_addr FROM channels ";
|
sql = "SELECT uuid, call_uuid, hostname, ip_addr FROM channels ";
|
||||||
sql = sql .. "WHERE callstate in ('RINGING', 'EARLY') ";
|
sql = sql .. "WHERE callstate in ('RINGING', 'EARLY') ";
|
||||||
--sql = sql .. "AND direction = 'outbound' ";
|
--sql = sql .. "AND direction = 'outbound' ";
|
||||||
sql = sql .. "AND (";
|
sql = sql .. "AND (";
|
||||||
@@ -189,14 +197,19 @@
|
|||||||
--for key, val in pairs(row) do
|
--for key, val in pairs(row) do
|
||||||
-- freeswitch.consoleLog("NOTICE", "row "..key.." "..val.."\n");
|
-- freeswitch.consoleLog("NOTICE", "row "..key.." "..val.."\n");
|
||||||
--end
|
--end
|
||||||
uuid = row.uuid;
|
if row.uuid == row.call_uuid then
|
||||||
|
uuid = channel_variable(row.uuid, 'ent_originate_aleg_uuid') or
|
||||||
|
channel_variable(row.uuid, 'cc_member_session_uuid') or
|
||||||
|
channel_variable(row.uuid, 'fifo_bridge_uuid') or
|
||||||
|
row.uuid
|
||||||
|
else
|
||||||
|
uuid = row.call_uuid;
|
||||||
|
end
|
||||||
call_hostname = row.hostname;
|
call_hostname = row.hostname;
|
||||||
ip_addr = row.ip_addr;
|
ip_addr = row.ip_addr;
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
--get the hostname
|
|
||||||
hostname = freeswitch.getGlobalVariable("hostname");
|
|
||||||
freeswitch.consoleLog("NOTICE", "Hostname:"..hostname.." Call Hostname:"..call_hostname.."\n");
|
freeswitch.consoleLog("NOTICE", "Hostname:"..hostname.." Call Hostname:"..call_hostname.."\n");
|
||||||
|
|
||||||
--intercept a call that is ringing
|
--intercept a call that is ringing
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
local api = api or freeswitch.API()
|
||||||
|
|
||||||
|
function channel_variable(uuid, name)
|
||||||
|
local result = api:executeString("uuid_getvar " .. uuid .. " " .. name)
|
||||||
|
|
||||||
|
if result:sub(1, 4) == '-ERR' then return nil, result end
|
||||||
|
if result == '_undef_' then return false end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
function channel_evalute(uuid, cmd)
|
||||||
|
local result = api:executeString("eval uuid:" .. uuid .. " " .. cmd)
|
||||||
|
|
||||||
|
if result:sub(1, 4) == '-ERR' then return nil, result end
|
||||||
|
if result == '_undef_' then return false end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
@@ -501,7 +501,8 @@ function outbound_route_to_bridge ($domain_uuid, $destination_number) {
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$destination_number = trim($destination_number);
|
$destination_number = trim($destination_number);
|
||||||
if (is_numeric($destination_number)) {
|
preg_match('/^[\*\+0-9]*$/', $destination_number, $matches, PREG_OFFSET_CAPTURE);
|
||||||
|
if (count($matches) > 0) {
|
||||||
//not found, continue to process the function
|
//not found, continue to process the function
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1443,4 +1444,4 @@ if (!function_exists('save_switch_xml')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user