Update index.lua (#5443)

Update to use effective_caller_id_name when prefixed on inbound routes as the caller_id_name when recording voicemail details in database
This commit is contained in:
graycom-git 2020-09-08 16:52:54 +01:00 committed by GitHub
parent 93f5c996ae
commit d4cc92e21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -76,6 +76,7 @@
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");
voicemail_greeting_number = session:getVariable("voicemail_greeting_number");
skip_instructions = session:getVariable("skip_instructions");
skip_greeting = session:getVariable("skip_greeting");
@ -93,7 +94,11 @@
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
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
caller_id_number = string.sub(caller_id_number, 2, -1);