mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add fallback method to get caller_id
This commit is contained in:
@@ -72,11 +72,12 @@
|
||||
voicemail_id = session:getVariable("voicemail_id");
|
||||
voicemail_action = session:getVariable("voicemail_action");
|
||||
destination_number = session:getVariable("destination_number");
|
||||
caller_id = session:getVariable("caller_id");
|
||||
caller_id_name = session:getVariable("caller_id_name");
|
||||
caller_id_number = session:getVariable("caller_id_number");
|
||||
current_time_zone = session:getVariable("timezone");
|
||||
effective_caller_id_number = session:getVariable("effective_caller_id_number");
|
||||
effective_caller_id_name = session:getVariable("effective_caller_id_name");
|
||||
current_time_zone = session:getVariable("timezone");
|
||||
voicemail_greeting_number = session:getVariable("voicemail_greeting_number");
|
||||
skip_instructions = session:getVariable("skip_instructions");
|
||||
skip_options = session:getVariable("skip_options");
|
||||
@@ -92,19 +93,25 @@
|
||||
sip_number_alias = session:getVariable("sip_number_alias");
|
||||
origination_callee_id_name = session:getVariable("origination_callee_id_name");
|
||||
|
||||
--modify caller_id_number if effective_caller_id_number is set
|
||||
if (effective_caller_id_number ~= nil) then
|
||||
caller_id_number = effective_caller_id_number;
|
||||
end
|
||||
--modify caller_id_name if effective_caller_id_name is set
|
||||
--set the caller id name and number
|
||||
--modify caller_id_name if effective_caller_id_name is set
|
||||
if (effective_caller_id_name ~= nil) then
|
||||
caller_id_name = effective_caller_id_name;
|
||||
end
|
||||
|
||||
--set default values
|
||||
if (string.sub(caller_id_number, 1, 1) == "/") then
|
||||
--modify caller_id_number if effective_caller_id_number is set
|
||||
if (effective_caller_id_number ~= nil) then
|
||||
caller_id_number = effective_caller_id_number;
|
||||
end
|
||||
--extract the caller_id_number from caller_id if the caller_id_number is nil
|
||||
if (caller_id_number == nil and caller_id ~= nil) then
|
||||
caller_id_number = string.match(caller_id, '<(%d+)>')
|
||||
end
|
||||
--remove leading forward slash
|
||||
if (caller_id_name ~= nil and string.sub(caller_id_number, 1, 1) == "/") then
|
||||
caller_id_number = string.sub(caller_id_number, 2, -1);
|
||||
end
|
||||
|
||||
--set default values
|
||||
if (not record_silence_threshold) then
|
||||
record_silence_threshold = 300;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user