From 3a1104ff01d6024ac22802d69d5600bf1a0060fa Mon Sep 17 00:00:00 2001 From: adragusin Date: Tue, 21 Jan 2020 13:36:07 +0200 Subject: [PATCH] Removed directions from templates --- agents/fsevent.go | 15 -------- agents/fsevent_test.go | 20 +---------- apier/v1/apier.go | 35 ++++++------------- apier/v1/apier_it_test.go | 6 ++-- apier/v1/thresholds_it_test.go | 1 - apier/v1/triggers.go | 1 - apier/v2/apier.go | 2 +- cdrc/cdrc_test.go | 4 --- cdrc/xml_test.go | 2 -- config/cdrccfg_test.go | 2 +- config/cdrecfg_test.go | 8 ++--- config/multifiles_it_test.go | 5 +-- config/xmldp_test.go | 2 -- console/datacost.go | 2 +- console/debit.go | 2 +- console/debit_max.go | 2 +- console/maxduration.go | 2 +- console/ratingprofile_rem.go | 4 +-- data/conf/samples/cdrc_partcsv/cgrates.json | 2 -- data/conf/samples/cdrccsv/cgrates.json | 5 --- data/conf/samples/cdrcflatstore/cgrates.json | 1 - data/conf/samples/cdrcfwv/cgrates.json | 1 - .../samples/cdrcfwvwithfilter/cgrates.json | 2 -- data/conf/samples/cdrcxml/cgrates.json | 1 - .../samples/cdrcxmlwithfilter/cgrates.json | 5 --- .../cdrsreplicationmaster.json | 2 -- .../cdrsreplicationmaster.json | 2 -- data/conf/samples/ers_internal/cgrates.json | 2 -- data/conf/samples/ers_mongo/cgrates.json | 2 -- data/conf/samples/ers_mysql/cgrates.json | 2 -- data/conf/samples/ers_postgres/cgrates.json | 2 -- .../ers_reload/first_reload/cgrates.json | 1 - .../ers_reload/second_reload/cgrates.json | 1 - .../conf/samples/fscsv/freeswitch_csvcdr.json | 1 - data/conf/samples/multifiles/a.json | 1 - .../multiplecdrc/multiplecdrc_fwexport.json | 2 -- .../multiplecdrc_fwexport.json | 2 -- .../multiplecdrc_fwexport.json | 2 -- .../multiplecdrc_fwexport.json | 2 -- data/storage/migrator/mysql_cdr_migration.sql | 4 +-- data/storage/migrator/mysql_tables_update.sql | 1 - data/storage/migrator/pg_cdr_migration.sql | 4 +-- data/storage/migrator/pg_tables_update.sql | 1 - data/storage/mysql/mysql_cdr_migration.sql | 4 +-- data/storage/postgres/pg_cdr_migration.sql | 4 +-- data/tariffplans/osips_training/Actions.csv | 2 +- data/tariffplans/osips_training/CdrStats.csv | 6 ---- data/tester/cgr-tester.py | 3 +- engine/account.go | 3 -- engine/actions_it_test.go | 1 - engine/actions_test.go | 2 +- engine/callcost_test.go | 2 +- engine/cdr_test.go | 5 +-- engine/cgrcdr_test.go | 2 +- engine/fscdr.go | 1 - engine/fscdr_test.go | 4 --- engine/storage_mongo_datadb.go | 1 - ers/filexml_it_test.go | 2 -- general_tests/cdrs_onlexp_it_test.go | 2 +- general_tests/costs1_test.go | 1 - general_tests/dest_management_it_test.go | 1 - general_tests/oldtutorial_it_test.go | 30 ---------------- general_tests/suretax_it_test.go | 2 +- sessions/sessions_birpc_it_test.go | 1 - sessions/sessions_test.go | 16 --------- sessions/sessions_voice_it_test.go | 1 - utils/apitpdata.go | 1 - utils/rsrfield_test.go | 4 +-- utils/struct_test.go | 10 +++--- 69 files changed, 50 insertions(+), 227 deletions(-) delete mode 100644 data/tariffplans/osips_training/CdrStats.csv diff --git a/agents/fsevent.go b/agents/fsevent.go index a92f8ebaa..841f40c37 100644 --- a/agents/fsevent.go +++ b/agents/fsevent.go @@ -34,7 +34,6 @@ import ( const ( // Freswitch event proprities names - DIRECTION = "Call-Direction" SUBJECT = "variable_" + utils.CGR_SUBJECT ACCOUNT = "variable_" + utils.CGR_ACCOUNT DESTINATION = "variable_" + utils.CGR_DESTINATION @@ -95,14 +94,6 @@ func (fsev FSEvent) GetName() string { return fsev[NAME] } -func (fsev FSEvent) GetDirection(fieldName string) string { - if strings.HasPrefix(fieldName, utils.STATIC_VALUE_PREFIX) { // Static value - return fieldName[len(utils.STATIC_VALUE_PREFIX):] - } - //TODO: implement direction - return utils.META_OUT -} - // Account calling func (fsev FSEvent) GetAccount(fieldName string) string { if strings.HasPrefix(fieldName, utils.STATIC_VALUE_PREFIX) { // Static value @@ -174,9 +165,6 @@ func (fsev FSEvent) GetReqType(fieldName string) string { } func (fsev FSEvent) MissingParameter(timezone string) string { - if strings.TrimSpace(fsev.GetDirection(utils.MetaDefault)) == "" { - return utils.Direction - } if strings.TrimSpace(fsev.GetAccount(utils.MetaDefault)) == "" { return utils.Account } @@ -321,8 +309,6 @@ func (fsev FSEvent) ParseEventValue(rsrFld *config.RSRParser, timezone string) ( return rsrFld.ParseValue("FS_EVENT") case utils.RequestType: return rsrFld.ParseValue(fsev.GetReqType("")) - case utils.Direction: - return rsrFld.ParseValue(fsev.GetDirection("")) case utils.Tenant: return rsrFld.ParseValue(fsev.GetTenant("")) case utils.Category: @@ -387,7 +373,6 @@ func (fsev FSEvent) AsMapStringInterface(timezone string) map[string]interface{} mp[utils.OriginHost] = fsev.GetOriginHost() mp[utils.Source] = "FS_" + fsev.GetName() mp[utils.RequestType] = fsev.GetReqType(utils.MetaDefault) - mp[utils.Direction] = fsev.GetDirection(utils.MetaDefault) mp[utils.Tenant] = fsev.GetTenant(utils.MetaDefault) mp[utils.Category] = fsev.GetCategory(utils.MetaDefault) mp[utils.Account] = fsev.GetAccount(utils.MetaDefault) diff --git a/agents/fsevent_test.go b/agents/fsevent_test.go index bc02e50f6..9684ba45c 100644 --- a/agents/fsevent_test.go +++ b/agents/fsevent_test.go @@ -47,8 +47,6 @@ Channel-Call-State: HANGUP Channel-State-Number: 11 Channel-Name: sofia/cgrtest/1001%40127.0.0.1 Unique-ID: e3133bf7-dcde-4daf-9663-9a79ffcef5ad -Call-Direction: inbound -Presence-Call-Direction: inbound Channel-HIT-Dialplan: true Channel-Call-UUID: e3133bf7-dcde-4daf-9663-9a79ffcef5ad Answer-State: hangup @@ -59,8 +57,6 @@ Channel-Read-Codec-Bit-Rate: 44000 Channel-Write-Codec-Name: SPEEX Channel-Write-Codec-Rate: 32000 Channel-Write-Codec-Bit-Rate: 44000 -Caller-Direction: inbound -Caller-Logical-Direction: inbound Caller-Username: 1001 Caller-Dialplan: XML Caller-Caller-ID-Name: 1001 @@ -94,8 +90,6 @@ Caller-Screen-Bit: true Caller-Privacy-Hide-Name: false Caller-Privacy-Hide-Number: false Other-Type: originatee -Other-Leg-Direction: outbound -Other-Leg-Logical-Direction: inbound Other-Leg-Username: 1001 Other-Leg-Dialplan: XML Other-Leg-Caller-ID-Name: Extension%201001 @@ -126,7 +120,6 @@ Other-Leg-Channel-Hold-Accum: 0 Other-Leg-Screen-Bit: true Other-Leg-Privacy-Hide-Name: false Other-Leg-Privacy-Hide-Number: false -variable_direction: inbound variable_uuid: e3133bf7-dcde-4daf-9663-9a79ffcef5ad variable_session_id: 4 variable_sip_from_user: 1001 @@ -513,9 +506,6 @@ func TestParseEventValue(t *testing.T) { if parsed, _ := ev.ParseEventValue(config.NewRSRParserMustCompile(utils.REGEXP_PREFIX+utils.RequestType, true), ""); parsed != utils.META_PREPAID { t.Error("Unexpected result parsed", parsed) } - if parsed, _ := ev.ParseEventValue(config.NewRSRParserMustCompile(utils.REGEXP_PREFIX+utils.Direction, true), ""); parsed != utils.META_OUT { - t.Error("Unexpected result parsed", parsed) - } if parsed, _ := ev.ParseEventValue(config.NewRSRParserMustCompile(utils.REGEXP_PREFIX+utils.Tenant, true), ""); parsed != "cgrates.org" { t.Error("Unexpected result parsed", parsed) } @@ -598,7 +588,6 @@ func TestFsEvAsMapStringInterface(t *testing.T) { expectedMap[utils.SetupTime] = setupTime expectedMap[utils.AnswerTime] = aTime expectedMap[utils.RequestType] = utils.META_PREPAID - expectedMap[utils.Direction] = "*out" expectedMap[utils.Destination] = "1003" expectedMap[utils.Usage] = time.Duration(66) * time.Second expectedMap[utils.Tenant] = "cgrates.org" @@ -650,7 +639,7 @@ func TestSliceAsFsArray(t *testing.T) { // Make sure processing of the hangup event produces the same output as FS-JSON CDR func TestSyncFsEventWithJsonCdr(t *testing.T) { body := []byte(` -{"core-uuid":"63e2315b-d538-4dfa-9ed5-af73ba6210b6","switchname":"teo","channel_data":{"state":"CS_REPORTING","direction":"inbound","state_number":"11","flags":"0=1;1=1;3=1;20=1;37=1;38=1;40=1;43=1;48=1;53=1;75=1;77=1;106=1;112=1;113=1;122=1;134=1","caps":"1=1;2=1;3=1;4=1;5=1;6=1"},"callStats":{"audio":{"inbound":{"raw_bytes":174156,"media_bytes":166416,"packet_count":1033,"media_packet_count":988,"skip_packet_count":7,"jitter_packet_count":0,"dtmf_packet_count":0,"cng_packet_count":0,"flush_packet_count":45,"largest_jb_size":0,"jitter_min_variance":0.500000,"jitter_max_variance":31.769231,"jitter_loss_rate":0,"jitter_burst_rate":0,"mean_interval":20.171779,"flaw_total":1,"quality_percentage":99,"mos":4.492027,"errorLog":[{"start":1521025783725905,"stop":1521025788366141,"flaws":10763,"consecutiveFlaws":0,"durationMS":4640}]},"outbound":{"raw_bytes":43344,"media_bytes":43344,"packet_count":252,"media_packet_count":252,"skip_packet_count":0,"dtmf_packet_count":0,"cng_packet_count":0,"rtcp_packet_count":0,"rtcp_octet_count":0}}},"variables":{"direction":"inbound","uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","session_id":"1","sip_from_user":"1001","sip_from_uri":"1001@192.168.56.202","sip_from_host":"192.168.56.202","channel_name":"sofia/internal/1001@192.168.56.202","ep_codec_string":"mod_spandsp.G722@8000h@20i@64000b,CORE_PCM_MODULE.PCMU@8000h@20i@64000b,CORE_PCM_MODULE.PCMA@8000h@20i@64000b,mod_spandsp.GSM@8000h@20i@13200b","sip_local_network_addr":"192.168.56.202","sip_network_ip":"192.168.56.1","sip_network_port":"5060","sip_invite_stamp":"1521025758006702","sip_received_ip":"192.168.56.1","sip_received_port":"5060","sip_via_protocol":"udp","sip_authorized":"true","Event-Name":"REQUEST_PARAMS","Core-UUID":"63e2315b-d538-4dfa-9ed5-af73ba6210b6","FreeSWITCH-Hostname":"teo","FreeSWITCH-Switchname":"teo","FreeSWITCH-IPv4":"10.0.2.15","FreeSWITCH-IPv6":"::1","Event-Date-Local":"2018-03-14 07:09:18","Event-Date-GMT":"Wed, 14 Mar 2018 11:09:18 GMT","Event-Date-Timestamp":"1521025758006702","Event-Calling-File":"sofia.c","Event-Calling-Function":"sofia_handle_sip_i_invite","Event-Calling-Line-Number":"10096","Event-Sequence":"1025","sip_number_alias":"1001","sip_auth_username":"1001","sip_auth_realm":"192.168.56.202","number_alias":"1001","requested_user_name":"1001","requested_domain_name":"192.168.56.202","record_stereo":"true","transfer_fallback_extension":"operator","toll_allow":"domestic,international,local","accountcode":"1001","user_context":"default","effective_caller_id_name":"Extension 1001","effective_caller_id_number":"1001","callgroup":"techsupport","cgr_reqtype":"*prepaid","cgr_flags":"*resources,*attributes,*sessions,*suppliers","user_name":"1001","domain_name":"192.168.56.202","sip_from_user_stripped":"1001","sofia_profile_name":"internal","recovery_profile_name":"internal","sip_req_user":"1002","sip_req_uri":"1002@192.168.56.202","sip_req_host":"192.168.56.202","sip_to_user":"1002","sip_to_uri":"1002@192.168.56.202","sip_to_host":"192.168.56.202","sip_contact_params":"transport=udp;registering_acc=192_168_56_202","sip_contact_user":"1001","sip_contact_port":"5060","sip_contact_uri":"1001@192.168.56.1:5060","sip_contact_host":"192.168.56.1","sip_via_host":"192.168.56.1","sip_via_port":"5060","presence_id":"1001@192.168.56.202","cgr_resource_allocation":"ResGroup1","cgr_suppliers":"ARRAY::3|:supplier2|:supplier3|:supplier1","cgr_notify":"AUTH_OK","max_forwards":"69","transfer_history":"1521025758:86c9ebb2-888f-42d5-9afa-2101449a4b86:bl_xfer:1002/default/XML","transfer_source":"1521025758:86c9ebb2-888f-42d5-9afa-2101449a4b86:bl_xfer:1002/default/XML","DP_MATCH":"ARRAY::1002|:1002","call_uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","call_timeout":"30","current_application_data":"user/1002@192.168.56.202","current_application":"bridge","dialed_user":"1002","dialed_domain":"192.168.56.202","originated_legs":"ARRAY::9c1afb4f-1d4a-4e45-84a3-d25721981bf5;Outbound Call;1002|:9c1afb4f-1d4a-4e45-84a3-d25721981bf5;Outbound Call;1002","switch_m_sdp":"v=0\r\no=1002-jitsi.org 0 0 IN IP4 192.168.56.1\r\ns=-\r\nc=IN IP4 192.168.56.1\r\nt=0 0\r\nm=audio 5004 RTP/AVP 9 0 8 3 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:101 telephone-event/8000\r\n","rtp_use_codec_name":"G722","rtp_use_codec_rate":"8000","rtp_use_codec_ptime":"20","rtp_use_codec_channels":"1","rtp_last_audio_codec_string":"G722@8000h@20i@1c","read_codec":"G722","original_read_codec":"G722","read_rate":"16000","original_read_rate":"16000","write_codec":"G722","write_rate":"16000","local_media_ip":"192.168.56.202","local_media_port":"29014","advertised_media_ip":"192.168.56.202","rtp_use_timer_name":"soft","rtp_use_pt":"9","rtp_use_ssrc":"2729250253","endpoint_disposition":"ANSWER","originate_causes":"ARRAY::9c1afb4f-1d4a-4e45-84a3-d25721981bf5;NONE|:9c1afb4f-1d4a-4e45-84a3-d25721981bf5;NONE","originate_disposition":"SUCCESS","DIALSTATUS":"SUCCESS","last_bridge_to":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","bridge_channel":"sofia/internal/1002@192.168.56.1:5060","bridge_uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","signal_bond":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","last_sent_callee_id_name":"Outbound Call","last_sent_callee_id_number":"1002","switch_r_sdp":"v=0\r\no=1001-jitsi.org 0 2 IN IP4 192.168.56.1\r\ns=-\r\nc=IN IP4 192.168.56.1\r\nt=0 0\r\nm=audio 5000 RTP/AVP 96 97 98 9 100 102 0 8 103 3 104 4 101\r\na=rtpmap:96 opus/48000/2\r\na=fmtp:96 usedtx=1\r\na=rtpmap:97 SILK/24000\r\na=rtpmap:98 SILK/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:100 speex/32000\r\na=rtpmap:102 speex/16000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:103 iLBC/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:104 speex/8000\r\na=rtpmap:4 G723/8000\r\na=fmtp:4 annexa=no;bitrate=6.3\r\na=rtpmap:101 telephone-event/8000\r\na=ptime:20\r\na=extmap:1 urn:ietf:params:rtp-hdrext:csrc-audio-level\r\na=extmap:2 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=rtcp-xr:voip-metrics\r\na=zrtp-hash:1.10 8e8dd2fa6803f32845f26e55879c776a4bc015ee05b41630313aee27ef77fb30\r\nm=video 5006 RTP/AVP 105 99\r\na=rtpmap:105 H264/90000\r\na=fmtp:105 profile-level-id=4DE01f;packetization-mode=1\r\na=rtpmap:99 H264/90000\r\na=fmtp:99 profile-level-id=4DE01f\r\na=recvonly\r\na=imageattr:105 send * recv [x=[1:1920],y=[1:1080]]\r\na=imageattr:99 send * recv [x=[1:1920],y=[1:1080]]\r\n","rtp_use_codec_string":"G722,PCMU,PCMA,GSM","r_sdp_audio_zrtp_hash":"1.10 8e8dd2fa6803f32845f26e55879c776a4bc015ee05b41630313aee27ef77fb30","audio_media_flow":"sendrecv","remote_media_ip":"192.168.56.1","remote_media_port":"5000","rtp_audio_recv_pt":"9","dtmf_type":"rfc2833","rtp_2833_send_payload":"101","rtp_2833_recv_payload":"101","video_possible":"true","video_media_flow":"sendonly","rtp_local_sdp_str":"v=0\r\no=FreeSWITCH 1520996753 1520996756 IN IP4 192.168.56.202\r\ns=FreeSWITCH\r\nc=IN IP4 192.168.56.202\r\nt=0 0\r\nm=audio 29014 RTP/AVP 9 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=ptime:20\r\na=sendrecv\r\nm=video 0 RTP/AVP 19\r\n","sip_to_tag":"aDUZXF1Z1vD6p","sip_from_tag":"df94d020","sip_cseq":"4","sip_call_id":"985e365faa0ec79a7fa75d001ef2449f@0:0:0:0:0:0:0:0","sip_full_via":"SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bK-323230-ab335b3491dd24f5ec251b9700716b97","sip_from_display":"1001","sip_full_from":"\"1001\" ;tag=df94d020","sip_full_to":";tag=aDUZXF1Z1vD6p","sip_term_status":"200","proto_specific_hangup_cause":"sip:200","sip_term_cause":"16","last_bridge_role":"originator","sip_user_agent":"Jitsi2.10.5550Windows 10","sip_hangup_disposition":"recv_bye","bridge_hangup_cause":"NORMAL_CLEARING","hangup_cause":"NORMAL_CLEARING","hangup_cause_q850":"16","digits_dialed":"none","start_stamp":"2018-03-14 07:09:18","profile_start_stamp":"2018-03-14 07:09:18","answer_stamp":"2018-03-14 07:09:27","bridge_stamp":"2018-03-14 07:09:27","hold_stamp":"2018-03-14 07:09:27","progress_stamp":"2018-03-14 07:09:18","progress_media_stamp":"2018-03-14 07:09:27","hold_events":"{{1521025767847893,1521025783334494}}","end_stamp":"2018-03-14 07:09:48","start_epoch":"1521025758","start_uepoch":"1521025758006702","profile_start_epoch":"1521025758","profile_start_uepoch":"1521025758026167","answer_epoch":"1521025767","answer_uepoch":"1521025767766321","bridge_epoch":"1521025767","bridge_uepoch":"1521025767766321","last_hold_epoch":"1521025767","last_hold_uepoch":"1521025767847892","hold_accum_seconds":"15","hold_accum_usec":"15486602","hold_accum_ms":"15486","resurrect_epoch":"0","resurrect_uepoch":"0","progress_epoch":"1521025758","progress_uepoch":"1521025758116123","progress_media_epoch":"1521025767","progress_media_uepoch":"1521025767766321","end_epoch":"1521025788","end_uepoch":"1521025788366141","last_app":"bridge","last_arg":"user/1002@192.168.56.202","caller_id":"\"1001\" <1001>","duration":"30","billsec":"21","progresssec":"0","answersec":"9","waitsec":"9","progress_mediasec":"9","flow_billsec":"30","mduration":"30360","billmsec":"20600","progressmsec":"110","answermsec":"9760","waitmsec":"9760","progress_mediamsec":"9760","flow_billmsec":"30360","uduration":"30359439","billusec":"20599820","progressusec":"109421","answerusec":"9759619","waitusec":"9759619","progress_mediausec":"9759619","flow_billusec":"30359439","rtp_audio_in_raw_bytes":"174156","rtp_audio_in_media_bytes":"166416","rtp_audio_in_packet_count":"1033","rtp_audio_in_media_packet_count":"988","rtp_audio_in_skip_packet_count":"7","rtp_audio_in_jitter_packet_count":"0","rtp_audio_in_dtmf_packet_count":"0","rtp_audio_in_cng_packet_count":"0","rtp_audio_in_flush_packet_count":"45","rtp_audio_in_largest_jb_size":"0","rtp_audio_in_jitter_min_variance":"0.50","rtp_audio_in_jitter_max_variance":"31.77","rtp_audio_in_jitter_loss_rate":"0.00","rtp_audio_in_jitter_burst_rate":"0.00","rtp_audio_in_mean_interval":"20.17","rtp_audio_in_flaw_total":"1","rtp_audio_in_quality_percentage":"99.00","rtp_audio_in_mos":"4.49","rtp_audio_out_raw_bytes":"43344","rtp_audio_out_media_bytes":"43344","rtp_audio_out_packet_count":"252","rtp_audio_out_media_packet_count":"252","rtp_audio_out_skip_packet_count":"0","rtp_audio_out_dtmf_packet_count":"0","rtp_audio_out_cng_packet_count":"0","rtp_audio_rtcp_packet_count":"0","rtp_audio_rtcp_octet_count":"0"},"app_log":{"applications":[{"app_name":"info","app_data":"","app_stamp":"1521025758010697"},{"app_name":"park","app_data":"","app_stamp":"1521025758011143"},{"app_name":"set","app_data":"ringback=","app_stamp":"1521025758057183"},{"app_name":"set","app_data":"call_timeout=30","app_stamp":"1521025758057474"},{"app_name":"bridge","app_data":"user/1002@192.168.56.202","app_stamp":"1521025758057698"}]},"callflow":[{"dialplan":"XML","profile_index":"2","extension":{"name":"Local_Extension","number":"1002","applications":[{"app_name":"set","app_data":"ringback=${us-ring}"},{"app_name":"set","app_data":"call_timeout=30"},{"app_name":"bridge","app_data":"user/${destination_number}@${domain_name}"}]},"caller_profile":{"username":"1001","dialplan":"XML","caller_id_name":"1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1001@192.168.56.202","originatee":{"originatee_caller_profiles":[{"username":"1001","dialplan":"XML","caller_id_name":"Extension 1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1002@192.168.56.1:5060"},{"username":"1001","dialplan":"XML","caller_id_name":"Extension 1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1002@192.168.56.1:5060"}]}},"times":{"created_time":"1521025758006702","profile_created_time":"1521025758026167","progress_time":"1521025758116123","progress_media_time":"1521025767766321","answered_time":"1521025767766321","bridged_time":"1521025767766321","last_hold_time":"1521025767847892","hold_accum_time":"15486602","hangup_time":"1521025788366141","resurrect_time":"0","transfer_time":"0"}},{"dialplan":"XML","profile_index":"1","extension":{"name":"CGRateS_Auth","number":"1002","applications":[{"app_name":"info","app_data":""},{"app_name":"park","app_data":""}]},"caller_profile":{"username":"1001","dialplan":"XML","caller_id_name":"1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"","destination_number":"1002","uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1001@192.168.56.202"},"times":{"created_time":"1521025758006702","profile_created_time":"1521025758006702","progress_time":"0","progress_media_time":"0","answered_time":"0","bridged_time":"0","last_hold_time":"0","hold_accum_time":"0","hangup_time":"0","resurrect_time":"0","transfer_time":"1521025758026167"}}]} `) +{"core-uuid":"63e2315b-d538-4dfa-9ed5-af73ba6210b6","switchname":"teo","channel_data":{"state":"CS_REPORTING","state_number":"11","flags":"0=1;1=1;3=1;20=1;37=1;38=1;40=1;43=1;48=1;53=1;75=1;77=1;106=1;112=1;113=1;122=1;134=1","caps":"1=1;2=1;3=1;4=1;5=1;6=1"},"callStats":{"audio":{"inbound":{"raw_bytes":174156,"media_bytes":166416,"packet_count":1033,"media_packet_count":988,"skip_packet_count":7,"jitter_packet_count":0,"dtmf_packet_count":0,"cng_packet_count":0,"flush_packet_count":45,"largest_jb_size":0,"jitter_min_variance":0.500000,"jitter_max_variance":31.769231,"jitter_loss_rate":0,"jitter_burst_rate":0,"mean_interval":20.171779,"flaw_total":1,"quality_percentage":99,"mos":4.492027,"errorLog":[{"start":1521025783725905,"stop":1521025788366141,"flaws":10763,"consecutiveFlaws":0,"durationMS":4640}]},"outbound":{"raw_bytes":43344,"media_bytes":43344,"packet_count":252,"media_packet_count":252,"skip_packet_count":0,"dtmf_packet_count":0,"cng_packet_count":0,"rtcp_packet_count":0,"rtcp_octet_count":0}}},"variables":{"uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","session_id":"1","sip_from_user":"1001","sip_from_uri":"1001@192.168.56.202","sip_from_host":"192.168.56.202","channel_name":"sofia/internal/1001@192.168.56.202","ep_codec_string":"mod_spandsp.G722@8000h@20i@64000b,CORE_PCM_MODULE.PCMU@8000h@20i@64000b,CORE_PCM_MODULE.PCMA@8000h@20i@64000b,mod_spandsp.GSM@8000h@20i@13200b","sip_local_network_addr":"192.168.56.202","sip_network_ip":"192.168.56.1","sip_network_port":"5060","sip_invite_stamp":"1521025758006702","sip_received_ip":"192.168.56.1","sip_received_port":"5060","sip_via_protocol":"udp","sip_authorized":"true","Event-Name":"REQUEST_PARAMS","Core-UUID":"63e2315b-d538-4dfa-9ed5-af73ba6210b6","FreeSWITCH-Hostname":"teo","FreeSWITCH-Switchname":"teo","FreeSWITCH-IPv4":"10.0.2.15","FreeSWITCH-IPv6":"::1","Event-Date-Local":"2018-03-14 07:09:18","Event-Date-GMT":"Wed, 14 Mar 2018 11:09:18 GMT","Event-Date-Timestamp":"1521025758006702","Event-Calling-File":"sofia.c","Event-Calling-Function":"sofia_handle_sip_i_invite","Event-Calling-Line-Number":"10096","Event-Sequence":"1025","sip_number_alias":"1001","sip_auth_username":"1001","sip_auth_realm":"192.168.56.202","number_alias":"1001","requested_user_name":"1001","requested_domain_name":"192.168.56.202","record_stereo":"true","transfer_fallback_extension":"operator","toll_allow":"domestic,international,local","accountcode":"1001","user_context":"default","effective_caller_id_name":"Extension 1001","effective_caller_id_number":"1001","callgroup":"techsupport","cgr_reqtype":"*prepaid","cgr_flags":"*resources,*attributes,*sessions,*suppliers","user_name":"1001","domain_name":"192.168.56.202","sip_from_user_stripped":"1001","sofia_profile_name":"internal","recovery_profile_name":"internal","sip_req_user":"1002","sip_req_uri":"1002@192.168.56.202","sip_req_host":"192.168.56.202","sip_to_user":"1002","sip_to_uri":"1002@192.168.56.202","sip_to_host":"192.168.56.202","sip_contact_params":"transport=udp;registering_acc=192_168_56_202","sip_contact_user":"1001","sip_contact_port":"5060","sip_contact_uri":"1001@192.168.56.1:5060","sip_contact_host":"192.168.56.1","sip_via_host":"192.168.56.1","sip_via_port":"5060","presence_id":"1001@192.168.56.202","cgr_resource_allocation":"ResGroup1","cgr_suppliers":"ARRAY::3|:supplier2|:supplier3|:supplier1","cgr_notify":"AUTH_OK","max_forwards":"69","transfer_history":"1521025758:86c9ebb2-888f-42d5-9afa-2101449a4b86:bl_xfer:1002/default/XML","transfer_source":"1521025758:86c9ebb2-888f-42d5-9afa-2101449a4b86:bl_xfer:1002/default/XML","DP_MATCH":"ARRAY::1002|:1002","call_uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","call_timeout":"30","current_application_data":"user/1002@192.168.56.202","current_application":"bridge","dialed_user":"1002","dialed_domain":"192.168.56.202","originated_legs":"ARRAY::9c1afb4f-1d4a-4e45-84a3-d25721981bf5;Outbound Call;1002|:9c1afb4f-1d4a-4e45-84a3-d25721981bf5;Outbound Call;1002","switch_m_sdp":"v=0\r\no=1002-jitsi.org 0 0 IN IP4 192.168.56.1\r\ns=-\r\nc=IN IP4 192.168.56.1\r\nt=0 0\r\nm=audio 5004 RTP/AVP 9 0 8 3 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:101 telephone-event/8000\r\n","rtp_use_codec_name":"G722","rtp_use_codec_rate":"8000","rtp_use_codec_ptime":"20","rtp_use_codec_channels":"1","rtp_last_audio_codec_string":"G722@8000h@20i@1c","read_codec":"G722","original_read_codec":"G722","read_rate":"16000","original_read_rate":"16000","write_codec":"G722","write_rate":"16000","local_media_ip":"192.168.56.202","local_media_port":"29014","advertised_media_ip":"192.168.56.202","rtp_use_timer_name":"soft","rtp_use_pt":"9","rtp_use_ssrc":"2729250253","endpoint_disposition":"ANSWER","originate_causes":"ARRAY::9c1afb4f-1d4a-4e45-84a3-d25721981bf5;NONE|:9c1afb4f-1d4a-4e45-84a3-d25721981bf5;NONE","originate_disposition":"SUCCESS","DIALSTATUS":"SUCCESS","last_bridge_to":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","bridge_channel":"sofia/internal/1002@192.168.56.1:5060","bridge_uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","signal_bond":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","last_sent_callee_id_name":"Outbound Call","last_sent_callee_id_number":"1002","switch_r_sdp":"v=0\r\no=1001-jitsi.org 0 2 IN IP4 192.168.56.1\r\ns=-\r\nc=IN IP4 192.168.56.1\r\nt=0 0\r\nm=audio 5000 RTP/AVP 96 97 98 9 100 102 0 8 103 3 104 4 101\r\na=rtpmap:96 opus/48000/2\r\na=fmtp:96 usedtx=1\r\na=rtpmap:97 SILK/24000\r\na=rtpmap:98 SILK/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:100 speex/32000\r\na=rtpmap:102 speex/16000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:103 iLBC/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:104 speex/8000\r\na=rtpmap:4 G723/8000\r\na=fmtp:4 annexa=no;bitrate=6.3\r\na=rtpmap:101 telephone-event/8000\r\na=ptime:20\r\na=extmap:1 urn:ietf:params:rtp-hdrext:csrc-audio-level\r\na=extmap:2 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=rtcp-xr:voip-metrics\r\na=zrtp-hash:1.10 8e8dd2fa6803f32845f26e55879c776a4bc015ee05b41630313aee27ef77fb30\r\nm=video 5006 RTP/AVP 105 99\r\na=rtpmap:105 H264/90000\r\na=fmtp:105 profile-level-id=4DE01f;packetization-mode=1\r\na=rtpmap:99 H264/90000\r\na=fmtp:99 profile-level-id=4DE01f\r\na=recvonly\r\na=imageattr:105 send * recv [x=[1:1920],y=[1:1080]]\r\na=imageattr:99 send * recv [x=[1:1920],y=[1:1080]]\r\n","rtp_use_codec_string":"G722,PCMU,PCMA,GSM","r_sdp_audio_zrtp_hash":"1.10 8e8dd2fa6803f32845f26e55879c776a4bc015ee05b41630313aee27ef77fb30","audio_media_flow":"sendrecv","remote_media_ip":"192.168.56.1","remote_media_port":"5000","rtp_audio_recv_pt":"9","dtmf_type":"rfc2833","rtp_2833_send_payload":"101","rtp_2833_recv_payload":"101","video_possible":"true","video_media_flow":"sendonly","rtp_local_sdp_str":"v=0\r\no=FreeSWITCH 1520996753 1520996756 IN IP4 192.168.56.202\r\ns=FreeSWITCH\r\nc=IN IP4 192.168.56.202\r\nt=0 0\r\nm=audio 29014 RTP/AVP 9 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=ptime:20\r\na=sendrecv\r\nm=video 0 RTP/AVP 19\r\n","sip_to_tag":"aDUZXF1Z1vD6p","sip_from_tag":"df94d020","sip_cseq":"4","sip_call_id":"985e365faa0ec79a7fa75d001ef2449f@0:0:0:0:0:0:0:0","sip_full_via":"SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bK-323230-ab335b3491dd24f5ec251b9700716b97","sip_from_display":"1001","sip_full_from":"\"1001\" ;tag=df94d020","sip_full_to":";tag=aDUZXF1Z1vD6p","sip_term_status":"200","proto_specific_hangup_cause":"sip:200","sip_term_cause":"16","last_bridge_role":"originator","sip_user_agent":"Jitsi2.10.5550Windows 10","sip_hangup_disposition":"recv_bye","bridge_hangup_cause":"NORMAL_CLEARING","hangup_cause":"NORMAL_CLEARING","hangup_cause_q850":"16","digits_dialed":"none","start_stamp":"2018-03-14 07:09:18","profile_start_stamp":"2018-03-14 07:09:18","answer_stamp":"2018-03-14 07:09:27","bridge_stamp":"2018-03-14 07:09:27","hold_stamp":"2018-03-14 07:09:27","progress_stamp":"2018-03-14 07:09:18","progress_media_stamp":"2018-03-14 07:09:27","hold_events":"{{1521025767847893,1521025783334494}}","end_stamp":"2018-03-14 07:09:48","start_epoch":"1521025758","start_uepoch":"1521025758006702","profile_start_epoch":"1521025758","profile_start_uepoch":"1521025758026167","answer_epoch":"1521025767","answer_uepoch":"1521025767766321","bridge_epoch":"1521025767","bridge_uepoch":"1521025767766321","last_hold_epoch":"1521025767","last_hold_uepoch":"1521025767847892","hold_accum_seconds":"15","hold_accum_usec":"15486602","hold_accum_ms":"15486","resurrect_epoch":"0","resurrect_uepoch":"0","progress_epoch":"1521025758","progress_uepoch":"1521025758116123","progress_media_epoch":"1521025767","progress_media_uepoch":"1521025767766321","end_epoch":"1521025788","end_uepoch":"1521025788366141","last_app":"bridge","last_arg":"user/1002@192.168.56.202","caller_id":"\"1001\" <1001>","duration":"30","billsec":"21","progresssec":"0","answersec":"9","waitsec":"9","progress_mediasec":"9","flow_billsec":"30","mduration":"30360","billmsec":"20600","progressmsec":"110","answermsec":"9760","waitmsec":"9760","progress_mediamsec":"9760","flow_billmsec":"30360","uduration":"30359439","billusec":"20599820","progressusec":"109421","answerusec":"9759619","waitusec":"9759619","progress_mediausec":"9759619","flow_billusec":"30359439","rtp_audio_in_raw_bytes":"174156","rtp_audio_in_media_bytes":"166416","rtp_audio_in_packet_count":"1033","rtp_audio_in_media_packet_count":"988","rtp_audio_in_skip_packet_count":"7","rtp_audio_in_jitter_packet_count":"0","rtp_audio_in_dtmf_packet_count":"0","rtp_audio_in_cng_packet_count":"0","rtp_audio_in_flush_packet_count":"45","rtp_audio_in_largest_jb_size":"0","rtp_audio_in_jitter_min_variance":"0.50","rtp_audio_in_jitter_max_variance":"31.77","rtp_audio_in_jitter_loss_rate":"0.00","rtp_audio_in_jitter_burst_rate":"0.00","rtp_audio_in_mean_interval":"20.17","rtp_audio_in_flaw_total":"1","rtp_audio_in_quality_percentage":"99.00","rtp_audio_in_mos":"4.49","rtp_audio_out_raw_bytes":"43344","rtp_audio_out_media_bytes":"43344","rtp_audio_out_packet_count":"252","rtp_audio_out_media_packet_count":"252","rtp_audio_out_skip_packet_count":"0","rtp_audio_out_dtmf_packet_count":"0","rtp_audio_out_cng_packet_count":"0","rtp_audio_rtcp_packet_count":"0","rtp_audio_rtcp_octet_count":"0"},"app_log":{"applications":[{"app_name":"info","app_data":"","app_stamp":"1521025758010697"},{"app_name":"park","app_data":"","app_stamp":"1521025758011143"},{"app_name":"set","app_data":"ringback=","app_stamp":"1521025758057183"},{"app_name":"set","app_data":"call_timeout=30","app_stamp":"1521025758057474"},{"app_name":"bridge","app_data":"user/1002@192.168.56.202","app_stamp":"1521025758057698"}]},"callflow":[{"dialplan":"XML","profile_index":"2","extension":{"name":"Local_Extension","number":"1002","applications":[{"app_name":"set","app_data":"ringback=${us-ring}"},{"app_name":"set","app_data":"call_timeout=30"},{"app_name":"bridge","app_data":"user/${destination_number}@${domain_name}"}]},"caller_profile":{"username":"1001","dialplan":"XML","caller_id_name":"1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1001@192.168.56.202","originatee":{"originatee_caller_profiles":[{"username":"1001","dialplan":"XML","caller_id_name":"Extension 1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1002@192.168.56.1:5060"},{"username":"1001","dialplan":"XML","caller_id_name":"Extension 1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"1002","destination_number":"1002","uuid":"9c1afb4f-1d4a-4e45-84a3-d25721981bf5","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1002@192.168.56.1:5060"}]}},"times":{"created_time":"1521025758006702","profile_created_time":"1521025758026167","progress_time":"1521025758116123","progress_media_time":"1521025767766321","answered_time":"1521025767766321","bridged_time":"1521025767766321","last_hold_time":"1521025767847892","hold_accum_time":"15486602","hangup_time":"1521025788366141","resurrect_time":"0","transfer_time":"0"}},{"dialplan":"XML","profile_index":"1","extension":{"name":"CGRateS_Auth","number":"1002","applications":[{"app_name":"info","app_data":""},{"app_name":"park","app_data":""}]},"caller_profile":{"username":"1001","dialplan":"XML","caller_id_name":"1001","ani":"1001","aniii":"","caller_id_number":"1001","network_addr":"192.168.56.1","rdnis":"","destination_number":"1002","uuid":"5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4","source":"mod_sofia","context":"default","chan_name":"sofia/internal/1001@192.168.56.202"},"times":{"created_time":"1521025758006702","profile_created_time":"1521025758006702","progress_time":"0","progress_media_time":"0","answered_time":"0","bridged_time":"0","last_hold_time":"0","hold_accum_time":"0","hangup_time":"0","resurrect_time":"0","transfer_time":"1521025758026167"}}]} `) hangUp := `Event-Name: CHANNEL_HANGUP_COMPLETE Core-UUID: 63e2315b-d538-4dfa-9ed5-af73ba6210b6 FreeSWITCH-Hostname: teo @@ -670,8 +659,6 @@ Channel-Call-State: HANGUP Channel-State-Number: 11 Channel-Name: sofia/internal/1001%40192.168.56.202 Unique-ID: 5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4 -Call-Direction: inbound -Presence-Call-Direction: inbound Channel-HIT-Dialplan: true Channel-Presence-ID: 1001%40192.168.56.202 Channel-Call-UUID: 5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4 @@ -683,8 +670,6 @@ Channel-Read-Codec-Bit-Rate: 64000 Channel-Write-Codec-Name: G722 Channel-Write-Codec-Rate: 16000 Channel-Write-Codec-Bit-Rate: 64000 -Caller-Direction: inbound -Caller-Logical-Direction: inbound Caller-Username: 1001 Caller-Dialplan: XML Caller-Caller-ID-Name: 1001 @@ -718,8 +703,6 @@ Caller-Screen-Bit: true Caller-Privacy-Hide-Name: false Caller-Privacy-Hide-Number: false Other-Type: originatee -Other-Leg-Direction: outbound -Other-Leg-Logical-Direction: inbound Other-Leg-Username: 1001 Other-Leg-Dialplan: XML Other-Leg-Caller-ID-Name: Extension%201001 @@ -750,7 +733,6 @@ Other-Leg-Channel-Hold-Accum: 0 Other-Leg-Screen-Bit: true Other-Leg-Privacy-Hide-Name: false Other-Leg-Privacy-Hide-Number: false -variable_direction: inbound variable_uuid: 5a3a1d91-90d3-4db4-af5c-cc3ae15d93a4 variable_session_id: 1 variable_sip_from_user: 1001 diff --git a/apier/v1/apier.go b/apier/v1/apier.go index b4bde4038..8bb011e7c 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -390,7 +390,7 @@ func (apiv1 *ApierV1) ImportTariffPlanFromFolder(attrs utils.AttrImportTPFromFol // Sets a specific rating profile working with data directly in the DataDB without involving storDb func (apiv1 *ApierV1) SetRatingProfile(attrs utils.AttrSetRatingProfile, reply *string) (err error) { - if missing := utils.MissingStructFields(&attrs, []string{"Tenant", "TOR", "Direction", "Subject", "RatingPlanActivations"}); len(missing) != 0 { + if missing := utils.MissingStructFields(&attrs, []string{"Tenant", "TOR", "Subject", "RatingPlanActivations"}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } for _, rpa := range attrs.RatingPlanActivations { @@ -462,7 +462,7 @@ func (apiv1 *ApierV1) GetRatingProfileIDs(args utils.TenantArgWithPaginator, rsP } func (apiv1 *ApierV1) GetRatingProfile(attrs utils.AttrGetRatingProfile, reply *engine.RatingProfile) (err error) { - if missing := utils.MissingStructFields(&attrs, []string{"Tenant", "Category", "Direction", "Subject"}); len(missing) != 0 { + if missing := utils.MissingStructFields(&attrs, []string{"Tenant", "Category", "Subject"}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } if rpPrf, err := apiv1.DataManager.GetRatingProfile(attrs.GetID(), @@ -491,7 +491,6 @@ type V1TPAction struct { BalanceId string // Balance identification string (account scope) BalanceUuid string // Balance identification string (global scope) BalanceType string // Type of balance the action will operate on - Directions string // Balance direction Units float64 // Number of units to add/deduct ExpiryTime string // Time when the units will expire Filter string // The condition on balances that is checked before the action @@ -514,7 +513,7 @@ func (apiv1 *ApierV1) SetActions(attrs V1AttrSetActions, reply *string) (err err for _, action := range attrs.Actions { requiredFields := []string{"Identifier", "Weight"} if action.BalanceType != "" { // Add some inter-dependent parameters - if balanceType then we are not talking about simply calling actions - requiredFields = append(requiredFields, "Direction", "Units") + requiredFields = append(requiredFields, "Units") } if missing := utils.MissingStructFields(action, requiredFields); len(missing) != 0 { return fmt.Errorf("%s:Action:%s:%v", utils.ErrMandatoryIeMissing.Error(), action.Identifier, missing) @@ -1008,29 +1007,21 @@ func (apiv1 *ApierV1) RemoveTPFromStorDB(attrs AttrLoadTpFromStorDb, reply *stri } type AttrRemoveRatingProfile struct { - Direction string - Tenant string - Category string - Subject string + Tenant string + Category string + Subject string } func (arrp *AttrRemoveRatingProfile) GetId() (result string) { - if arrp.Direction != "" && arrp.Direction != utils.ANY { - result += arrp.Direction - result += utils.CONCATENATED_KEY_SEP - } else { - return - } + result = utils.META_OUT + utils.CONCATENATED_KEY_SEP if arrp.Tenant != "" && arrp.Tenant != utils.ANY { - result += arrp.Tenant - result += utils.CONCATENATED_KEY_SEP + result += arrp.Tenant + utils.CONCATENATED_KEY_SEP } else { return } if arrp.Category != "" && arrp.Category != utils.ANY { - result += arrp.Category - result += utils.CONCATENATED_KEY_SEP + result += arrp.Category + utils.CONCATENATED_KEY_SEP } else { return } @@ -1041,12 +1032,8 @@ func (arrp *AttrRemoveRatingProfile) GetId() (result string) { } func (apiv1 *ApierV1) RemoveRatingProfile(attr AttrRemoveRatingProfile, reply *string) error { - if attr.Direction == "" { - attr.Direction = utils.META_OUT - } - if (attr.Subject != "" && utils.IsSliceMember([]string{attr.Direction, attr.Tenant, attr.Category}, "")) || - (attr.Category != "" && utils.IsSliceMember([]string{attr.Direction, attr.Tenant}, "")) || - attr.Tenant != "" && attr.Direction == "" { + if (attr.Subject != "" && utils.IsSliceMember([]string{attr.Tenant, attr.Category}, "")) || + (attr.Category != "" && attr.Tenant == "") { return utils.ErrMandatoryIeMissing } _, err := guardian.Guardian.Guard(func() (interface{}, error) { diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go index bf240c0c5..ff060b514 100644 --- a/apier/v1/apier_it_test.go +++ b/apier/v1/apier_it_test.go @@ -1095,7 +1095,7 @@ func testApierExecuteAction(t *testing.T) { } func testApierSetActions(t *testing.T) { - act1 := &V1TPAction{Identifier: utils.TOPUP_RESET, BalanceType: utils.MONETARY, Directions: utils.META_OUT, Units: 75.0, ExpiryTime: utils.UNLIMITED, Weight: 20.0} + act1 := &V1TPAction{Identifier: utils.TOPUP_RESET, BalanceType: utils.MONETARY, Units: 75.0, ExpiryTime: utils.UNLIMITED, Weight: 20.0} attrs1 := &V1AttrSetActions{ActionsId: "ACTS_1", Actions: []*V1TPAction{act1}} reply1 := utils.EmptyString if err := rater.Call(utils.ApierV1SetActions, attrs1, &reply1); err != nil { @@ -1148,7 +1148,7 @@ func testApierAddTriggeredAction(t *testing.T) { t.Errorf("Calling ApierV1.AddBalance received: %s", reply) } // Add balance to a previously known account - attrsAddTrigger := &AttrAddActionTrigger{Tenant: "cgrates.org", Account: "dan32", BalanceDirection: "*out", BalanceType: utils.MONETARY, + attrsAddTrigger := &AttrAddActionTrigger{Tenant: "cgrates.org", Account: "dan32", BalanceType: utils.MONETARY, ThresholdType: "*min_balance", ThresholdValue: 2, BalanceDestinationIds: utils.META_ANY, Weight: 10, ActionsId: "WARN_VIA_HTTP"} if err := rater.Call(utils.ApierV1AddTriggeredAction, attrsAddTrigger, &reply); err != nil { t.Error("Got error on ApierV1.AddTriggeredAction: ", err.Error()) @@ -1885,7 +1885,7 @@ func testApierStartStopServiceStatus(t *testing.T) { func testApierReplayFailedPosts(t *testing.T) { fileName := "act>*http_post|*http_json|http%3A%2F%2Flocalhost%3A2081|63bed4ea-615e-4096-b1f4-499f64f29b28.json" - fileContent := []byte(`{"ID":"cgrates.org:1007","BalanceMap":{"*monetary":[{"Uuid":"367be35a-96ee-40a5-b609-9130661f5f12","ID":"","Value":0,"Directions":{"*out":true},"ExpirationDate":"0001-01-01T00:00:00Z","Weight":10,"DestinationIDs":{},"RatingSubject":"","Categories":{},"SharedGroups":{"SHARED_A":true},"Timings":null,"TimingIDs":{},"Disabled":false,"Factor":null,"Blocker":false}]},"UnitCounters":{"*monetary":[{"CounterType":"*event","Counters":[{"Value":0,"Filter":{"Uuid":null,"ID":"b8531413-10d5-47ad-81ad-2bc272e8f0ca","Type":"*monetary","Value":null,"Directions":{"*out":true},"ExpirationDate":null,"Weight":null,"DestinationIDs":{"FS_USERS":true},"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null}}]}]},"ActionTriggers":[{"ID":"STANDARD_TRIGGERS","UniqueID":"46ac7b8c-685d-4555-bf73-fa6cfbc2fa21","ThresholdType":"*min_balance","ThresholdValue":2,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"Directions":{"*out":true},"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":true,"LastExecutionTime":"2017-01-31T14:03:57.961651647+01:00"},{"ID":"STANDARD_TRIGGERS","UniqueID":"b8531413-10d5-47ad-81ad-2bc272e8f0ca","ThresholdType":"*max_event_counter","ThresholdValue":5,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"Directions":{"*out":true},"ExpirationDate":null,"Weight":null,"DestinationIDs":{"FS_USERS":true},"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"},{"ID":"STANDARD_TRIGGERS","UniqueID":"8b424186-7a31-4aef-99c5-35e12e6fed41","ThresholdType":"*max_balance","ThresholdValue":20,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"Directions":{"*out":true},"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"},{"ID":"STANDARD_TRIGGERS","UniqueID":"28557f3b-139c-4a27-9d17-bda1f54b7c19","ThresholdType":"*max_balance","ThresholdValue":100,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"Directions":{"*out":true},"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"DISABLE_AND_LOG","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"}],"AllowNegative":false,"Disabled":false}"`) + fileContent := []byte(`{"ID":"cgrates.org:1007","BalanceMap":{"*monetary":[{"Uuid":"367be35a-96ee-40a5-b609-9130661f5f12","ID":"","Value":0,"ExpirationDate":"0001-01-01T00:00:00Z","Weight":10,"DestinationIDs":{},"RatingSubject":"","Categories":{},"SharedGroups":{"SHARED_A":true},"Timings":null,"TimingIDs":{},"Disabled":false,"Factor":null,"Blocker":false}]},"UnitCounters":{"*monetary":[{"CounterType":"*event","Counters":[{"Value":0,"Filter":{"Uuid":null,"ID":"b8531413-10d5-47ad-81ad-2bc272e8f0ca","Type":"*monetary","Value":null,"ExpirationDate":null,"Weight":null,"DestinationIDs":{"FS_USERS":true},"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null}}]}]},"ActionTriggers":[{"ID":"STANDARD_TRIGGERS","UniqueID":"46ac7b8c-685d-4555-bf73-fa6cfbc2fa21","ThresholdType":"*min_balance","ThresholdValue":2,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":true,"LastExecutionTime":"2017-01-31T14:03:57.961651647+01:00"},{"ID":"STANDARD_TRIGGERS","UniqueID":"b8531413-10d5-47ad-81ad-2bc272e8f0ca","ThresholdType":"*max_event_counter","ThresholdValue":5,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"ExpirationDate":null,"Weight":null,"DestinationIDs":{"FS_USERS":true},"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"},{"ID":"STANDARD_TRIGGERS","UniqueID":"8b424186-7a31-4aef-99c5-35e12e6fed41","ThresholdType":"*max_balance","ThresholdValue":20,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"LOG_WARNING","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"},{"ID":"STANDARD_TRIGGERS","UniqueID":"28557f3b-139c-4a27-9d17-bda1f54b7c19","ThresholdType":"*max_balance","ThresholdValue":100,"Recurrent":false,"MinSleep":0,"ExpirationDate":"0001-01-01T00:00:00Z","ActivationDate":"0001-01-01T00:00:00Z","Balance":{"Uuid":null,"ID":null,"Type":"*monetary","Value":null,"ExpirationDate":null,"Weight":null,"DestinationIDs":null,"RatingSubject":null,"Categories":null,"SharedGroups":null,"TimingIDs":null,"Timings":null,"Disabled":null,"Factor":null,"Blocker":null},"Weight":10,"ActionsID":"DISABLE_AND_LOG","MinQueuedItems":0,"Executed":false,"LastExecutionTime":"0001-01-01T00:00:00Z"}],"AllowNegative":false,"Disabled":false}"`) args := ArgsReplyFailedPosts{ FailedRequestsInDir: utils.StringPointer("/tmp/TestsApierV1/in"), FailedRequestsOutDir: utils.StringPointer("/tmp/TestsApierV1/out"), diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index a7c4ee823..88e0c7953 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -161,7 +161,6 @@ var ( utils.OriginID: "dsafdsaf", utils.ToR: utils.VOICE, utils.RequestType: utils.META_RATED, - utils.Direction: "*out", utils.Tenant: "cgrates.org", utils.Category: "call", utils.Account: "1007", diff --git a/apier/v1/triggers.go b/apier/v1/triggers.go index ee3f91c1b..ecd40e31b 100644 --- a/apier/v1/triggers.go +++ b/apier/v1/triggers.go @@ -498,7 +498,6 @@ type AttrAddActionTrigger struct { ThresholdValue float64 BalanceId string BalanceType string - BalanceDirection string BalanceDestinationIds string BalanceRatingSubject string BalanceWeight float64 diff --git a/apier/v2/apier.go b/apier/v2/apier.go index 12d9f2670..a51d8a80b 100644 --- a/apier/v2/apier.go +++ b/apier/v2/apier.go @@ -249,7 +249,7 @@ func (apiv2 *ApierV2) SetActions(attrs utils.AttrSetActions, reply *string) erro for _, action := range attrs.Actions { requiredFields := []string{"Identifier", "Weight"} if action.BalanceType != "" { // Add some inter-dependent parameters - if balanceType then we are not talking about simply calling actions - requiredFields = append(requiredFields, "Direction", "Units") + requiredFields = append(requiredFields, "Units") } if missing := utils.MissingStructFields(action, requiredFields); len(missing) != 0 { return fmt.Errorf("%s:Action:%s:%v", utils.ErrMandatoryIeMissing.Error(), action.Identifier, missing) diff --git a/cdrc/cdrc_test.go b/cdrc/cdrc_test.go index 082760efb..f1c85fa3d 100644 --- a/cdrc/cdrc_test.go +++ b/cdrc/cdrc_test.go @@ -53,7 +53,6 @@ BYE|3111f3c9|49ca4c42|a58ebaae40d08d6757d8424fb09c4c54@0:0:0:0:0:0:0:0|200|OK|14 CdrHost: "0.0.0.0", CdrSource: "TEST_CDRC", ReqType: utils.META_PREPAID, - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "1001", @@ -75,7 +74,6 @@ BYE|3111f3c9|49ca4c42|a58ebaae40d08d6757d8424fb09c4c54@0:0:0:0:0:0:0:0|200|OK|14 CdrHost: "0.0.0.0", CdrSource: "TEST_CDRC", ReqType: utils.META_POSTPAID, - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "1002", @@ -97,7 +95,6 @@ BYE|3111f3c9|49ca4c42|a58ebaae40d08d6757d8424fb09c4c54@0:0:0:0:0:0:0:0|200|OK|14 CdrHost: "0.0.0.0", CdrSource: "TEST_CDRC", ReqType: utils.META_PREPAID, - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "1001", @@ -119,7 +116,6 @@ BYE|3111f3c9|49ca4c42|a58ebaae40d08d6757d8424fb09c4c54@0:0:0:0:0:0:0:0|200|OK|14 CdrHost: "0.0.0.0", CdrSource: "TEST_CDRC", ReqType: utils.META_PREPAID, - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "1001", diff --git a/cdrc/xml_test.go b/cdrc/xml_test.go index da0739094..06b38d61f 100644 --- a/cdrc/xml_test.go +++ b/cdrc/xml_test.go @@ -59,7 +59,6 @@ var cdrXmlBroadsoft = ` 1001 2001 - Terminating Network 1001 Public @@ -113,7 +112,6 @@ var cdrXmlBroadsoft = ` 1002 2001 - Terminating Network +4986517174964 Public diff --git a/config/cdrccfg_test.go b/config/cdrccfg_test.go index 4f4f9225b..a66d994b1 100644 --- a/config/cdrccfg_test.go +++ b/config/cdrccfg_test.go @@ -29,7 +29,7 @@ var cdrcCfg = CdrcCfg{ ID: utils.MetaDefault, CdrsConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)}, CdrFormat: "csv", - FieldSeparator: ',', + FieldSeparator: utils.FIELDS_SEP, MaxOpenFiles: 1024, CDRInPath: "/var/spool/cgrates/cdrc/in", CDROutPath: "/var/spool/cgrates/cdrc/out", diff --git a/config/cdrecfg_test.go b/config/cdrecfg_test.go index 142670091..8d1fd00a7 100644 --- a/config/cdrecfg_test.go +++ b/config/cdrecfg_test.go @@ -30,11 +30,11 @@ func TestCdreCfgClone(t *testing.T) { emptyFields := []*FCTemplate{} initContentFlds := []*FCTemplate{ {Tag: "CgrId", - Type: "*composed", + Type: utils.META_COMPOSED, FieldId: "cgrid", Value: cgrIdRsrs}, {Tag: "RunId", - Type: "*composed", + Type: utils.META_COMPOSED, FieldId: "runid", Value: runIdRsrs}, } @@ -48,11 +48,11 @@ func TestCdreCfgClone(t *testing.T) { } eClnContentFlds := []*FCTemplate{ {Tag: "CgrId", - Type: "*composed", + Type: utils.META_COMPOSED, FieldId: "cgrid", Value: cgrIdRsrs}, {Tag: "RunId", - Type: "*composed", + Type: utils.META_COMPOSED, FieldId: "runid", Value: runIdRsrs}, } diff --git a/config/multifiles_it_test.go b/config/multifiles_it_test.go index a31e37750..f16eda5a5 100644 --- a/config/multifiles_it_test.go +++ b/config/multifiles_it_test.go @@ -64,12 +64,9 @@ func TestMfCdreDefaultInstance(t *testing.T) { if len(mfCgrCfg.CdreProfiles[prfl].HeaderFields) != 0 { t.Error("Default instance has number of header fields: ", len(mfCgrCfg.CdreProfiles[prfl].HeaderFields)) } - if len(mfCgrCfg.CdreProfiles[prfl].ContentFields) != 12 { + if len(mfCgrCfg.CdreProfiles[prfl].ContentFields) != 11 { t.Error("Default instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].ContentFields)) } - if mfCgrCfg.CdreProfiles[prfl].ContentFields[2].Tag != "Direction" { - t.Error("Unexpected headerField value: ", mfCgrCfg.CdreProfiles[prfl].ContentFields[2].Tag) - } } func TestMfCdreExport1Instance(t *testing.T) { diff --git a/config/xmldp_test.go b/config/xmldp_test.go index 76f93786d..5dd298453 100644 --- a/config/xmldp_test.go +++ b/config/xmldp_test.go @@ -55,7 +55,6 @@ var cdrXmlBroadsoft = ` 1001 2001 - Terminating Network 1001 Public @@ -109,7 +108,6 @@ var cdrXmlBroadsoft = ` 1002 2001 - Terminating Network +4986517174964 Public diff --git a/console/datacost.go b/console/datacost.go index 1b058e3f9..5da56951a 100644 --- a/console/datacost.go +++ b/console/datacost.go @@ -28,7 +28,7 @@ func init() { c := &CmdGetDataCost{ name: "datacost", rpcMethod: utils.ApierV1GetDataCost, - clientArgs: []string{"Direction", "Category", "Tenant", "Account", "Subject", "StartTime", "Usage"}, + clientArgs: []string{"Category", "Tenant", "Account", "Subject", "StartTime", "Usage"}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/debit.go b/console/debit.go index 583002c5c..9204b5f1a 100644 --- a/console/debit.go +++ b/console/debit.go @@ -27,7 +27,7 @@ func init() { c := &CmdDebit{ name: "debit", rpcMethod: utils.ResponderDebit, - clientArgs: []string{"Direction", "Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject", "DryRun"}, + clientArgs: []string{"Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject", "DryRun"}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/debit_max.go b/console/debit_max.go index 20a14a7e4..4da72bd07 100644 --- a/console/debit_max.go +++ b/console/debit_max.go @@ -27,7 +27,7 @@ func init() { c := &CmdMaxDebit{ name: "debit_max", rpcMethod: utils.ResponderMaxDebit, - clientArgs: []string{"Direction", "Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"}, + clientArgs: []string{"Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/maxduration.go b/console/maxduration.go index 0fcfebbf0..beedd5836 100644 --- a/console/maxduration.go +++ b/console/maxduration.go @@ -31,7 +31,7 @@ func init() { c := &CmdGetMaxDuration{ name: "maxduration", rpcMethod: utils.ResponderGetMaxSessionTime, - clientArgs: []string{"Direction", "Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"}, + clientArgs: []string{"Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/ratingprofile_rem.go b/console/ratingprofile_rem.go index cd6d9ccf2..a84613ae5 100644 --- a/console/ratingprofile_rem.go +++ b/console/ratingprofile_rem.go @@ -53,13 +53,13 @@ func (self *CmdRemRatingProfile) RpcMethod() string { func (self *CmdRemRatingProfile) RpcParams(reset bool) interface{} { if reset || self.rpcParams == nil { - self.rpcParams = &v1.AttrRemoveRatingProfile{Direction: utils.META_OUT} + self.rpcParams = &v1.AttrRemoveRatingProfile{} } return self.rpcParams } func (self *CmdRemRatingProfile) PostprocessRpcParams() error { - if reflect.DeepEqual(self.rpcParams, &v1.AttrRemoveRatingProfile{Direction: utils.META_OUT}) { + if reflect.DeepEqual(self.rpcParams, &v1.AttrRemoveRatingProfile{}) { return utils.ErrMandatoryIeMissing } return nil diff --git a/data/conf/samples/cdrc_partcsv/cgrates.json b/data/conf/samples/cdrc_partcsv/cgrates.json index da06c6cbe..3a2eeddac 100644 --- a/data/conf/samples/cdrc_partcsv/cgrates.json +++ b/data/conf/samples/cdrc_partcsv/cgrates.json @@ -44,7 +44,6 @@ {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, @@ -84,7 +83,6 @@ {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, diff --git a/data/conf/samples/cdrccsv/cgrates.json b/data/conf/samples/cdrccsv/cgrates.json index ccbc12849..c77817049 100644 --- a/data/conf/samples/cdrccsv/cgrates.json +++ b/data/conf/samples/cdrccsv/cgrates.json @@ -47,7 +47,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -73,7 +72,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -99,7 +97,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -125,7 +122,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -154,7 +150,6 @@ {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", "value": "~*req.10", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, diff --git a/data/conf/samples/cdrcflatstore/cgrates.json b/data/conf/samples/cdrcflatstore/cgrates.json index def14dca8..827446284 100644 --- a/data/conf/samples/cdrcflatstore/cgrates.json +++ b/data/conf/samples/cdrcflatstore/cgrates.json @@ -51,7 +51,6 @@ {"tag": "Tor", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.7", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.8", "mandatory": true}, diff --git a/data/conf/samples/cdrcfwv/cgrates.json b/data/conf/samples/cdrcfwv/cgrates.json index a0bbd42c5..e53ef5d19 100644 --- a/data/conf/samples/cdrcfwv/cgrates.json +++ b/data/conf/samples/cdrcfwv/cgrates.json @@ -50,7 +50,6 @@ "content_fields": [ // import template, id will match internally CDR field, in case of .csv value will be represented by index of the field value {"tag": "Tor", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0-10", "padding":"right", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, diff --git a/data/conf/samples/cdrcfwvwithfilter/cgrates.json b/data/conf/samples/cdrcfwvwithfilter/cgrates.json index 88be685c1..d0adf1e42 100755 --- a/data/conf/samples/cdrcfwvwithfilter/cgrates.json +++ b/data/conf/samples/cdrcfwvwithfilter/cgrates.json @@ -52,7 +52,6 @@ "content_fields": [ // import template, id will match internally CDR field, in case of .csv value will be represented by index of the field value {"tag": "Tor", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0-10", "padding":"right", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, @@ -92,7 +91,6 @@ "content_fields": [ // import template, id will match internally CDR field, in case of .csv value will be represented by index of the field value {"tag": "Tor", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0-10", "padding":"right", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, diff --git a/data/conf/samples/cdrcxml/cgrates.json b/data/conf/samples/cdrcxml/cgrates.json index d7ee58ceb..b15a47379 100644 --- a/data/conf/samples/cdrcxml/cgrates.json +++ b/data/conf/samples/cdrcxml/cgrates.json @@ -34,7 +34,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, diff --git a/data/conf/samples/cdrcxmlwithfilter/cgrates.json b/data/conf/samples/cdrcxmlwithfilter/cgrates.json index 9838db3cf..8bb57eaaf 100755 --- a/data/conf/samples/cdrcxmlwithfilter/cgrates.json +++ b/data/conf/samples/cdrcxmlwithfilter/cgrates.json @@ -35,7 +35,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, @@ -57,7 +56,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.File.CDRs.Call.SignalingInfo.PChargingVector.icidvalue", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "XX.liquid.tel", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.File.CDRs.Call.OrigParty.SubscriberAddr", "mandatory": true}, @@ -82,7 +80,6 @@ {"tag": "OriginID2", "field_id": "OriginID", "type": "*composed", "value": "~*req.File.CDRs.Call.OrigParty.SIPCallId:s/^(.*)@.*/$1/", "mandatory": true}, {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", "value": "~*req.File.CDRs.Call.OrigParty.SIPCallId:s/^.*@(.*)/$1/", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "XX.liquid.tel", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.File.CDRs.Call.OrigParty.SubscriberAddr", "mandatory": true}, @@ -106,7 +103,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, @@ -128,7 +124,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.complete-success-notification.userid", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.complete-success-notification.callleg.number", "mandatory": true}, diff --git a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json index 351d07eb4..c60d2262d 100644 --- a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json @@ -50,7 +50,6 @@ {"tag":"OriginID", "type": "*composed", "value": "~OriginID", "field_id": "OriginID"}, {"tag":"OriginHost", "type": "*composed", "value": "~OriginHost", "field_id": "OriginHost"}, {"tag":"RequestType", "type": "*composed", "value": "~RequestType", "field_id": "RequestType"}, - {"tag":"Direction", "type": "*composed", "value": "~Direction", "field_id": "Direction"}, {"tag":"Tenant", "type": "*composed", "value": "~Tenant", "field_id": "Tenant"}, {"tag":"Category", "type": "*composed", "value": "~Category", "field_id": "Category"}, {"tag":"Account", "type": "*composed", "value": "~Account", "field_id": "Account"}, @@ -73,7 +72,6 @@ {"tag":"OriginID", "type": "*composed", "value": "~OriginID", "field_id": "OriginID"}, {"tag":"OriginHost", "type": "*composed", "value": "~OriginHost", "field_id": "OriginHost"}, {"tag":"RequestType", "type": "*composed", "value": "~RequestType", "field_id": "RequestType"}, - {"tag":"Direction", "type": "*composed", "value": "~Direction", "field_id": "Direction"}, {"tag":"Tenant", "type": "*composed", "value": "~Tenant", "field_id": "Tenant"}, {"tag":"Category", "type": "*composed", "value": "~Category", "field_id": "Category"}, {"tag":"Account", "type": "*composed", "value": "~Account", "field_id": "Account"}, diff --git a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json index 517c65d4b..6d42049a9 100644 --- a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json @@ -48,7 +48,6 @@ {"tag":"OriginID", "type": "*composed", "value": "~OriginID", "field_id": "OriginID"}, {"tag":"OriginHost", "type": "*composed", "value": "~OriginHost", "field_id": "OriginHost"}, {"tag":"RequestType", "type": "*composed", "value": "~RequestType", "field_id": "RequestType"}, - {"tag":"Direction", "type": "*composed", "value": "~Direction", "field_id": "Direction"}, {"tag":"Tenant", "type": "*composed", "value": "~Tenant", "field_id": "Tenant"}, {"tag":"Category", "type": "*composed", "value": "~Category", "field_id": "Category"}, {"tag":"Account", "type": "*composed", "value": "~Account", "field_id": "Account"}, @@ -71,7 +70,6 @@ {"tag":"OriginID", "type": "*composed", "value": "~OriginID", "field_id": "OriginID"}, {"tag":"OriginHost", "type": "*composed", "value": "~OriginHost", "field_id": "OriginHost"}, {"tag":"RequestType", "type": "*composed", "value": "~RequestType", "field_id": "RequestType"}, - {"tag":"Direction", "type": "*composed", "value": "~Direction", "field_id": "Direction"}, {"tag":"Tenant", "type": "*composed", "value": "~Tenant", "field_id": "Tenant"}, {"tag":"Category", "type": "*composed", "value": "~Category", "field_id": "Category"}, {"tag":"Account", "type": "*composed", "value": "~Account", "field_id": "Account"}, diff --git a/data/conf/samples/ers_internal/cgrates.json b/data/conf/samples/ers_internal/cgrates.json index 1136c2a3e..7f0d328f1 100644 --- a/data/conf/samples/ers_internal/cgrates.json +++ b/data/conf/samples/ers_internal/cgrates.json @@ -96,7 +96,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -210,7 +209,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, diff --git a/data/conf/samples/ers_mongo/cgrates.json b/data/conf/samples/ers_mongo/cgrates.json index ba2898cef..b5f3ac56a 100644 --- a/data/conf/samples/ers_mongo/cgrates.json +++ b/data/conf/samples/ers_mongo/cgrates.json @@ -99,7 +99,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -213,7 +212,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, diff --git a/data/conf/samples/ers_mysql/cgrates.json b/data/conf/samples/ers_mysql/cgrates.json index a0e9f9ba3..96aab6dfa 100644 --- a/data/conf/samples/ers_mysql/cgrates.json +++ b/data/conf/samples/ers_mysql/cgrates.json @@ -96,7 +96,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -210,7 +209,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, diff --git a/data/conf/samples/ers_postgres/cgrates.json b/data/conf/samples/ers_postgres/cgrates.json index b9e9296a0..b9d2bd939 100644 --- a/data/conf/samples/ers_postgres/cgrates.json +++ b/data/conf/samples/ers_postgres/cgrates.json @@ -93,7 +93,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, @@ -207,7 +206,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, diff --git a/data/conf/samples/ers_reload/first_reload/cgrates.json b/data/conf/samples/ers_reload/first_reload/cgrates.json index b298f251b..08912bc04 100644 --- a/data/conf/samples/ers_reload/first_reload/cgrates.json +++ b/data/conf/samples/ers_reload/first_reload/cgrates.json @@ -88,7 +88,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, diff --git a/data/conf/samples/ers_reload/second_reload/cgrates.json b/data/conf/samples/ers_reload/second_reload/cgrates.json index 8e4b5bba8..2bd726030 100644 --- a/data/conf/samples/ers_reload/second_reload/cgrates.json +++ b/data/conf/samples/ers_reload/second_reload/cgrates.json @@ -88,7 +88,6 @@ {"tag": "TOR", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true}, {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true}, {"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true}, - {"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true}, {"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true}, {"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true}, {"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true}, diff --git a/data/conf/samples/fscsv/freeswitch_csvcdr.json b/data/conf/samples/fscsv/freeswitch_csvcdr.json index c3d7fef44..704718970 100644 --- a/data/conf/samples/fscsv/freeswitch_csvcdr.json +++ b/data/conf/samples/fscsv/freeswitch_csvcdr.json @@ -12,7 +12,6 @@ {"tag": "tor", "cdr_field_id": "tor", "type": "cdrfield", "value": "^*voice", "mandatory": true}, {"tag": "accid", "cdr_field_id": "accid", "type": "cdrfield", "value": "10", "mandatory": true}, {"tag": "reqtype", "cdr_field_id": "reqtype", "type": "cdrfield", "value": "^rated", "mandatory": true}, - {"tag": "direction", "cdr_field_id": "direction", "type": "cdrfield", "value": "^*out", "mandatory": true}, {"tag": "tenant", "cdr_field_id": "tenant", "type": "cdrfield", "value": "^cgrates.org", "mandatory": true}, {"tag": "category", "cdr_field_id": "category", "type": "cdrfield", "value": "^call", "mandatory": true}, {"tag": "account", "cdr_field_id": "account", "type": "cdrfield", "value": "12", "mandatory": true}, diff --git a/data/conf/samples/multifiles/a.json b/data/conf/samples/multifiles/a.json index c16e6d9ea..c6525227b 100644 --- a/data/conf/samples/multifiles/a.json +++ b/data/conf/samples/multifiles/a.json @@ -12,7 +12,6 @@ "content_fields": [ // template of the exported content fields {"tag":"AccId", "cdr_field_id": "accid", "type": "cdrfield", "value": "accid"}, {"tag":"ReqType", "cdr_field_id": "reqtype", "type": "cdrfield", "value": "reqtype"}, - {"tag":"Direction", "cdr_field_id": "direction", "type": "cdrfield", "value": "direction"}, {"tag":"Tenant", "cdr_field_id": "tenant", "type": "cdrfield", "value": "tenant"}, {"tag":"Category", "cdr_field_id": "category", "type": "cdrfield", "value": "category"}, {"tag":"Account", "cdr_field_id": "account", "type": "cdrfield", "value": "account"}, diff --git a/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json b/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json index 0de8dc003..b8996c811 100644 --- a/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json +++ b/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json @@ -42,7 +42,6 @@ {"cdr_field_id": "tor", "value": "~7:s/^(voice|data|sms|generic)$/*$1/"}, {"cdr_field_id": "accid", "value": "0"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "~7:s/^voice$/call/"}, {"cdr_field_id": "account", "value": "3"}, @@ -64,7 +63,6 @@ {"cdr_field_id": "tor", "value": "^*voice"}, {"cdr_field_id": "accid", "value": "~3:s/^(\\d{2})\\.(\\d{2})\\.(\\d{4})\\s{2}(\\d{2}):(\\d{2}):(\\d{2})$/$1$2$3$4$5$6/"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "^call"}, {"cdr_field_id": "account", "value": "~0:s/^([1-9]\\d+)$/+$1/"}, diff --git a/data/conf/samples/multiplecdrc_internal/multiplecdrc_fwexport.json b/data/conf/samples/multiplecdrc_internal/multiplecdrc_fwexport.json index 276f8c492..70b615b13 100644 --- a/data/conf/samples/multiplecdrc_internal/multiplecdrc_fwexport.json +++ b/data/conf/samples/multiplecdrc_internal/multiplecdrc_fwexport.json @@ -46,7 +46,6 @@ {"cdr_field_id": "tor", "value": "~7:s/^(voice|data|sms|generic)$/*$1/"}, {"cdr_field_id": "accid", "value": "0"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "~7:s/^voice$/call/"}, {"cdr_field_id": "account", "value": "3"}, @@ -68,7 +67,6 @@ {"cdr_field_id": "tor", "value": "^*voice"}, {"cdr_field_id": "accid", "value": "~3:s/^(\\d{2})\\.(\\d{2})\\.(\\d{4})\\s{2}(\\d{2}):(\\d{2}):(\\d{2})$/$1$2$3$4$5$6/"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "^call"}, {"cdr_field_id": "account", "value": "~0:s/^([1-9]\\d+)$/+$1/"}, diff --git a/data/conf/samples/multiplecdrc_mongo/multiplecdrc_fwexport.json b/data/conf/samples/multiplecdrc_mongo/multiplecdrc_fwexport.json index b9bdfe204..8609014ea 100644 --- a/data/conf/samples/multiplecdrc_mongo/multiplecdrc_fwexport.json +++ b/data/conf/samples/multiplecdrc_mongo/multiplecdrc_fwexport.json @@ -51,7 +51,6 @@ {"cdr_field_id": "tor", "value": "~7:s/^(voice|data|sms|generic)$/*$1/"}, {"cdr_field_id": "accid", "value": "0"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "~7:s/^voice$/call/"}, {"cdr_field_id": "account", "value": "3"}, @@ -73,7 +72,6 @@ {"cdr_field_id": "tor", "value": "^*voice"}, {"cdr_field_id": "accid", "value": "~3:s/^(\\d{2})\\.(\\d{2})\\.(\\d{4})\\s{2}(\\d{2}):(\\d{2}):(\\d{2})$/$1$2$3$4$5$6/"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "^call"}, {"cdr_field_id": "account", "value": "~0:s/^([1-9]\\d+)$/+$1/"}, diff --git a/data/conf/samples/multiplecdrc_mysql/multiplecdrc_fwexport.json b/data/conf/samples/multiplecdrc_mysql/multiplecdrc_fwexport.json index 0de8dc003..b8996c811 100644 --- a/data/conf/samples/multiplecdrc_mysql/multiplecdrc_fwexport.json +++ b/data/conf/samples/multiplecdrc_mysql/multiplecdrc_fwexport.json @@ -42,7 +42,6 @@ {"cdr_field_id": "tor", "value": "~7:s/^(voice|data|sms|generic)$/*$1/"}, {"cdr_field_id": "accid", "value": "0"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "~7:s/^voice$/call/"}, {"cdr_field_id": "account", "value": "3"}, @@ -64,7 +63,6 @@ {"cdr_field_id": "tor", "value": "^*voice"}, {"cdr_field_id": "accid", "value": "~3:s/^(\\d{2})\\.(\\d{2})\\.(\\d{4})\\s{2}(\\d{2}):(\\d{2}):(\\d{2})$/$1$2$3$4$5$6/"}, {"cdr_field_id": "reqtype", "value": "^rated"}, - {"cdr_field_id": "direction", "value": "^*out"}, {"cdr_field_id": "tenant", "value": "^cgrates.org"}, {"cdr_field_id": "category", "value": "^call"}, {"cdr_field_id": "account", "value": "~0:s/^([1-9]\\d+)$/+$1/"}, diff --git a/data/storage/migrator/mysql_cdr_migration.sql b/data/storage/migrator/mysql_cdr_migration.sql index 3740af1ed..9abe2d7e0 100755 --- a/data/storage/migrator/mysql_cdr_migration.sql +++ b/data/storage/migrator/mysql_cdr_migration.sql @@ -31,8 +31,8 @@ BEGIN SET max_cdrs = (select max(id) from rated_cdrs); WHILE (start_id <= max_cdrs) DO INSERT INTO - cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,direction,tenant,category,account,subject,destination,setup_time,pdd,answer_time,`usage`,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) - SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type,rated_cdrs.direction, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.`usage`,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, null + cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,tenant,category,account,subject,destination,setup_time,pdd,answer_time,`usage`,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) + SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.`usage`,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, null FROM rated_cdrs INNER JOIN cdrs_primary ON rated_cdrs.cgrid = cdrs_primary.cgrid INNER JOIN cdrs_extra ON rated_cdrs.cgrid = cdrs_extra.cgrid diff --git a/data/storage/migrator/mysql_tables_update.sql b/data/storage/migrator/mysql_tables_update.sql index bb2141daf..bb65b7f11 100755 --- a/data/storage/migrator/mysql_tables_update.sql +++ b/data/storage/migrator/mysql_tables_update.sql @@ -13,7 +13,6 @@ CREATE TABLE cdrs ( origin_id varchar(64) NOT NULL, tor varchar(16) NOT NULL, request_type varchar(24) NOT NULL, - direction varchar(8) NOT NULL, tenant varchar(64) NOT NULL, category varchar(64) NOT NULL, account varchar(128) NOT NULL, diff --git a/data/storage/migrator/pg_cdr_migration.sql b/data/storage/migrator/pg_cdr_migration.sql index c4f41aab8..857f53347 100755 --- a/data/storage/migrator/pg_cdr_migration.sql +++ b/data/storage/migrator/pg_cdr_migration.sql @@ -24,8 +24,8 @@ BEGIN LOOP --RAISE NOTICE '%', (to_char(start_id, '99999999') || '-' || to_char(end_id, '99999999')); INSERT INTO - cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,direction,tenant,category,account,subject,destination,setup_time,pdd,answer_time,usage,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) - SELECT DISTINCT ON (cdrs_primary.cgrid, rated_cdrs.runid, cdrs_primary.accid) cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type,rated_cdrs.direction, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.usage,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, null + cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,tenant,category,account,subject,destination,setup_time,pdd,answer_time,usage,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) + SELECT DISTINCT ON (cdrs_primary.cgrid, rated_cdrs.runid, cdrs_primary.accid) cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.usage,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, null FROM rated_cdrs INNER JOIN cdrs_primary ON rated_cdrs.cgrid = cdrs_primary.cgrid INNER JOIN cdrs_extra ON rated_cdrs.cgrid = cdrs_extra.cgrid diff --git a/data/storage/migrator/pg_tables_update.sql b/data/storage/migrator/pg_tables_update.sql index 1332da31c..d14da37bc 100755 --- a/data/storage/migrator/pg_tables_update.sql +++ b/data/storage/migrator/pg_tables_update.sql @@ -12,7 +12,6 @@ CREATE TABLE cdrs ( origin_id VARCHAR(64) NOT NULL, tor VARCHAR(16) NOT NULL, request_type VARCHAR(24) NOT NULL, - direction VARCHAR(8) NOT NULL, tenant VARCHAR(64) NOT NULL, category VARCHAR(64) NOT NULL, account VARCHAR(128) NOT NULL, diff --git a/data/storage/mysql/mysql_cdr_migration.sql b/data/storage/mysql/mysql_cdr_migration.sql index 8a3c39a5a..b44d1596d 100644 --- a/data/storage/mysql/mysql_cdr_migration.sql +++ b/data/storage/mysql/mysql_cdr_migration.sql @@ -31,8 +31,8 @@ BEGIN SET max_cdrs = (select max(id) from rated_cdrs); WHILE (start_id <= max_cdrs) DO INSERT INTO - cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,direction,tenant,category,account,subject,destination,setup_time,pdd,answer_time,`usage`,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) - SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type,rated_cdrs.direction, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.`usage`,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, rated_cdrs.deleted_at + cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,tenant,category,account,subject,destination,setup_time,pdd,answer_time,`usage`,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) + SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.`usage`,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, rated_cdrs.deleted_at FROM rated_cdrs INNER JOIN cdrs_primary ON rated_cdrs.cgrid = cdrs_primary.cgrid INNER JOIN cdrs_extra ON rated_cdrs.cgrid = cdrs_extra.cgrid diff --git a/data/storage/postgres/pg_cdr_migration.sql b/data/storage/postgres/pg_cdr_migration.sql index 1cb42a55e..5f40cb6d0 100644 --- a/data/storage/postgres/pg_cdr_migration.sql +++ b/data/storage/postgres/pg_cdr_migration.sql @@ -24,8 +24,8 @@ BEGIN LOOP --RAISE NOTICE '%', (to_char(start_id, '99999999') || '-' || to_char(end_id, '99999999')); INSERT INTO - cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,direction,tenant,category,account,subject,destination,setup_time,pdd,answer_time,usage,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) - SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type,rated_cdrs.direction, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.usage,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, rated_cdrs.deleted_at + cdrs(cgrid,run_id,origin_host,source,origin_id,tor,request_type,tenant,category,account,subject,destination,setup_time,pdd,answer_time,usage,supplier,disconnect_cause,extra_fields,cost_source,cost,cost_details,extra_info, created_at, updated_at, deleted_at) + SELECT cdrs_primary.cgrid,rated_cdrs.runid as run_id,cdrs_primary.cdrhost as origin_host,cdrs_primary.cdrsource as source,cdrs_primary.accid as origin_id, cdrs_primary.tor,rated_cdrs.reqtype as request_type, rated_cdrs.tenant,rated_cdrs.category, rated_cdrs.account, rated_cdrs.subject, rated_cdrs.destination,rated_cdrs.setup_time,rated_cdrs.pdd,rated_cdrs.answer_time,rated_cdrs.usage,rated_cdrs.supplier,rated_cdrs.disconnect_cause,cdrs_extra.extra_fields,cost_details.cost_source,rated_cdrs.cost,cost_details.timespans as cost_details,rated_cdrs.extra_info,rated_cdrs.created_at,rated_cdrs.updated_at, rated_cdrs.deleted_at FROM rated_cdrs INNER JOIN cdrs_primary ON rated_cdrs.cgrid = cdrs_primary.cgrid INNER JOIN cdrs_extra ON rated_cdrs.cgrid = cdrs_extra.cgrid diff --git a/data/tariffplans/osips_training/Actions.csv b/data/tariffplans/osips_training/Actions.csv index 19337c74f..725fa994c 100644 --- a/data/tariffplans/osips_training/Actions.csv +++ b/data/tariffplans/osips_training/Actions.csv @@ -1,4 +1,4 @@ -#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Directions[5],Categories[6],DestinationIds[7],RatingSubject[8],SharedGroup[9],ExpiryTime[10],TimingIds[11],Units[12],BalanceWeight[13],BalanceBlocker[14],BalanceDisabled[15],Weight[16] +#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Categories[6],DestinationIds[7],RatingSubject[8],SharedGroup[9],ExpiryTime[10],TimingIds[11],Units[12],BalanceWeight[13],BalanceBlocker[14],BalanceDisabled[15],Weight[16] TOPUP_MONETARY_5,*topup_reset,,,,*monetary,,*any,,,*unlimited,,10,10,false,false,10 TOPUP_VOICE_200,*topup_reset,,,,*voice,,DST_ON_NET,,,*unlimited,,12000,20,false,false,10 LOG_WARNING,*log,,,,,,,,,,,,,false,false,10 diff --git a/data/tariffplans/osips_training/CdrStats.csv b/data/tariffplans/osips_training/CdrStats.csv deleted file mode 100644 index b876a7f0d..000000000 --- a/data/tariffplans/osips_training/CdrStats.csv +++ /dev/null @@ -1,6 +0,0 @@ -#Id[0],QueueLength[1],TimeWindow[2],SaveInerval[3],Metric[4],SetupInterval[5],TOR[6],CdrHost[7],CdrSource[8],ReqType[9],Direction[10],Tenant[11],Category[12],Account[13],Subject[14],DestinationIds[15],PddInterval[16],UsageInterval[17],Supplier[18],DisconnectCause[19],RunIds[20],RatedAccount[21],RatedSubject[22],CostInterval[23],Triggers[24] -STATS_TEST,10,0,10s,ASR,,,,,,,cgrates.org,,,,,,,,,*default,,,,STATS_WARN -STATS_TEST,,,,ACD,,,,,,,,,,,,,,,,,,,, -STATS_TEST,,,,ACC,,,,,,,,,,,,,,,,,,,, -STATS_TEST,,,,TCD,,,,,,,,,,,,,,,,,,,, -STATS_TEST,,,,TCC,,,,,,,,,,,,,,,,,,,, diff --git a/data/tester/cgr-tester.py b/data/tester/cgr-tester.py index 4b8afb549..3b0bc416a 100644 --- a/data/tester/cgr-tester.py +++ b/data/tester/cgr-tester.py @@ -43,8 +43,7 @@ class JSONClient(object): rpc =JSONClient(("127.0.0.1", 2012)) -cd = {"Direction":"*out", - "TOR":"*voice", +cd = {"TOR":"*voice", "Category": "call", "Tenant": "cgrates.org", "Subject": "1001", diff --git a/engine/account.go b/engine/account.go index 75ca2e26e..b390dcb20 100644 --- a/engine/account.go +++ b/engine/account.go @@ -948,7 +948,6 @@ func (acc *Account) AsOldStructure() interface{} { } type Balances []*Balance type UnitsCounter struct { - Direction string BalanceType string // Units float64 Balances Balances // first balance is the general one (no destination) @@ -961,7 +960,6 @@ func (acc *Account) AsOldStructure() interface{} { MinSleep time.Duration BalanceId string BalanceType string - BalanceDirection string BalanceDestinationIds string BalanceWeight float64 BalanceExpirationDate time.Time @@ -1032,7 +1030,6 @@ func (acc *Account) AsOldStructure() interface{} { MinSleep: at.MinSleep, BalanceType: at.Balance.GetType(), BalanceId: b.ID, - BalanceDirection: utils.META_OUT, BalanceDestinationIds: b.DestinationIDs.String(), BalanceWeight: b.Weight, BalanceExpirationDate: b.ExpirationDate, diff --git a/engine/actions_it_test.go b/engine/actions_it_test.go index f8d78086d..436c7fbbe 100644 --- a/engine/actions_it_test.go +++ b/engine/actions_it_test.go @@ -343,7 +343,6 @@ func testActionsitThresholdCDrLog(t *testing.T) { utils.OriginID: "dsafdsaf", utils.ToR: utils.VOICE, utils.RequestType: utils.META_RATED, - utils.Direction: "*out", utils.Tenant: "cgrates.org", utils.Category: "call", utils.Account: "th_acc", diff --git a/engine/actions_test.go b/engine/actions_test.go index 47d49d356..4a0dea67e 100644 --- a/engine/actions_test.go +++ b/engine/actions_test.go @@ -692,7 +692,7 @@ func TestActionTriggerMatchAllFull(t *testing.T) { ThresholdValue: 2, } a := &Action{Balance: &BalanceFilter{Type: utils.StringPointer(utils.MONETARY)}, - ExtraParameters: fmt.Sprintf(`{"ThresholdType":"%v", "ThresholdValue": %v, "BalanceDirections":"*out"}`, + ExtraParameters: fmt.Sprintf(`{"ThresholdType":"%v", "ThresholdValue": %v}`, utils.TRIGGER_MAX_BALANCE, 2)} if !at.Match(a) { t.Errorf("Action trigger [%v] does not match action [%v]", at, a) diff --git a/engine/callcost_test.go b/engine/callcost_test.go index b9cc1741d..df910c174 100644 --- a/engine/callcost_test.go +++ b/engine/callcost_test.go @@ -104,7 +104,7 @@ func TestMultipleInputLeftMerge(t *testing.T) { } /*t1 = time.Date(2012, time.February, 2, 18, 01, 0, 0, time.UTC) t2 = time.Date(2012, time.February, 2, 18, 02, 0, 0, time.UTC) - cd = &CallDescriptor{Direction: utils.META_OUT, TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2} + cd = &CallDescriptor{TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2} cc2, _ := cd.getCost() if cc2.Cost != 30 { t.Errorf("expected 30 was %v", cc2.Cost) diff --git a/engine/cdr_test.go b/engine/cdr_test.go index c1457b57a..c8d76ed08 100644 --- a/engine/cdr_test.go +++ b/engine/cdr_test.go @@ -331,7 +331,7 @@ func TestFormatCost(t *testing.T) { /* func TestCDRAsHttpForm(t *testing.T) { storCdr := CDR{CGRID: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), OrderID: 123, ToR: utils.VOICE, OriginID: "dsafdsaf", - OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.META_RATED, Direction: "*out", + OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.META_RATED, Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002", SetupTime: time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC), AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.MetaDefault, Usage: time.Duration(10) * time.Second, Supplier: "SUPPL1", @@ -353,9 +353,6 @@ func TestCDRAsHttpForm(t *testing.T) { if cdrForm.Get(utils.RequestType) != utils.META_RATED { t.Errorf("Expected: %s, received: %s", utils.META_RATED, cdrForm.Get(utils.RequestType)) } - if cdrForm.Get(utils.DIRECTION) != "*out" { - t.Errorf("Expected: %s, received: %s", "*out", cdrForm.Get(utils.DIRECTION)) - } if cdrForm.Get(utils.Tenant) != "cgrates.org" { t.Errorf("Expected: %s, received: %s", "cgrates.org", cdrForm.Get(utils.Tenant)) } diff --git a/engine/cgrcdr_test.go b/engine/cgrcdr_test.go index 4ece8231d..a6b97f6fb 100644 --- a/engine/cgrcdr_test.go +++ b/engine/cgrcdr_test.go @@ -26,7 +26,7 @@ import ( ) /* -curl --data "OriginID=asbfdsaf&OriginHost=192.168.1.1&RequestType=rated&direction=*out&tenant=cgrates.org&tor=call&account=1001&subject=1001&destination=1002&time_answer=1383813746&duration=10&field_extr1=val_extr1&fieldextr2=valextr2" http://ipbxdev:2080/cgr +curl --data "OriginID=asbfdsaf&OriginHost=192.168.1.1&RequestType=rated&tenant=cgrates.org&tor=call&account=1001&subject=1001&destination=1002&time_answer=1383813746&duration=10&field_extr1=val_extr1&fieldextr2=valextr2" http://ipbxdev:2080/cgr */ func TestCgrCdrInterfaces(t *testing.T) { diff --git a/engine/fscdr.go b/engine/fscdr.go index 7addd98aa..d91843e4a 100644 --- a/engine/fscdr.go +++ b/engine/fscdr.go @@ -32,7 +32,6 @@ import ( const ( // Freswitch event property names FS_CDR_MAP = "variables" - FS_DIRECTION = "direction" FS_UUID = "uuid" // -Unique ID for this call leg FS_CALL_DEST_NR = "dialed_extension" FS_PARK_TIME = "start_epoch" diff --git a/engine/fscdr_test.go b/engine/fscdr_test.go index 391e82375..6f35f130b 100644 --- a/engine/fscdr_test.go +++ b/engine/fscdr_test.go @@ -31,7 +31,6 @@ var body = []byte(`{ "switchname": "FSDev1", "channel_data": { "state": "CS_REPORTING", - "direction": "inbound", "state_number": "11", "flags": "0=1;1=1;3=1;20=1;37=1;38=1;40=1;43=1;48=1;53=1;75=1;98=1;112=1;113=1;122=1;134=1", "caps": "1=1;2=1;3=1;4=1;5=1;6=1" @@ -72,7 +71,6 @@ var body = []byte(`{ } }, "variables": { - "direction": "inbound", "uuid": "3da8bf84-c133-4959-9e24-e72875cb33a1", "session_id": "7", "sip_from_user": "1001", @@ -482,13 +480,11 @@ func TestFsCdrDDazRSRExtraFields(t *testing.T) { "core-uuid": "feef0b51-7fdf-4c4a-878e-aff233752de2", "channel_data": { "state": "CS_REPORTING", - "direction": "inbound", "state_number": "11", "flags": "0=1;1=1;3=1;36=1;37=1;39=1;42=1;47=1;52=1;73=1;75=1;94=1", "caps": "1=1;2=1;3=1;4=1;5=1;6=1" }, "variables": { - "direction": "inbound", "uuid": "86cfd6e2-dbda-45a3-b59d-f683ec368e8b", "session_id": "5", "accountcode": "1001", diff --git a/engine/storage_mongo_datadb.go b/engine/storage_mongo_datadb.go index a86a57ce8..04b9b1240 100644 --- a/engine/storage_mongo_datadb.go +++ b/engine/storage_mongo_datadb.go @@ -87,7 +87,6 @@ var ( CDRHostLow = strings.ToLower(utils.OriginHost) CDRSourceLow = strings.ToLower(utils.Source) RequestTypeLow = strings.ToLower(utils.RequestType) - DirectionLow = strings.ToLower(utils.Direction) TenantLow = strings.ToLower(utils.Tenant) CategoryLow = strings.ToLower(utils.Category) AccountLow = strings.ToLower(utils.Account) diff --git a/ers/filexml_it_test.go b/ers/filexml_it_test.go index 988e7f0b1..1bf5cb605 100644 --- a/ers/filexml_it_test.go +++ b/ers/filexml_it_test.go @@ -163,7 +163,6 @@ var cdrXmlBroadsoft = ` 1001 2001 - Terminating Network 1001 Public @@ -217,7 +216,6 @@ var cdrXmlBroadsoft = ` 1002 2001 - Terminating Network +4986517174964 Public diff --git a/general_tests/cdrs_onlexp_it_test.go b/general_tests/cdrs_onlexp_it_test.go index 29fdcf944..cf8b0d952 100644 --- a/general_tests/cdrs_onlexp_it_test.go +++ b/general_tests/cdrs_onlexp_it_test.go @@ -614,7 +614,7 @@ func testCdrsHttpCdrReplication2(t *testing.T) { for i := 0; i < 10000; i++ { cdr := &engine.CDR{OriginID: fmt.Sprintf("httpjsonrpc_%d", i), ToR: utils.VOICE, OriginHost: "192.168.1.1", Source: "UNKNOWN", RequestType: utils.META_PSEUDOPREPAID, - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002", + Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1002", SetupTime: time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC), AnswerTime: time.Date(2013, 12, 7, 8, 42, 26, 0, time.UTC), Usage: time.Duration(10) * time.Second, ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} cdrs = append(cdrs, cdr) diff --git a/general_tests/costs1_test.go b/general_tests/costs1_test.go index ec151994f..fcfea3250 100644 --- a/general_tests/costs1_test.go +++ b/general_tests/costs1_test.go @@ -131,7 +131,6 @@ func TestCosts1GetCost2(t *testing.T) { tStart, _ := utils.ParseTimeDetectLayout("2004-06-04T00:00:01Z") tEnd, _ := utils.ParseTimeDetectLayout("2004-06-04T00:01:01Z") cd := &engine.CallDescriptor{ - Direction: "*out", Category: "call", Tenant: "cgrates.org", Subject: "1001", diff --git a/general_tests/dest_management_it_test.go b/general_tests/dest_management_it_test.go index e8ae994b7..bdff73488 100644 --- a/general_tests/dest_management_it_test.go +++ b/general_tests/dest_management_it_test.go @@ -312,7 +312,6 @@ func testDestManagCacheWithGetCost(t *testing.T) { var cc engine.CallCost cd := &engine.CallDescriptor{ - Direction: "*out", Tenant: "cgrates.org", Category: "call", Account: "test", diff --git a/general_tests/oldtutorial_it_test.go b/general_tests/oldtutorial_it_test.go index 7677d6999..33453f2bc 100644 --- a/general_tests/oldtutorial_it_test.go +++ b/general_tests/oldtutorial_it_test.go @@ -165,7 +165,6 @@ package general_tests // // func TestTutITGetMatchingAlias(t *testing.T) { // // args := engine.AttrMatchingAlias{ // // Destination: "1005", -// // Direction: "*out", // // Tenant: "cgrates.org", // // Category: "call", // // Account: "1006", @@ -188,7 +187,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:00:20Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -206,7 +204,6 @@ package general_tests // } // // Make sure that the same cost is returned via users aliasing // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: utils.USERS, // Subject: utils.USERS, @@ -225,7 +222,6 @@ package general_tests // tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -243,7 +239,6 @@ package general_tests // tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ = utils.ParseDate("2014-08-04T13:00:20Z") // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -261,7 +256,6 @@ package general_tests // tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -279,7 +273,6 @@ package general_tests // tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ = utils.ParseDate("2014-08-04T13:00:20Z") // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -297,7 +290,6 @@ package general_tests // tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -314,7 +306,6 @@ package general_tests // } // tStart = time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC) // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -329,7 +320,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -344,7 +334,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1002", @@ -359,7 +348,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1002", @@ -374,7 +362,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -389,7 +376,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -404,7 +390,6 @@ package general_tests // t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -424,7 +409,6 @@ package general_tests // func TestTutITMaxDebit(t *testing.T) { // tStart := time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC) // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -441,7 +425,6 @@ package general_tests // t.Errorf("Calling Responder.MaxDebit got callcost: %v", cc.GetDuration()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -457,7 +440,6 @@ package general_tests // t.Errorf("Calling Responder.MaxDebit got duration: %v", cc.GetDuration()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -474,7 +456,6 @@ package general_tests // t.Errorf("Calling Responder.MaxDebit got callcost: %v", cc.GetDuration()) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1004", @@ -744,7 +725,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1005", @@ -772,7 +752,6 @@ package general_tests // t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts, lcr.SupplierCosts) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1005", @@ -811,7 +790,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -838,7 +816,6 @@ package general_tests // t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1001", @@ -869,7 +846,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1002", @@ -895,7 +871,6 @@ package general_tests // } // // LCR with Alias // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1006", @@ -917,7 +892,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1002", @@ -1061,7 +1035,6 @@ package general_tests // tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") // tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") // cd := engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1003", @@ -1117,7 +1090,6 @@ package general_tests // // t.Errorf("Expecting: %+v, received: %+v", eLcr.SupplierCosts[0], lcr.SupplierCosts[0]) // } // cd = engine.CallDescriptor{ -// Direction: "*out", // Category: "call", // Tenant: "cgrates.org", // Subject: "1003", @@ -1193,7 +1165,6 @@ package general_tests // } // type AttrGetAccounts struct { // Tenant string -// Direction string // AccountIds []string // Offset int // Set the item offset // Limit int // Limit number of items retrieved @@ -1347,7 +1318,6 @@ package general_tests // Account: "1001", // Subject: "1001", // Tenant: "cgrates.org", -// Direction: utils.META_OUT, // Destination: "1003", // Timespans: []*engine.TimeSpan{ // &engine.TimeSpan{ diff --git a/general_tests/suretax_it_test.go b/general_tests/suretax_it_test.go index 371e4f2f8..d457b9200 100644 --- a/general_tests/suretax_it_test.go +++ b/general_tests/suretax_it_test.go @@ -131,7 +131,7 @@ func testSTICacheStats(t *testing.T) { // Test CDR from external sources func testSTIProcessExternalCdr(t *testing.T) { cdr := &engine.ExternalCDR{ToR: utils.VOICE, - OriginID: "teststicdr1", OriginHost: "192.168.1.1", Source: "STI_TEST", RequestType: utils.META_RATED, Direction: utils.META_OUT, + OriginID: "teststicdr1", OriginHost: "192.168.1.1", Source: "STI_TEST", RequestType: utils.META_RATED, Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "+14082342500", Destination: "+16268412300", Supplier: "SUPPL1", SetupTime: "2015-10-18T13:00:00Z", AnswerTime: "2015-10-18T13:00:00Z", Usage: "15s", PDD: "7.0", ExtraFields: map[string]string{"CustomerNumber": "000000534", "ZipCode": ""}, diff --git a/sessions/sessions_birpc_it_test.go b/sessions/sessions_birpc_it_test.go index 9522d03e2..47a7c519c 100644 --- a/sessions/sessions_birpc_it_test.go +++ b/sessions/sessions_birpc_it_test.go @@ -187,7 +187,6 @@ func TestSessionsBiRPCSessionAutomaticDisconnects(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: utils.VOICE, utils.OriginID: "123451", - utils.Direction: utils.META_OUT, utils.Account: attrSetBalance.Account, utils.Subject: attrSetBalance.Account, utils.Destination: "1004", diff --git a/sessions/sessions_test.go b/sessions/sessions_test.go index 2f3547815..aecb44daa 100644 --- a/sessions/sessions_test.go +++ b/sessions/sessions_test.go @@ -68,7 +68,6 @@ func TestSessionSIndexAndUnindexSessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "12345", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -150,7 +149,6 @@ func TestSessionSIndexAndUnindexSessions(t *testing.T) { sSEv2 := engine.NewMapEvent(map[string]interface{}{ utils.EVENT_NAME: "TEST_EVENT2", utils.OriginID: "12346", - utils.Direction: "*out", utils.Account: "account2", utils.Destination: "+4986517174964", utils.Tenant: "itsyscom.com", @@ -390,7 +388,6 @@ func TestSessionSRegisterAndUnregisterASessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -451,7 +448,6 @@ func TestSessionSRegisterAndUnregisterASessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "222", - utils.Direction: "*out", utils.Account: "account2", utils.Destination: "+4986517174963", utils.Category: "call", @@ -518,7 +514,6 @@ func TestSessionSRegisterAndUnregisterASessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account3", utils.Destination: "+4986517174963", utils.Category: "call", @@ -611,7 +606,6 @@ func TestSessionSRegisterAndUnregisterPSessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -675,7 +669,6 @@ func TestSessionSRegisterAndUnregisterPSessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "222", - utils.Direction: "*out", utils.Account: "account2", utils.Destination: "+4986517174963", utils.Category: "call", @@ -742,7 +735,6 @@ func TestSessionSRegisterAndUnregisterPSessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account3", utils.Destination: "+4986517174963", utils.Category: "call", @@ -1386,7 +1378,6 @@ func TestSessionStransitSState(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -1433,7 +1424,6 @@ func TestSessionSrelocateSessionS(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -1627,7 +1617,6 @@ func TestSessionSgetSessionIDsMatchingIndexes(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "12345", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -1912,7 +1901,6 @@ func TestSessionSgetSession(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "111", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -1960,7 +1948,6 @@ func TestSessionSfilterSessions(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "12345", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", @@ -2025,7 +2012,6 @@ func TestSessionSfilterSessions(t *testing.T) { SetupTime: st, AnswerTime: at, ExtraFields: map[string]string{ - "Direction": "*out", "DisconnectCause": "NORMAL_DISCONNECT", "EventName": "TEST_EVENT", "Extra1": "Value1", @@ -2051,7 +2037,6 @@ func TestSessionSfilterSessions(t *testing.T) { SetupTime: st, AnswerTime: at, ExtraFields: map[string]string{ - "Direction": "*out", "DisconnectCause": "NORMAL_DISCONNECT", "EventName": "TEST_EVENT", "Extra1": "Value1", @@ -2139,7 +2124,6 @@ func TestSessionSfilterSessionsCount(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.ToR: "*voice", utils.OriginID: "12345", - utils.Direction: "*out", utils.Account: "account1", utils.Subject: "subject1", utils.Destination: "+4986517174963", diff --git a/sessions/sessions_voice_it_test.go b/sessions/sessions_voice_it_test.go index e883be936..7c9f5a532 100644 --- a/sessions/sessions_voice_it_test.go +++ b/sessions/sessions_voice_it_test.go @@ -1317,7 +1317,6 @@ func TestSMGDataDerivedChargingNoCredit(t *testing.T) { utils.EVENT_NAME: "TEST_EVENT", utils.TOR: utils.VOICE, utils.OriginID: "1234967", - utils.Direction: utils.META_OUT, utils.Account: "1011", utils.Subject: "1011", utils.Destination: "+49", diff --git a/utils/apitpdata.go b/utils/apitpdata.go index b9e681fae..f0c4975e5 100755 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -578,7 +578,6 @@ type AttrGetCdrs struct { CdrHosts []string // If provided, it will filter cdrhost CdrSources []string // If provided, it will filter cdrsource ReqTypes []string // If provided, it will fiter reqtype - Directions []string // If provided, it will fiter direction Tenants []string // If provided, it will filter tenant Categories []string // If provided, it will filter çategory Accounts []string // If provided, it will filter account diff --git a/utils/rsrfield_test.go b/utils/rsrfield_test.go index 1ddefde16..c8937b0c7 100644 --- a/utils/rsrfield_test.go +++ b/utils/rsrfield_test.go @@ -287,7 +287,7 @@ func TestRSRFieldsId(t *testing.T) { } func TestRSRCostDetails(t *testing.T) { - fieldsStr1 := `{"Direction":"*out","Category":"default_route","Tenant":"demo.cgrates.org","Subject":"voxbeam_premium","Account":"6335820713","Destination":"15143606781","TOR":"*voice","Cost":0.0007,"Timespans":[{"TimeStart":"2015-08-30T21:46:54Z","TimeEnd":"2015-08-30T21:47:06Z","Cost":0.00072,"RateInterval":{"Timing":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"*middle","RoundingDecimals":5,"MaxCost":0,"MaxCostStrategy":"0","Rates":[{"GroupIntervalStart":0,"Value":0.0036,"RateIncrement":6000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":12000000000,"Increments":[{"Duration":6000000000,"Cost":0.00036,"BalanceInfo":{"UnitBalanceUuid":"","MoneyBalanceUuid":"40adda88-25d3-4009-b928-f39d61590439","AccountId":"*out:demo.cgrates.org:6335820713"},"BalanceRateInterval":null,"UnitInfo":null,"CompressFactor":2}],"MatchedSubject":"*out:demo.cgrates.org:default_route:voxbeam_premium","MatchedPrefix":"1514","MatchedDestId":"Canada","RatingPlanId":"RP_VOXBEAM_PREMIUM"}]}` + fieldsStr1 := `{"Category":"default_route","Tenant":"demo.cgrates.org","Subject":"voxbeam_premium","Account":"6335820713","Destination":"15143606781","TOR":"*voice","Cost":0.0007,"Timespans":[{"TimeStart":"2015-08-30T21:46:54Z","TimeEnd":"2015-08-30T21:47:06Z","Cost":0.00072,"RateInterval":{"Timing":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"*middle","RoundingDecimals":5,"MaxCost":0,"MaxCostStrategy":"0","Rates":[{"GroupIntervalStart":0,"Value":0.0036,"RateIncrement":6000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":12000000000,"Increments":[{"Duration":6000000000,"Cost":0.00036,"BalanceInfo":{"UnitBalanceUuid":"","MoneyBalanceUuid":"40adda88-25d3-4009-b928-f39d61590439","AccountId":"*out:demo.cgrates.org:6335820713"},"BalanceRateInterval":null,"UnitInfo":null,"CompressFactor":2}],"MatchedSubject":"*out:demo.cgrates.org:default_route:voxbeam_premium","MatchedPrefix":"1514","MatchedDestId":"Canada","RatingPlanId":"RP_VOXBEAM_PREMIUM"}]}` rsrField, err := NewRSRField(`~cost_details:s/"MatchedDestId":"(\w+)"/${1}/`) if err != nil { t.Error(err) @@ -297,7 +297,7 @@ func TestRSRCostDetails(t *testing.T) { } else if parsedVal != "Canada" { t.Errorf("Expecting: Canada, received: %s", parsedVal) } - fieldsStr2 := `{"Direction":"*out","Category":"call","Tenant":"sip.test.cgrates.org","Subject":"dan","Account":"dan","Destination":"+4986517174963","TOR":"*voice","Cost":0,"Timespans":[{"TimeStart":"2015-05-13T15:03:34+02:00","TimeEnd":"2015-05-13T15:03:38+02:00","Cost":0,"RateInterval":{"Timing":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"*middle","RoundingDecimals":4,"MaxCost":0,"MaxCostStrategy":"","Rates":[{"GroupIntervalStart":0,"Value":0,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":4000000000,"Increments":[{"Duration":1000000000,"Cost":0,"BalanceInfo":{"Unit":null,"Monetary":null,"AccountID":""},"CompressFactor":4}],"RoundIncrement":null,"MatchedSubject":"*out:sip.test.cgrates.org:call:*any","MatchedPrefix":"+31800","MatchedDestId":"CST_49800_DE080","RatingPlanId":"ISC_V","CompressFactor":1}],"RatedUsage":4}` + fieldsStr2 := `{"Category":"call","Tenant":"sip.test.cgrates.org","Subject":"dan","Account":"dan","Destination":"+4986517174963","TOR":"*voice","Cost":0,"Timespans":[{"TimeStart":"2015-05-13T15:03:34+02:00","TimeEnd":"2015-05-13T15:03:38+02:00","Cost":0,"RateInterval":{"Timing":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"*middle","RoundingDecimals":4,"MaxCost":0,"MaxCostStrategy":"","Rates":[{"GroupIntervalStart":0,"Value":0,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":4000000000,"Increments":[{"Duration":1000000000,"Cost":0,"BalanceInfo":{"Unit":null,"Monetary":null,"AccountID":""},"CompressFactor":4}],"RoundIncrement":null,"MatchedSubject":"*out:sip.test.cgrates.org:call:*any","MatchedPrefix":"+31800","MatchedDestId":"CST_49800_DE080","RatingPlanId":"ISC_V","CompressFactor":1}],"RatedUsage":4}` rsrField, err = NewRSRField(`~CostDetails:s/"MatchedDestId":.*_(\w{5})/${1}/:s/"MatchedDestId":"INTERNAL"/ON010/`) if err != nil { t.Error(err) diff --git a/utils/struct_test.go b/utils/struct_test.go index f762ccafa..9710d9590 100644 --- a/utils/struct_test.go +++ b/utils/struct_test.go @@ -26,13 +26,12 @@ import ( func TestMissingStructFieldsCorrect(t *testing.T) { var attr = struct { Tenant string - Direction string Account string Type string ActionTimingsID string - }{"bevoip.eu", "OUT", "danconns0001", META_PREPAID, "mama"} + }{"bevoip.eu", "danconns0001", META_PREPAID, "mama"} if missing := MissingStructFields(&attr, - []string{"Tenant", "Direction", "Account", "Type", "ActionTimingsID"}); len(missing) != 0 { + []string{"Tenant", "Account", "Type", "ActionTimingsID"}); len(missing) != 0 { t.Error("Found missing field on correct struct", missing) } } @@ -280,20 +279,19 @@ func TestToMapMapStringInterface(t *testing.T) { func TestMissingMapFields(t *testing.T) { var attr = map[string]interface{}{ Tenant: "cgrates.org", - Direction: "OUT", Account: "1001", "Type": META_PREPAID, "ActionTimingsID": "*asap", } if missing := MissingMapFields(attr, - []string{"Tenant", "Direction", "Account", "Type", "ActionTimingsID"}); len(missing) != 0 { + []string{"Tenant", "Account", "Type", "ActionTimingsID"}); len(missing) != 0 { t.Error("Found missing field on correct struct", missing) } attr["ActionTimingsID"] = "" delete(attr, "Type") expected := []string{"ActionTimingsID", "Type"} missing := MissingMapFields(attr, - []string{"Tenant", "Direction", "Account", "Type", "ActionTimingsID"}) + []string{"Tenant", "Account", "Type", "ActionTimingsID"}) sort.Strings(missing) if !reflect.DeepEqual(expected, missing) { t.Errorf("Expected %s ,received: %s", expected, missing)