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
159 lines
4.8 KiB
JSON
159 lines
4.8 KiB
JSON
[
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "13125559999",
|
|
"Destination": "102",
|
|
"DestinationContext": "sp-rg-member",
|
|
"CallerID": "\"Mobile\" <13125559999>",
|
|
"Channel": "Local/102@sp-rg-member-00000000;2",
|
|
"DestinationChannel": "PJSIP/102-00000008",
|
|
"LastApplication": "Dial",
|
|
"LastData": "PJSIP/102/sip:102-0x59ff2dbd50b0@172.21.0.4:5072,600,tx",
|
|
"StartTime": "2026-10-18 19:33:35",
|
|
"AnswerTime": "",
|
|
"EndTime": "2026-10-18 19:33:40",
|
|
"Duration": "5",
|
|
"BillableSeconds": "0",
|
|
"Disposition": "NO ANSWER",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352015.14",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "",
|
|
"sp_direction": "",
|
|
"sp_recording": ""
|
|
},
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "13125559999",
|
|
"Destination": "103",
|
|
"DestinationContext": "sp-rg-member",
|
|
"CallerID": "\"Mobile\" <13125559999>",
|
|
"Channel": "Local/103@sp-rg-member-00000001;2",
|
|
"DestinationChannel": "PJSIP/103-00000009",
|
|
"LastApplication": "Dial",
|
|
"LastData": "PJSIP/103/sip:103-0x5fa815eee0b0@172.21.0.4:5074,600,tx",
|
|
"StartTime": "2026-10-18 19:33:40",
|
|
"AnswerTime": "2026-10-18 19:33:40",
|
|
"EndTime": "2026-10-18 19:33:40",
|
|
"Duration": "0",
|
|
"BillableSeconds": "0",
|
|
"Disposition": "ANSWERED",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352020.17",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "",
|
|
"sp_direction": "",
|
|
"sp_recording": ""
|
|
},
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "103",
|
|
"Destination": "",
|
|
"DestinationContext": "sp-from-ext",
|
|
"CallerID": "\"Carol\" <103>",
|
|
"Channel": "PJSIP/103-00000009",
|
|
"DestinationChannel": "Local/103@sp-rg-member-00000001;1",
|
|
"LastApplication": "AppDial",
|
|
"LastData": "(Outgoing Line)",
|
|
"StartTime": "2026-10-18 19:33:40",
|
|
"AnswerTime": "2026-10-18 19:33:40",
|
|
"EndTime": "2026-10-18 19:33:40",
|
|
"Duration": "0",
|
|
"BillableSeconds": "0",
|
|
"Disposition": "ANSWERED",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352020.19",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "",
|
|
"sp_direction": "",
|
|
"sp_recording": ""
|
|
},
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "13125559999",
|
|
"Destination": "s",
|
|
"DestinationContext": "sp-rg-22222222-2222-4222-8222-222222222500",
|
|
"CallerID": "\"Mobile\" <13125559999>",
|
|
"Channel": "PJSIP/trunk-7d3e9a52-1c4b-4f6e-9a0d-2b8c5e1f4a37-00000007",
|
|
"DestinationChannel": "Local/102@sp-rg-member-00000000;1",
|
|
"LastApplication": "Dial",
|
|
"LastData": "Local/102@sp-rg-member,5,t",
|
|
"StartTime": "2026-10-18 19:33:35",
|
|
"AnswerTime": "",
|
|
"EndTime": "2026-10-18 19:33:40",
|
|
"Duration": "5",
|
|
"BillableSeconds": "0",
|
|
"Disposition": "NO ANSWER",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352015.12",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "13125551235",
|
|
"sp_direction": "inbound",
|
|
"sp_recording": ""
|
|
},
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "13125559999",
|
|
"Destination": "s",
|
|
"DestinationContext": "sp-rg-22222222-2222-4222-8222-222222222500",
|
|
"CallerID": "\"Mobile\" <13125559999>",
|
|
"Channel": "PJSIP/trunk-7d3e9a52-1c4b-4f6e-9a0d-2b8c5e1f4a37-00000007",
|
|
"DestinationChannel": "Local/103@sp-rg-member-00000001;1",
|
|
"LastApplication": "Dial",
|
|
"LastData": "Local/103@sp-rg-member,5,t",
|
|
"StartTime": "2026-10-18 19:33:40",
|
|
"AnswerTime": "2026-10-18 19:33:40",
|
|
"EndTime": "2026-10-18 19:33:40",
|
|
"Duration": "0",
|
|
"BillableSeconds": "0",
|
|
"Disposition": "ANSWERED",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352015.12",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "13125551235",
|
|
"sp_direction": "inbound",
|
|
"sp_recording": ""
|
|
},
|
|
{
|
|
"Event": "Cdr",
|
|
"Privilege": "cdr,all",
|
|
"AccountCode": "",
|
|
"Source": "13125559999",
|
|
"Destination": "s",
|
|
"DestinationContext": "sp-rg-22222222-2222-4222-8222-222222222500",
|
|
"CallerID": "\"Mobile\" <13125559999>",
|
|
"Channel": "PJSIP/trunk-7d3e9a52-1c4b-4f6e-9a0d-2b8c5e1f4a37-00000007",
|
|
"DestinationChannel": "PJSIP/103-00000009",
|
|
"LastApplication": "Dial",
|
|
"LastData": "Local/103@sp-rg-member,5,t",
|
|
"StartTime": "2026-10-18 19:33:40",
|
|
"AnswerTime": "2026-10-18 19:33:40",
|
|
"EndTime": "2026-10-18 19:33:45",
|
|
"Duration": "4",
|
|
"BillableSeconds": "4",
|
|
"Disposition": "ANSWERED",
|
|
"AMAFlags": "DOCUMENTATION",
|
|
"UniqueID": "1792352015.12",
|
|
"UserField": "",
|
|
"LinkedID": "1792352015.12",
|
|
"sp_did": "13125551235",
|
|
"sp_direction": "inbound",
|
|
"sp_recording": ""
|
|
}
|
|
]
|