diff options
Diffstat (limited to 'misc/freeswitch/scripts/common/call_history.lua')
-rw-r--r-- | misc/freeswitch/scripts/common/call_history.lua | 9 |
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 |