summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2012-12-23 18:36:45 +0100
committerspag <spag@golwen.net>2012-12-23 18:36:45 +0100
commit644af185f879b957d94b7e0207fdeff1d3132767 (patch)
treea793e249c7d7db2dfcc7a106ea5fac3b4bbc27ab /misc
parente9dc7ef003b6adf68e6751b71a8347b843c54619 (diff)
save clir value
Diffstat (limited to 'misc')
-rw-r--r--misc/freeswitch/scripts/common/call_history.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/misc/freeswitch/scripts/common/call_history.lua b/misc/freeswitch/scripts/common/call_history.lua
index c5bc0bf..364cfbf 100644
--- a/misc/freeswitch/scripts/common/call_history.lua
+++ b/misc/freeswitch/scripts/common/call_history.lua
@@ -70,8 +70,6 @@ function CallHistory.insert_event(self, uuid, account_type, account_id, entry_ty
call_history.callee_id_name = common.str.to_sql(event:getHeader('variable_effective_callee_id_name'));
call_history.result = common.str.to_sql(event:getHeader('variable_hangup_cause'));
call_history.start_stamp = 'FROM_UNIXTIME(' .. math.floor(common.str.to_i(event:getHeader('Caller-Channel-Created-Time')) / 1000000) .. ')';
- call_history.caller_account_type = common.str.to_sql(camelize_type(event:getHeader('variable_gs_caller_account_type') or event:getHeader('variable_gs_account_type')));
- call_history.caller_account_id = common.str.to_sql(event:getHeader('variable_gs_caller_account_id') or event:getHeader('variable_gs_account_id'));
call_history.auth_account_type = common.str.to_sql(camelize_type(event:getHeader('variable_gs_auth_account_type')));
call_history.auth_account_id = common.str.to_sql(event:getHeader('variable_gs_auth_account_id'));
call_history.callee_account_type = common.str.to_sql(camelize_type(event:getHeader('variable_gs_destination_type')));
@@ -79,6 +77,11 @@ function CallHistory.insert_event(self, uuid, account_type, account_id, entry_ty
call_history.destination_number = common.str.to_sql(event:getHeader('variable_gs_destination_number'));
call_history.forwarding_service = common.str.to_sql(event:getHeader('variable_gs_forwarding_service'));
+ if not common.str.to_b(event:getHeader('variable_gs_clir')) then
+ call_history.caller_account_type = common.str.to_sql(camelize_type(event:getHeader('variable_gs_caller_account_type') or event:getHeader('variable_gs_account_type')));
+ call_history.caller_account_id = common.str.to_sql(event:getHeader('variable_gs_caller_account_id') or event:getHeader('variable_gs_account_id'));
+ end
+
if common.str.to_s(event:getHeader('variable_gs_call_service')) == 'pickup' then
call_history.forwarding_service = common.str.to_sql('pickup');
end
@@ -111,7 +114,7 @@ function CallHistory.insert_forwarded(self, uuid, account_type, account_id, call
call_history.result = common.str.to_sql(result.cause or 'UNSPECIFIED');
call_history.start_stamp = 'FROM_UNIXTIME(' .. math.floor(caller:to_i('created_time') / 1000000) .. ')';
- if caller.account then
+ if caller.account and not common.str.to_b(event:getHeader('variable_gs_clir')) then
call_history.caller_account_type = common.str.to_sql(camelize_type(caller.account.class));
call_history.caller_account_id = common.str.to_sql(caller.account.id);
end