summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan/functions.lua
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-06 10:27:46 +0100
committerspag <spag@golwen.net>2013-02-06 10:27:46 +0100
commit64912b6266ae449a2052f51e769ce59950b70da8 (patch)
treea76cce946f37ec430dbc51a995253383be953348 /misc/freeswitch/scripts/dialplan/functions.lua
parent9a140ffba197b1b09350509169c229abc82ecec0 (diff)
try to resync if phone not found
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/functions.lua')
-rw-r--r--misc/freeswitch/scripts/dialplan/functions.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua
index 61c86aa..32fad78 100644
--- a/misc/freeswitch/scripts/dialplan/functions.lua
+++ b/misc/freeswitch/scripts/dialplan/functions.lua
@@ -302,6 +302,7 @@ function Functions.user_login(self, caller, number, pin)
if not caller_phone then
self.log:notice('LOGIN - caller phone not found or not hot-deskable');
+ local result = phone_class:resync{ auth_name = caller_sip_account.record.auth_name, domain = caller_sip_account.record.host };
return { continue = false, code = 403, phrase = 'Phone not hot-deskable', no_cdr = true }
end
@@ -409,8 +410,9 @@ function Functions.user_logout(self, caller)
local caller_phones = phone_class:find_all_hot_deskable_by_account(caller_sip_account.id);
- if caller_phones == 0 then
+ if #caller_phones == 0 then
self.log:notice('LOGOUT - caller phones not found or not hot-deskable');
+ local result = phone_class:resync{ auth_name = caller_sip_account.record.auth_name, domain = caller_sip_account.record.host };
return { continue = false, code = 403, phrase = 'Phone not hot-deskable', no_cdr = true }
end