summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-06 11:07:29 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-06 11:07:29 +0100
commitfd8a7b562664c00e2fc244af0a5a8f721d2b3e17 (patch)
tree4d063b31a48f85f977909bfc6ff5a28940f3a22a /misc/freeswitch/scripts/dialplan
parent3edd6e58ea3f5d25068ea9d47f639ae89e5f2c0c (diff)
parent500ef315442a7fad3647f9b58ae59ab70c45c4b8 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'misc/freeswitch/scripts/dialplan')
-rw-r--r--misc/freeswitch/scripts/dialplan/functions.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua
index 2ca51c8..32fad78 100644
--- a/misc/freeswitch/scripts/dialplan/functions.lua
+++ b/misc/freeswitch/scripts/dialplan/functions.lua
@@ -264,7 +264,7 @@ function Functions.account_node_change(self, caller)
-- resync caller phones
for index, phone_caller in ipairs(caller_phones) do
- local result = phone_caller:resync{ auth_name = caller_sip_account.auth_name, domain = caller.domain };
+ local result = phone_caller:resync{ auth_name = caller_sip_account.record.auth_name, domain = caller_sip_account.record.host };
self.log:info('NODE_CHANGE - resync phone - mac: ', phone_caller.record.mac_address, ', ip_address: ', phone_caller.record.ip_address, ', result: ', result);
end
@@ -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
@@ -374,13 +375,13 @@ function Functions.user_login(self, caller, number, pin)
-- resync destination phones
for index, phone_destination in ipairs(destination_phones) do
- local result = phone_destination:resync{ auth_name = destination_sip_account.auth_name, domain = caller.domain_local };
+ local result = phone_destination:resync{ auth_name = destination_sip_account.record.auth_name, domain = destination_sip_account.record.host };
self.log:info('LOGIN - resync destination phone - mac: ', phone_destination.record.mac_address, ', ip_address: ', phone_destination.record.ip_address, ', result: ', result);
end
-- resync caller phones
for index, phone_caller in ipairs(caller_phones) do
- local result = phone_caller:resync{ auth_name = caller_sip_account.auth_name, domain = caller.domain };
+ local result = phone_caller:resync{ auth_name = caller_sip_account.record.auth_name, domain = caller_sip_account.record.host };
self.log:info('LOGIN - resync caller phone - mac: ', phone_caller.record.mac_address, ', ip_address: ', phone_caller.record.ip_address, ', result: ', result);
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
@@ -426,7 +428,7 @@ function Functions.user_logout(self, caller)
-- resync caller phones
for index, phone_caller in ipairs(caller_phones) do
- local result = phone_caller:resync{ auth_name = caller_sip_account.auth_name, domain = caller.domain };
+ local result = phone_caller:resync{ auth_name = caller_sip_account.record.auth_name, domain = caller_sip_account.record.host };
self.log:info('LOGIN - resync caller phone - mac: ', phone_caller.record.mac_address, ', ip_address: ', phone_caller.record.ip_address, ', result: ', result);
end