Update page.lua

Update page.lua add support for rtp_secure_media=true.
This commit is contained in:
FusionPBX
2016-07-06 14:48:00 -06:00
committed by GitHub
parent ec26328577
commit 0f84dbc9cd
+11 -2
View File
@@ -58,6 +58,7 @@
domain_name = session:getVariable("domain_name"); domain_name = session:getVariable("domain_name");
sounds_dir = session:getVariable("sounds_dir"); sounds_dir = session:getVariable("sounds_dir");
destinations = session:getVariable("destinations"); destinations = session:getVariable("destinations");
rtp_secure_media = session:getVariable("rtp_secure_media");
if (destinations == nil) then if (destinations == nil) then
destinations = session:getVariable("extension_list"); destinations = session:getVariable("extension_list");
end end
@@ -75,8 +76,15 @@
if (not default_dialect) then default_dialect = 'us'; end if (not default_dialect) then default_dialect = 'us'; end
if (not default_voice) then default_voice = 'callie'; end if (not default_voice) then default_voice = 'callie'; end
--set rtp_secure_media to an empty string if not provided.
if (rtp_secure_media == nil) then
rtp_secure_media = 'false';
end
--define the conference name
local conference_name = "page-"..destination_number.."-"..domain_name.."@page" local conference_name = "page-"..destination_number.."-"..domain_name.."@page"
--set the caller id
if (caller_id_name) then if (caller_id_name) then
--caller id name provided do nothing --caller id name provided do nothing
else else
@@ -126,6 +134,7 @@
end end
end end
--originate the calls
destination_count = 0; destination_count = 0;
api = freeswitch.API(); api = freeswitch.API();
for index,value in pairs(destination_table) do for index,value in pairs(destination_table) do
@@ -155,7 +164,7 @@
--this destination is the caller that initated the page --this destination is the caller that initated the page
else else
--originate the call --originate the call
cmd_string = "bgapi originate {sip_auto_answer=true,sip_h_Alert-Info='Ring Answer',hangup_after_bridge=false,origination_caller_id_name='"..caller_id_name.."',origination_caller_id_number="..caller_id_number.."}user/"..destination.."@"..domain_name.." conference:"..conference_name.."+"..flags.." inline"; cmd_string = "bgapi originate {sip_auto_answer=true,sip_h_Alert-Info='Ring Answer',hangup_after_bridge=false,rtp_secure_media="..rtp_secure_media..",origination_caller_id_name='"..caller_id_name.."',origination_caller_id_number="..caller_id_number.."}user/"..destination.."@"..domain_name.." conference:"..conference_name.."+"..flags.." inline";
api:executeString(cmd_string); api:executeString(cmd_string);
destination_count = destination_count + 1; destination_count = destination_count + 1;
end end
@@ -170,7 +179,7 @@
--this destination is the caller that initated the page --this destination is the caller that initated the page
else else
--originate the call --originate the call
cmd_string = "bgapi originate {sip_auto_answer=true,hangup_after_bridge=false,origination_caller_id_name='"..caller_id_name.."',origination_caller_id_number="..caller_id_number.."}user/"..destination.."@"..domain_name.." conference:"..conference_name.."+"..flags.." inline"; cmd_string = "bgapi originate {sip_auto_answer=true,hangup_after_bridge=false,rtp_secure_media="..rtp_secure_media..",origination_caller_id_name='"..caller_id_name.."',origination_caller_id_number="..caller_id_number.."}user/"..destination.."@"..domain_name.." conference:"..conference_name.."+"..flags.." inline";
api:executeString(cmd_string); api:executeString(cmd_string);
destination_count = destination_count + 1; destination_count = destination_count + 1;
end end