Files
selfphoneng/apps/api/test/fixtures/cdr/internal-voicemail.json
T
iamdoubz 71440ac85d 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
2026-10-18 14:37:14 -05:00

55 lines
1.5 KiB
JSON

[
{
"Event": "Cdr",
"Privilege": "cdr,all",
"AccountCode": "",
"Source": "103",
"Destination": "102",
"DestinationContext": "sp-from-ext",
"CallerID": "\"Carol\" <103>",
"Channel": "PJSIP/103-00000002",
"DestinationChannel": "PJSIP/102-00000003",
"LastApplication": "Dial",
"LastData": "PJSIP/102/sip:102-0x59ff2dbd50b0@172.21.0.4:5072,5,tx",
"StartTime": "2026-10-18 19:33:04",
"AnswerTime": "2026-10-18 19:33:04",
"EndTime": "2026-10-18 19:33:09",
"Duration": "5",
"BillableSeconds": "5",
"Disposition": "NO ANSWER",
"AMAFlags": "DOCUMENTATION",
"UniqueID": "1792351984.3",
"UserField": "",
"LinkedID": "1792351984.3",
"sp_did": "",
"sp_direction": "",
"sp_recording": ""
},
{
"Event": "Cdr",
"Privilege": "cdr,all",
"AccountCode": "",
"Source": "103",
"Destination": "102",
"DestinationContext": "sp-from-ext",
"CallerID": "\"Carol\" <103>",
"Channel": "PJSIP/103-00000002",
"DestinationChannel": "",
"LastApplication": "VoiceMail",
"LastData": "102@default,u",
"StartTime": "2026-10-18 19:33:09",
"AnswerTime": "2026-10-18 19:33:09",
"EndTime": "2026-10-18 19:33:15",
"Duration": "6",
"BillableSeconds": "6",
"Disposition": "ANSWERED",
"AMAFlags": "DOCUMENTATION",
"UniqueID": "1792351984.3",
"UserField": "",
"LinkedID": "1792351984.3",
"sp_did": "",
"sp_direction": "",
"sp_recording": ""
}
]