diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 20:27:04 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 20:27:04 +0100 |
commit | f3c3e77eaa2b82567f02601b6f66177208674181 (patch) | |
tree | 1946390f7f697e80fcdab4164ad620d507b6a1fe /misc/freeswitch/scripts/common | |
parent | 3e76142566ad8f55a64a88fe5c19e7d0ec7c11c0 (diff) | |
parent | 8d20201910b1915cffa495e6474d50f9c8e8331d (diff) |
Merge branch 'develop'5.0.1
Diffstat (limited to 'misc/freeswitch/scripts/common')
-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..7a9ac07 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 caller.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 |