From 64912b6266ae449a2052f51e769ce59950b70da8 Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 6 Feb 2013 10:27:46 +0100 Subject: try to resync if phone not found --- misc/freeswitch/scripts/dialplan/functions.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'misc') 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 -- cgit v1.2.3