diff options
author | Peter Kozak <spag@golwen.net> | 2013-07-31 08:53:14 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-07-31 08:53:14 +0200 |
commit | 0ae2c077c6be0be7ad05bd6a0e090b388c7c490f (patch) | |
tree | 9d31e516ff8fe843266a7adefac4c952a7c863d4 | |
parent | 9045b821f35a329bb13501942162697229dbda0c (diff) |
phone.record can be nil
-rw-r--r-- | misc/freeswitch/scripts/phones/phone.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/misc/freeswitch/scripts/phones/phone.lua b/misc/freeswitch/scripts/phones/phone.lua index a256b12..6219eb1 100644 --- a/misc/freeswitch/scripts/phones/phone.lua +++ b/misc/freeswitch/scripts/phones/phone.lua @@ -115,10 +115,13 @@ end function Phone.resync(self, arg) local result = nil; - arg.ip_address = arg.ip_address or self.record.ip_address; - arg.http_user = arg.http_user or self.record.http_user; - arg.http_password = arg.http_password or self.record.http_password; - + + if self.record then + arg.ip_address = arg.ip_address or self.record.ip_address; + arg.http_user = arg.http_user or self.record.http_user; + arg.http_password = arg.http_password or self.record.http_password; + end + if self.model then result = self.model:resync(arg); else @@ -127,7 +130,9 @@ function Phone.resync(self, arg) result = phones.snom.Snom:new{ log = self.log }:resync(arg); end - self:resync_extension_modules(arg); + if self.record and self.record.id then + self:resync_extension_modules(arg); + end return result; end |