summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-15 05:05:25 -0400
committerPeter Kozak <spag@golwen.net>2013-03-15 05:05:25 -0400
commit2cdfba74605ed69d53572d50ec575e56deedd36e (patch)
treeff0c0e3f953b6198779a6cdd8e60c9af32e4b5d6
parentebd0aa9c41f8ca6cf7de25c282efa759d7a1e273 (diff)
set account and auth_account on b_leg
-rw-r--r--misc/freeswitch/scripts/dialplan/sip_call.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/dialplan/sip_call.lua b/misc/freeswitch/scripts/dialplan/sip_call.lua
index 5c98792..0cde601 100644
--- a/misc/freeswitch/scripts/dialplan/sip_call.lua
+++ b/misc/freeswitch/scripts/dialplan/sip_call.lua
@@ -135,6 +135,17 @@ function SipCall.fork(self, destinations, arg )
if destination.alert_info then
table.insert(origination_variables, "alert_info='" .. destination.alert_info .. "'");
end
+ if destination.account then
+ table.insert(origination_variables, "gs_account_type='" .. common.str.to_s(destination.account.class) .. "'");
+ table.insert(origination_variables, "gs_account_id='" .. common.str.to_i(destination.account.id) .. "'");
+ table.insert(origination_variables, "gs_account_uuid='" .. common.str.to_s(destination.account.uuid) .. "'");
+ end
+ if self.caller.auth_account then
+ table.insert(origination_variables, "gs_auth_account_type='" .. common.str.to_s(self.caller.auth_account.class) .. "'");
+ table.insert(origination_variables, "gs_auth_account_id='" .. common.str.to_i(self.caller.auth_account.id) .. "'");
+ table.insert(origination_variables, "gs_auth_account_uuid='" .. common.str.to_s(self.caller.auth_account.uuid) .. "'");
+ end
+
table.insert(dial_strings, '[' .. table.concat(origination_variables , ',') .. ']sofia/' .. sip_account.record.profile_name .. '/' .. sip_account.record.auth_name .. '%' .. sip_account.record.sip_host);
if destination.pickup_groups and #destination.pickup_groups > 0 then
for key=1, #destination.pickup_groups do