Skip to main content

JSON/JSONS CDR examples

tip

The PBX sends raw JSON data. For clarity in the documentation below, our web server has formatted this data.

Scenario 1

This document describes an outbound call scenario in Vodia PBX where:

  1. Extension 504 (Tom Jones) initiates a call to an external number
  2. The call routes through a SIP trunk to reach the destination
  3. The external party answers briefly (2 second call)

Call Flow Timeline

EventTimeDurationDetails
Call initiated by extension 50412:18:02-Tom Jones dials 132221
Call connected12:18:05-3 seconds ring time
Call ended12:18:072sTotal conversation time

Key Concepts

Primary Call ID

The PrimaryCallID links both call legs for the outbound call:

PRA93Tta2CzVcV73Yvs8tQ..

Call Legs

An outbound call to an external number generates 2 call legs:

  1. Extension to PBX Leg

    • CallID: Same as PrimaryCallID
    • Type: extcall
    • Direction: I (Inbound to PBX from extension)
    • From: Extension 504
    • To: External number (132221)
  2. PBX to Trunk Leg

    • CallID: mte7y70@pbx
    • Type: extcall
    • Direction: O (Outbound from PBX to trunk)
    • TrunkName: SIP Trunk Vodia
    • TrunkID: 10

Call Type

For external calls, the type is always extcall (external call) regardless of direction.

Field Differences Between Call Legs

FieldExtension→PBX LegPBX→Trunk Leg
CallIDSame as PrimaryCallIDUnique ID (e.g., mte7y70@pbx)
DirectionIO
Extension504(empty)
ExtensionNameTom Jones(empty)
TrunkName(empty)SIP Trunk Vodia
TrunkID(empty)10
RemoteParty504+61132221
LocalPartyExternal number504
IPAdrExtension IPTrunk IP

RAW JSON CDR for the scenario above

============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 159.65.129.0
------------------------------------------------------------
action : call-data-record
System : 739654e15108d9e7477d10a2e474ff29
PrimaryCallID : PRA93Tta2CzVcV73Yvs8tQ..
CallID : PRA93Tta2CzVcV73Yvs8tQ..
From : "Tom Jones" <sip:504@sbc.vodia-teams.com>
To : "13 22 21" <sip:+61132221@sbc.vodia-teams.com>
Direction : I
RemoteParty : 504
LocalParty : "13 22 21" <sip:132221@sbc.vodia-teams.com>
TrunkName :
TrunkID :
Cost :
CMC :
Domain : sbc.vodia-teams.com
TimeStart : 2025-07-21 12:18:02
TimeConnected : 2025-07-21 12:18:05
TimeEnd : 2025-07-21 12:18:07
LocalTime : 2025-07-21 20:18:02
DurationHHMMSS : 0:00:02
Duration : 2
RecordLocation :
RecordIds : ['']
RecordUsers :
Type : extcall
Extension : 504
ExtensionName : Tom Jones
IdleDuration : 24
RingDuration : 3
HoldDuration : 0
IvrDuration : 0
AccountNumber : 504
IPAdr : udp:203.123.102.164:59541
Quality : VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-21T12:18:0...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-21T12:18:05Z STOP=2025-07-21T12:18:07Z
CallID:PRA93Tta2CzVcV73Yvs8tQ..
FromID:<sip:504@sbc.vodia-teams.com;transport=UDP>;tag=0e390249
ToID:<sip:132221@sbc.vodia-teams.com>;tag=a2e033fqkq
SessionDesc:PT=8 PD=PCMA SR=8000 FD=20 FO=160 FPP=1 PPS=50 PLC=3
LocalAddr:IP=159.65.129.0 PORT=62458 SSRC=0x829d6162
RemoteAddr:IP=203.123.102.164 PORT=30854 SSRC=0xf7283f00
x-Packets:IP=203.123.102.164 PORT=30854 PACKETS=220 BYTES=37681
x-UserAgent:PBX-69.5.11/69.5.14.beta
x-SIPterm:SDC=OK SDR=AN
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=16
Delay:RTD=0 ESD=0 IAJ=17
QualityEst:MOSLQ=4.2 MOSCQ=4.2
x-Lost:i=5,z=3
x-Jitter:i=5,m=0,c=ACA=
RemoteMetrics:
x-UserAgent:Z 5.6.6 v2.10.20.5
x-Lost:i=5,z=3
x-Jitter:i=5,z=3

