diff options
author | Peter Kozak <spag@golwen.net> | 2013-03-07 15:58:22 -0500 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-03-07 15:58:22 -0500 |
commit | efb96cfaa79b98fa5eb3c2ca704e83af31e77730 (patch) | |
tree | 72714e05b2e29d2735b912e72cb2fc4ff0c30b00 /misc/freeswitch/scripts/dialplan/voicemail.lua | |
parent | 2abc9cfb22e55b709a21b041e04a8221f605e9d7 (diff) |
voicemail honors destination number
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/voicemail.lua')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/voicemail.lua | 9 |
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; |