SIP: Return "NO_ANSWER" instead of "NORMAL_CLEARING" if an extension is called with voicemail disabled. Implements patch suggested in Issue 920. Thanks.
This commit is contained in:
@@ -58,19 +58,6 @@
|
||||
|
||||
--if the session exists
|
||||
if (session ~= nil) then
|
||||
--answer the session
|
||||
if (session:ready()) then
|
||||
session:answer();
|
||||
end
|
||||
|
||||
--unset bind meta app
|
||||
session:execute("unbind_meta_app", "");
|
||||
|
||||
--set the callback function
|
||||
if (session:ready()) then
|
||||
session:setVariable("playback_terminators", "#");
|
||||
session:setInputCallback("on_dtmf", "");
|
||||
end
|
||||
|
||||
--get session variables
|
||||
context = session:getVariable("context");
|
||||
@@ -190,6 +177,23 @@
|
||||
if (voicemail_attach_file == nil) then
|
||||
voicemail_attach_file = "true";
|
||||
end
|
||||
|
||||
--valid voicemail
|
||||
if (voicemail_uuid ~= nil) then
|
||||
--answer the session
|
||||
if (session:ready()) then
|
||||
session:answer();
|
||||
end
|
||||
|
||||
--unset bind meta app
|
||||
session:execute("unbind_meta_app", "");
|
||||
|
||||
--set the callback function
|
||||
if (session:ready()) then
|
||||
session:setVariable("playback_terminators", "#");
|
||||
session:setInputCallback("on_dtmf", "");
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -467,6 +471,8 @@
|
||||
if (referred_by) then
|
||||
referred_by = referred_by:match('[%d]+');
|
||||
session:transfer(referred_by, "XML", context);
|
||||
else
|
||||
session:hangup("NO_ANSWER");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user