============================================================
159.65.129.0 - - [21/Jul/2025 12:18:07] "POST /webhook HTTP/1.1" 200 -
============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 159.65.129.0
------------------------------------------------------------
action : call-data-record
System : 739654e15108d9e7477d10a2e474ff29
PrimaryCallID : PRA93Tta2CzVcV73Yvs8tQ..
CallID : mte7y70@pbx
From : "Tom Jones" <sip:504@sbc.vodia-teams.com>
To : "13 22 21" <sip:+61132221@sbc.vodia-teams.com>
Direction : O
RemoteParty : +61132221
LocalParty : 504
TrunkName : SIP Trunk Vodia
TrunkID : 10
Cost :
CMC :
Domain : sbc.vodia-teams.com
TimeStart : 2025-07-21 12:18:02
TimeConnected : 2025-07-21 12:18:05
TimeEnd : 2025-07-21 12:18:07
LocalTime : 2025-07-21 20:18:02
DurationHHMMSS : 0:00:02
Duration : 2
RecordLocation :
RecordIds : ['']
RecordUsers :
Type : extcall
Extension :
ExtensionName :
IdleDuration :
RingDuration : 3
HoldDuration : 0
IvrDuration : 0
AccountNumber : 504
IPAdr : udp:209.38.23.231:5060
Quality : VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-21T12:18:0...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-21T12:18:05Z STOP=2025-07-21T12:18:07Z
CallID:mte7y70@pbx
FromID:<sip:61132221@vodia.pbx.voip-mart.com>;tag=vowigsr7lc
ToID:"316" <sip:316@vodia.pbx.voip-mart.com>;tag=1212112695
SessionDesc:PT=0 PD=PCMU SR=8000 FD=20 FO=160 FPP=1 PPS=50 PLC=3
LocalAddr:IP=159.65.129.0 PORT=52244 SSRC=0x00c06a5f
RemoteAddr:IP=209.38.23.231 PORT=60658 SSRC=0xd63f7705
x-Packets:IP=209.38.23.231 PORT=60658 PACKETS=202 BYTES=34744
x-UserAgent:PBX-69.5.11/69.5.14.beta
x-SIPmetrics:SVA=RG SRD=200 SFC=0
x-SIPterm:SDC=OK SDR=OR
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=16
Delay:RTD=0 ESD=0 IAJ=16
QualityEst:MOSLQ=4.2 MOSCQ=4.1
x-Lost:i=5,z=3
x-Jitter:i=5,m=0,c=AiA=
RemoteMetrics:
x-UserAgent:Vodia-PBX/69.5.13
x-Lost:i=5,z=3
x-Jitter:i=5,z=3

============================================================
159.65.129.0 - - [21/Jul/2025 12:18:07] "POST /webhook HTTP/1.1" 200 -

Scenario 2

  1. An inbound call enters a Ring Group
  2. Extension 502 answers the call
  3. Extension 502 performs an attended transfer to extension 503
  4. Extension 503 completes the call

Call Flow Timeline

EventTimeDurationExtension
Call enters Ring Group01:04:57--
Extension 502 answers01:05:0811s502
Transfer initiated to 50301:05:19--
Extension 503 answers01:05:2434s503
Call ends01:05:58Total: 50s-

Key Concepts

Primary Call ID

The PrimaryCallID is the master identifier that links all call legs together throughout the entire call session:

5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6

Call Legs

This scenario generates 4 distinct call legs, each with its own CallID:

  1. Ring Group Hunt (Extension 503 - Not Answered)

    • CallID: bf001c23@pbx
    • Type: hunt
    • Direction: O (Outbound to extension)
  2. Ring Group Hunt (Extension 502 - Answered)

    • CallID: f91cc9c2@pbx
    • Type: hunt
    • Direction: O (Outbound to extension)
    • Duration: 11 seconds
  3. Inbound Call Leg

    • CallID: Same as PrimaryCallID
    • Type: attendant
    • Direction: I (Inbound)
    • Duration: 50 seconds (total call)
  4. Transfer to Extension 503

    • CallID: 3955b646@pbx
    • Type: attendant
    • Direction: O (Outbound to extension)
    • Duration: 34 seconds

Call Type Changes

The call type changes when a transfer occurs:

  • hunt: Initial ring group distribution
  • attendant: After transfer initiation

RAW JSON CDR for the scenario above

Common Fields

