diff options
author | spag <spag@golwen.net> | 2013-03-01 07:38:50 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-03-01 07:38:50 +0100 |
commit | 351fdd558c7a14b2a9fd7992ade8adebe71f4688 (patch) | |
tree | e050ca61b4f3c0f9f1e2d234f2e47f7ff4e8d959 /misc/freeswitch/scripts | |
parent | f9675ecb2a7415ecb8e1f5cc7abcc0dd75dac7f6 (diff) |
f-ig dialplan function added
Diffstat (limited to 'misc/freeswitch/scripts')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/functions.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua index 3706872..e3a8675 100644 --- a/misc/freeswitch/scripts/dialplan/functions.lua +++ b/misc/freeswitch/scripts/dialplan/functions.lua @@ -37,6 +37,8 @@ function Functions.dialplan_function(self, caller, dialed_number) result = self:transfer_all(caller, parameters[3]); elseif fid == "ia" then result = self:intercept_any_number(caller, parameters[3]); + elseif fid == "ig" then + result = self:group_pickup(caller, parameters[3]); elseif fid == "anc" then result = self:account_node_change(caller); elseif fid == "li" then @@ -173,6 +175,18 @@ function Functions.intercept_any_number(self, caller, destination_number) end +function Functions.group_pickup(self, caller, group_id) + if not tonumber(group_id) then + return { continue = false, code = 505, phrase = 'Incompatible destination', no_cdr = true }; + end + + caller:set_variable('gs_pickup_group_pick', 'g' .. group_id); + caller:execute('pickup', 'g' .. group_id); + + return { continue = false, code = 200, phrase = 'OK', no_cdr = true } +end + + function Functions.account_node_change(self, caller) self.log:info('NODE_CHANGE - caller: ', caller.account_type, '/', caller.account_uuid, ', caller_id: ', caller.caller_id_number); |