cdr: store Cdr events, aggregate calls, fixtures from real calls
services/cdr.ts stores every AMI Cdr event in cdr and, 5 s after a call's last event, builds its calls row (direction, status, from, to, DID, answered by, talk time) and call_extensions (caller, rang, answered) per 04 §5.4; linkedids without a calls row are caught up on AMI connect. Aggregation is idempotent. test/asterisk/cdr-record.ts records 8 scenarios with our config, the fake voip.ms (now shared in provider.ts) and baresip phones; each has a fixture and a test with the expected calls row. Queue abandon and park come with M8. Found while recording: Asterisk 24's Cdr event has no LinkedID unless cdr_manager maps it, its times carry no zone (now usegmtime), and the mappings read CDR variables, so the dialplan sets CDR(SP_DID) and CDR(SP_DIRECTION) next to the channel variables. The Asterisk image needs a rebuild for the cdr_manager.conf change. Task: M7-T1
This commit is contained in:
1 parent
8a763ff130
commit
71440ac85d
31 files changed
+1332
-48
No files matched your search
+54
@@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"Event": "Cdr",
|
||||
"Privilege": "cdr,all",
|
||||
"AccountCode": "",
|
||||
"Source": "13125559999",
|
||||
"Destination": "101",
|
||||
"DestinationContext": "sp-local-numbers",
|
||||
"CallerID": "\"Mobile\" <13125559999>",
|
||||
"Channel": "PJSIP/trunk-7d3e9a52-1c4b-4f6e-9a0d-2b8c5e1f4a37-0000000d",
|
||||
"DestinationChannel": "PJSIP/101-0000000e",
|
||||
"LastApplication": "Dial",
|
||||
"LastData": "PJSIP/101/sip:101-0x5f231650d0b0@172.21.0.4:5070,25,tx",
|
||||
"StartTime": "2026-10-18 19:34:10",
|
||||
"AnswerTime": "2026-10-18 19:34:10",
|
||||
"EndTime": "2026-10-18 19:34:13",
|
||||
"Duration": "3",
|
||||
"BillableSeconds": "3",
|
||||
"Disposition": "ANSWERED",
|
||||
"AMAFlags": "DOCUMENTATION",
|
||||
"UniqueID": "1792352050.30",
|
||||
"UserField": "",
|
||||
"LinkedID": "1792352050.30",
|
||||
"sp_did": "13125551234",
|
||||
"sp_direction": "inbound",
|
||||
"sp_recording": ""
|
||||
},
|
||||
{
|
||||
"Event": "Cdr",
|
||||
"Privilege": "cdr,all",
|
||||
"AccountCode": "",
|
||||
"Source": "13125559999",
|
||||
"Destination": "101",
|
||||
"DestinationContext": "sp-local-numbers",
|
||||
"CallerID": "\"Mobile\" <13125559999>",
|
||||
"Channel": "PJSIP/trunk-7d3e9a52-1c4b-4f6e-9a0d-2b8c5e1f4a37-0000000d",
|
||||
"DestinationChannel": "PJSIP/103-0000000f",
|
||||
"LastApplication": "Dial",
|
||||
"LastData": "PJSIP/103/sip:103-0x5fa815eee0b0@172.21.0.4:5074,25,tx",
|
||||
"StartTime": "2026-10-18 19:34:13",
|
||||
"AnswerTime": "2026-10-18 19:34:13",
|
||||
"EndTime": "2026-10-18 19:34:18",
|
||||
"Duration": "4",
|
||||
"BillableSeconds": "4",
|
||||
"Disposition": "ANSWERED",
|
||||
"AMAFlags": "DOCUMENTATION",
|
||||
"UniqueID": "1792352050.30",
|
||||
"UserField": "",
|
||||
"LinkedID": "1792352050.30",
|
||||
"sp_did": "13125551234",
|
||||
"sp_direction": "inbound",
|
||||
"sp_recording": ""
|
||||
}
|
||||
]
|
||||
Reference in new issue
Block a user