============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 1.2.3.4
------------------------------------------------------------
action : call-data-record
System : dd7991d258131de0a130568cac55bcca
PrimaryCallID : 5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
CallID : bf001c23@pbx
From : "61433337233" <sip:61433337233@test.vodia.co>
To : "Ring group test" <sip:6128332244@test.vodia.co>
Direction : O
RemoteParty :
LocalParty :
TrunkName :
TrunkID :
Cost :
CMC :
Domain : test.vodia.co
TimeStart : 2025-07-17 01:04:57
TimeConnected :
TimeEnd : 2025-07-17 01:05:08
LocalTime : 2025-07-17 01:04:57
DurationHHMMSS : 0:00:00
Duration : 0
RecordLocation :
RecordIds : ['']
RecordUsers :
Type : hunt
Extension : 503
ExtensionName : Test 3 - Rosena
IdleDuration :
RingDuration : 10
HoldDuration : 0
IvrDuration : 0
AccountNumber : 200
IPAdr :
Quality : VQSessionReport: CallTerm
LocalMetrics:
CallID:bf001c23@pbx
FromID:"Ring g...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
CallID:bf001c23@pbx
FromID:"Ring group test" <sip:6128332244@test.vodia.co>;tag=0a93cd53
ToID:"61433337233" <sip:61433337233@test.vodia.co>;tag=245372163
x-UserAgent:Vodia-PBX/68.0.42
x-SIPmetrics:SVA=RG SRD=905
x-SIPterm:SDC=OK SDR=OR

============================================================
1.2.3.4 - - [17/Jul/2025 01:05:14] "POST /webhook HTTP/1.1" 200 -
============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 1.2.3.4
------------------------------------------------------------
action : call-data-record
System : dd7991d258131de0a130568cac55bcca
PrimaryCallID : 5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
CallID : f91cc9c2@pbx
From : "61433337233" <sip:61433337233@test.vodia.co>
To : "Ring group test" <sip:6128332244@test.vodia.co>
Direction : O
RemoteParty :
LocalParty :
TrunkName :
TrunkID :
Cost :
CMC :
Domain : test.vodia.co
TimeStart : 2025-07-17 01:04:57
TimeConnected : 2025-07-17 01:05:08
TimeEnd : 2025-07-17 01:05:19
LocalTime : 2025-07-17 01:04:57
DurationHHMMSS : 0:00:11
Duration : 11
RecordLocation :
RecordIds : ['']
RecordUsers :
Type : hunt
Extension : 502
ExtensionName : Test 2 - Tim
IdleDuration : 30364
RingDuration : 10
HoldDuration : 0
IvrDuration : 0
AccountNumber : 200
IPAdr : udp:203.123.102.164:52865
Quality : VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:0...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:08Z STOP=2025-07-17T01:05:19Z
CallID:f91cc9c2@pbx
FromID:"Ring group test" <sip:6128332244@test.vodia.co>;tag=x7t2ir
ToID:"61433337233" <sip:61433337233@test.vodia.co>;tag=935597737
SessionDesc:PT=8 PD=PCMA SR=8000 FD=20 FO=0 FPP=1 PPS=50 PLC=3
LocalAddr:IP=1.2.3.4 PORT=63522 SSRC=0xaaaeb08c
RemoteAddr:IP=203.123.102.164 PORT=54494 SSRC=0x62af940d
x-UserAgent:Vodia-PBX/68.0.42
x-SIPmetrics:SVA=RG SRD=58
x-SIPterm:SDC=OK SDD=55 SDR=OR
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=16
Delay:RTD=0 ESD=0 IAJ=16
QualityEst:MOSLQ=4.2 MOSCQ=4.0

============================================================
1.2.3.4 - - [17/Jul/2025 01:05:19] "POST /webhook HTTP/1.1" 200 -

============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 1.2.3.4
------------------------------------------------------------
action : call-data-record
System : dd7991d258131de0a130568cac55bcca
PrimaryCallID : 5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
CallID : 5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
From : "61433337233" <sip:61433337233@test.vodia.co>
To : "Ring group test" <sip:6128332244@test.vodia.co>
Direction : I
RemoteParty : "61433337233" <sip:61433337233@test.vodia.co>
LocalParty : "Ring group test" <sip:6128332244@test.vodia.co>
TrunkName : IN 2
TrunkID : 4
Cost :
CMC :
Domain : test.vodia.co
TimeStart : 2025-07-17 01:04:57
TimeConnected : 2025-07-17 01:05:08
TimeEnd : 2025-07-17 01:05:58
LocalTime : 2025-07-17 01:04:57
DurationHHMMSS : 0:00:50
Duration : 50
RecordLocation : recordings/test.vodia.co/20250717/010508-i-6128332244-61433337233.wav
RecordIds : ['13']
RecordUsers : 25
Type : attendant
Extension :
ExtensionName :
IdleDuration :
RingDuration : 5
HoldDuration : 0
IvrDuration : 0
AccountNumber :
IPAdr : udp:202.169.181.44:5060
Quality : VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:0...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:08Z STOP=2025-07-17T01:05:58Z
CallID:5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
FromID:<sip:61433337233@202.169.181.44;user=phone;noa=national>;tag=1d0fc680-co17742-INS002
ToID:<sip:6128332244@1.2.3.4;user=phone>;tag=05af1e6bbb
SessionDesc:PT=8 PD=PCMA SR=8000 FD=20 FO=160 FPP=1 PPS=50 PLC=3
LocalAddr:IP=1.2.3.4 PORT=62968 SSRC=0x8142e9b2
RemoteAddr:IP=125.213.182.123 PORT=15496 SSRC=0x64f01957
x-UserAgent:Vodia-PBX/68.0.42
x-SIPterm:SDC=OK SDR=AN
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=16
Delay:RTD=1 ESD=0 IAJ=0
QualityEst:MOSLQ=4.2 MOSCQ=4.2

