summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan/voicemail.lua
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
commitdf6e17e48995f25e72509986f30700d778b179b6 (patch)
treef432c24b8e4ad81009188650dabfd99194883265 /misc/freeswitch/scripts/dialplan/voicemail.lua
parent11f186a118285fbc87a536af26730780a9ad01f5 (diff)
parentcce94a74aa5c9691f9b37cd9be5a6831f8063812 (diff)
Merge branch 'develop'5.1.2
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/voicemail.lua')
-rw-r--r--misc/freeswitch/scripts/dialplan/voicemail.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/misc/freeswitch/scripts/dialplan/voicemail.lua b/misc/freeswitch/scripts/dialplan/voicemail.lua
index ae7d0a1..caeeb48 100644
--- a/misc/freeswitch/scripts/dialplan/voicemail.lua
+++ b/misc/freeswitch/scripts/dialplan/voicemail.lua
@@ -66,15 +66,14 @@ function Voicemail.find_by_name(self, account_name)
return voicemail_account
end
--- Find Voicemail account by name
+-- Find Voicemail account by number
function Voicemail.find_by_number(self, phone_number)
local sip_account = nil;
require "common.phone_number"
- local phone_number_class = common.phone_number.PhoneNumber:new{ log = self.log, database = self.database };
- local destination_number_object = phone_number_class:find_by_number(phone_number);
- if destination_number_object and destination_number_object.record.phone_numberable_type == "SipAccount" then
- return Voicemail:find_by_sip_account_id(destination_number_object.record.phone_numberable_id);
+ local destination_number_object = common.phone_number.PhoneNumber:new{ log = self.log, database = self.database }:find_by_number(phone_number);
+ if destination_number_object and destination_number_object.record.phone_numberable_type:lower() == "sipaccount" then
+ return self:find_by_sip_account_id(destination_number_object.record.phone_numberable_id);
end
return false;