diff options
Diffstat (limited to 'misc')
-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 |