============================================================
1.2.3.4 - - [17/Jul/2025 01:05:59] "POST /webhook HTTP/1.1" 200 -
============================================================
RECEIVED WEBHOOK DATA:
============================================================
Content-Type: application/json
Remote IP: 1.2.3.4
------------------------------------------------------------
action : call-data-record
System : dd7991d258131de0a130568cac55bcca
PrimaryCallID : 5e61-1129-5281970104523-BN14-NSY1-3-10.21.103.6
CallID : 3955b646@pbx
From : "61433337233" <sip:61433337233@test.vodia.co>
To : "Ring group test" <sip:6128332244@test.vodia.co>
Direction : O
RemoteParty :
LocalParty :
TrunkName :
TrunkID :
Cost :
CMC :
Domain : test.vodia.co
TimeStart : 2025-07-17 01:05:19
TimeConnected : 2025-07-17 01:05:24
TimeEnd : 2025-07-17 01:05:58
LocalTime : 2025-07-17 01:05:19
DurationHHMMSS : 0:00:34
Duration : 34
RecordLocation : recordings/test.vodia.co/20250717/010524-i-503-61433337233.wav
RecordIds : ['14']
RecordUsers : 29
Type : attendant
Extension : 503
ExtensionName : Test 3 - Rosena
IdleDuration : 30370
RingDuration : 5
HoldDuration : 0
IvrDuration : 0
AccountNumber :
IPAdr : udp:203.123.102.164:63669
Quality : VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:2...
[Full value]: VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2025-07-17T01:05:24Z STOP=2025-07-17T01:05:58Z
CallID:3955b646@pbx
FromID:"Test 3 - Rosena" <sip:503@test.vodia.co>;tag=53719f02
ToID:"61433337233" <sip:61433337233@test.vodia.co>;tag=680881526
SessionDesc:PT=8 PD=PCMA SR=8000 FD=20 FO=160 FPP=1 PPS=50 PLC=3
LocalAddr:IP=1.2.3.4 PORT=32560 SSRC=0xb2787e23
RemoteAddr:IP=203.123.102.164 PORT=59770 SSRC=0x58504fe2
x-UserAgent:Vodia-PBX/68.0.42
x-SIPmetrics:SVA=RG SRD=871
x-SIPterm:SDC=OK SDD=95 SDR=OR
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=16
Delay:RTD=0 ESD=0 IAJ=2
QualityEst:MOSLQ=4.2 MOSCQ=4.2

============================================================
1.2.3.4 - - [17/Jul/2025 01:05:59] "POST /webhook HTTP/1.1" 200 -

Additional Information in the CDR legs

Quality Metrics

Each webhook includes VoIP quality metrics:

  • MOSLQ: Mean Opinion Score for Listening Quality (4.2 = Good)
  • MOSCQ: Mean Opinion Score for Conversational Quality (4.0 = Good)
  • PacketLoss: Network packet loss statistics
  • Delay: Round-trip delay and jitter information

Recording Information

  • RecordLocation: Path to call recording file
  • RecordIds: Array of recording identifiers
  • RecordUsers: User ID associated with recording

Network Information

  • IPAdr: IP address and port of the endpoint
  • RemoteAddr: Remote party's IP information
  • LocalAddr: Local PBX IP information

Best Practices

  1. Always use PrimaryCallID to correlate related call legs
  2. Monitor Type changes to detect transfers (hunt → attendant)
  3. Check Direction field to distinguish between inbound/outbound legs
  4. Store all webhook data for complete call history reconstruction
  5. Use TimeConnected instead of TimeStart for accurate answer timing