If enabled the PBX generates Call Detail Records (CDR) for each call and each object, which means if a call is made from one user to another a CDR for an outgoing call is generated at the first user object and a CDR for an incoming call is generated at the other user object. The CDRs are generated at the end of the call and sent via the CDR0 and CDR1 interfaces. For information about the delivery mechanism, please look at the CDR0/CDR1 Reference pages.
In the documentation "from" and "to" is often used to indicate a direction of a call, or event. This is always from a viewpoint inside the PBX. This mean for example if a call is made from a phone registered to an object A to a phone registered to object "B", the call seen from the PBX is "from" A "to" B.īSo the CDR at object A is marked as "from" and object B as "to". The "setup-from" event indicates the call coming in on A und an event "setup-to" indicates the call going out on B.
Each CDR uses the top-level tag <cdr>. The following attributes are used with this tag:
id | A guid, which identifies the individual CDR. In case a CDR is transmitted with multiple mechanisms, this id can be used to avoid duplication |
guid | The GUID identifying the object this call belongs to. |
sys | The system name (Gatekeeper Identifier or Domain) of the PBX |
pbx | The PBX this CDR was generated on |
node | The Node of the object for which this CDR was generated |
cn | The cn (Long Name) of the object |
e164 | In case of endpoint type objects this is the normalized number of the object. In case of Gateway type objects, it is the number of the remote endpoint. |
h323 | In case of endpoint type objects this is the name of the object (aka h323 id or sip user part). In case of Gateway type objects, it is the name of the remote endpoint. |
obj-h323 | The H.323 Id (Name) of the object |
obj-e164 | The normalized Number of the object. This number includes the node prefixes if the object is not defined in the root node. |
call | A guid identifying the call leg associated with this CDR. The same identifier is also availabe in events to indicate the peer call leg. This way it can be used to associate events of one CDR with other CDRs. |
device | The device (if applicable) which was used for this call |
dir |
Indicates the direction of the call.
|
utc | The time when this call was started as UTC time. This is an integer with the standard ctime semantic. |
local | The local time the call was started. |
reporting | Number of reporting licenses assigned to the object. Can be 0 or 1. |
For each state a call goes thru a tag <event> is added to the CDR. The following attributes are used with this tag:
msg | A string identifying the message which caused the state change of the call |
time | The uptime of the gateway in seconds |
type | The Type of the other party of the call if available. A value of 'ext' indicates an external party. If no type is present it is an internal party. |
e164 | The number of the other party of the call if available. This number is a number as it can be dialed from this endpoint to call the other endpoint. This means it will include prefixes only if the other party is in a different node and it will include escapes if necessary. |
root | The number of the other party relative to the numbering root, if available. |
h323 | The H.323 Id (Name) of the other party of the call if available |
conf | A GUID identifying the call (conferenceID). This GUID can be used to associated CDRs from outgoing calls to the CDRs of incoming calls even across different PBXs. The first event within a CDR always contains this attribute. The conferenceID may change during a call (e.g. because of a call transfer). In this case another conf attribute is present containing the new conferenceID. |
cause | The cause code used when the call was cleared. The value is defined in Q.931. Common values are 16 - Normal Clearing, 17 - User Busy, 18 - No response. |
Used as tag inside <event>. This indicates that one side of the call has changed due to a call forward or transfer.
With cf-from and transfer-from events the side of the call on the object this CDR was create for has changed to a new object. The call on the object is terminated by this. More events are added to the CDR, seen from the viewpoint of the new object.
With transfer-to and cf-to events the remote side of the call has changed. The events on this CDR confinue from the viewpoint of the original object.
Indicates the endpoint to which the call is actually connected on this endpoint. This is used on trunk or gateway objects, in the <cdr> tag itself only the number is indicated which was already dialed when the call is sent out to the trunk. With overlap sending more digits may be sent. In alert-from, conn-from, rel-to and rel-from the final number sent is indicated.
The attributes e164, h323 and dn can be present. Used inside an event tag for setup-to or setup from to indicate the call was forwarded by the endpoint identified with e164 or h323 attributes.
Indicates that an application initiated this call e.g. using the SOAP API or RCC. The attribute appl contains the name of the application.
The tag <cdr> may contain a tag <user> for additional information about the object:
pseudo="executive"
may be classified as as user-type object
Following Object Types could appear in the CDR records:
executive | Executive |
trunk | Trunk Line |
waiting | Waiting Queue |
gw | Gateway |
vm | Voicemail |
broadcast | Call Broadcast |
bc_conf | Bc Conference |
mobility | Mobility |
map | Number Map |
loc | PBX |
conference | Conference |
dtmf-ctrl | DTMF Features |
dirsearch | Directory Search |
multicast | MCast Announce |
qdial | Quick dial |
setup-from | A call originating from the object was initiated |
setup-to | A call to the object was initiated |
alert-from | The endpoint for this object is alerting |
alert-to | The other party is alerting |
conn-from | The endpoint for this object has connected the call |
conn-to | The other party has connected the call |
rel-from | The endpoint for this object has released the call |
rel-to | The other party has released the call |
transfer-from | The endpoint for this call has transfered the call. |
transfer-to | The other party has transfered the call. |
transferred | Another call on the same object (user) has been transferred with this call. A transfer-from will be shown on this other call. The call itself will disappear from the phone as a result of the transfer. |
transfer-remote | The call was transferred outside the PBX. |
cf-from | The endpoint for this object has forwarded the call. |
cf-to | The other party has forwarded the call. |
connected | Added after a transfer, if the other call leg was already connected. |
To generate billing information for a given user (object), the outgoing calls the user is responsible for must be filtered, the destination to which the user is to be billed must be found and the connected time for these calls must be calculated. All this information can be obtained from the CDRs generated for the given user.
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272551262" local="1272558462">
<user/>
<event msg="setup-from" time="0" conf="e89277f0e909d31192e80090331032dd"/>
<event msg="alert-to" time="1" e164="101" h323="b"/>
<event msg="conn-to" time="2" e164="101" h323="b"/>
<event msg="rel-to" time="4" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="to" utc="1272551263" local="1272558463">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="e89277f0e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="1" e164="100" h323="a"/>
<event msg="rel-from" time="3" cause="0"/>
</cdr>
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272551788" local="1272558988">
<user/>
<event msg="setup-from" time="0" conf="dd95b681e909d31192e80090331032dd"/>
<event msg="cf-to" time="1" e164="101">
<to e164="102"/>
</event>
<event msg="alert-to" time="1" e164="102" h323="c"/>
<event msg="conn-to" time="3" e164="102" h323="c"/>
<event msg="rel-to" time="5" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" cn="B" e164="101" h323="b" dir="cf" utc="1272551789" local="1272558989">
<user/>
<event msg="setup-to" time="1" e164="100" h323="a" conf="dd95b681e909d31192e80090331032dd"/>
<event msg="cf-from" time="1" e164="101">
<to e164="102"/>
</event>
<event msg="alert-to" time="1" e164="102" h323="c"/>
<event msg="conn-to" time="3" e164="102" h323="c"/>
<event msg="rel-to" time="5" cause="0"/>
</cdr>
Object C CDR
<cdr guid="8f47c0cfe909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="c" cn="C" e164="102" h323="c" dir="to" utc="1272551789" local="1272558989">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="dd95b681e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="2" e164="100" h323="a"/>
<event msg="rel-from" time="4" cause="0"/>
</cdr>
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272552609" local="1272559809">
<user/>
<event msg="setup-from" time="0" conf="f5092783e909d31192e80090331032dd"/>
<event msg="alert-to" time="1" e164="101" h323="b"/>
<event msg="cf-to" time="5" e164="101" h323="b">
<to e164="102"/>
</event>
<event msg="conn-to" time="8" e164="102" h323="c"/>
<event msg="rel-to" time="9" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="to" utc="1272552610" local="1272559810">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="f5092783e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="rel-to" time="4" cause="0"/>
</cdr>
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" cn="B" e164="101" h323="b" dir="cf" utc="1272552614" local="1272559814">
<user/>
<event msg="setup-to" time="5" e164="100" h323="a" conf="f5092783e909d31192e80090331032dd"/>
<event msg="cf-from" time="5" e164="101" h323="b">
<to e164="102"/>
</event><event msg="conn-to" time="8" e164="102" h323="c"/>
<event msg="rel-to" time="9" cause="0"/>
</cdr>
Object C CDR
<cdr guid="8f47c0cfe909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="c" cn="C" e164="102" h323="c" dir="to" utc="1272552614" local="1272559814">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="f5092783e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="3" e164="100" h323="a"/>
<event msg="rel-from" time="4" cause="0"/>
</cdr>
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272607911" local="1272615111">
<user/>
<event msg="setup-from" time="0" conf="9b24bc13e909d31192e80090331032dd"/>
<event msg="alert-to" time="1" e164="101" h323="b"/>
<event msg="conn-to" time="3" e164="101" h323="b"/>
<event msg="transfer-to" time="7" e164="101" h323="b">
<to e164="102"/>
</event><event msg="conn-to" time="9" e164="102" h323="c"/>
<event msg="rel-to" time="10" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="to" utc="1272607912" local="1272615112">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="9b24bc13e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="2" e164="100" h323="a"/>
<event msg="rel-to" time="6" cause="26"/>
</cdr>
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" cn="B" e164="101" h323="b" dir="ct" utc="1272607918" local="1272615118">
<user/>
<event msg="setup-to" time="7" e164="100" h323="a" conf="9b24bc13e909d31192e80090331032dd"/>
<event msg="transfer-from" time="7" e164="101" h323="b">
<to e164="102" h323="c"/>
</event>
<event msg="conn-to" time="9" e164="101" h323="b"/>
<event msg="rel-to" time="10" cause="0"/>
</cdr>
Object C CDR
<cdr guid="8f47c0cfe909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="c" cn="C" e164="102" h323="c" dir="to" utc="1272607918" local="1272615118">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="9b24bc13e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="2" e164="100" h323="a"/>
<event msg="rel-from" time="3" cause="0"/>
</cdr>
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272609642" local="1272616842">
<user/>
<event msg="setup-from" time="0" conf="18dbf93fe909d31192e80090331032dd"/>
<event msg="alert-to" time="2" e164="101" h323="b"/>
<event msg="conn-to" time="4" e164="101" h323="b"/>
<event msg="transfer-to" time="9" e164="101" h323="b">
<to e164="102" h323="c"/>
</event><event msg="conn-to" time="11" e164="102" h323="c"/>
<event msg="rel-to" time="14" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="to" utc="1272609644" local="1272616844">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="18dbf93fe909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="2" e164="100" h323="a"/>
<event msg="rel-to" time="7" cause="26"/>
</cdr>
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="from" utc="1272609647" local="1272616847">
<user/>
<event msg="setup-from" time="0" conf="75762ef4e909d311aff8009033102603"/>
<event msg="alert-to" time="2" e164="102" h323="c"/>
<event msg="transfer-from" time="4" e164="102" h323="c" conf="18dbf93fe909d31192e80090331032dd">
<to e164="100" h323="a"/>
</event>
<event msg="conn-to" time="11" e164="102" h323="c"/>
<event msg="rel-to" time="14" cause="0"/>
</cdr>
Object C CDR
<cdr guid="8f47c0cfe909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="c" cn="C" e164="102" h323="c" dir="to" utc="1272609649" local="1272616849">
<user/>
<event msg="setup-to" time="0" e164="101" h323="b" conf="75762ef4e909d311aff8009033102603"/>
<event msg="alert-from" time="0" e164="101" h323="b"/>
<event msg="transfer-to" time="2" e164="101" h323="b" conf="18dbf93fe909d31192e80090331032dd">
<to e164="100" h323="a"/>
</event><event msg="conn-from" time="4" e164="100" h323="a"/>
<event msg="rel-from" time="7" cause="0"/>
</cdr>
Object A CDR
<cdr guid="e78cb2b8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="a" cn="A" e164="100" h323="a" dir="from" utc="1272613531" local="1272620731">
<user/>
<event msg="setup-from" time="0" conf="1827b3c7e909d31192e80090331032dd"/>
<event msg="alert-to" time="1" e164="101" h323="b"/>
<event msg="conn-to" time="3" e164="101" h323="b"/>
<event msg="transfer-to" time="10" e164="101" h323="b">
<to e164="102" h323="c"/>
</event>
<event msg="connected" time="10" e164="102" h323="c"/>
<event msg="rel-to" time="12" cause="0"/>
</cdr>
Object B CDR
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="to" utc="1272613532" local="1272620732">
<user/>
<event msg="setup-to" time="0" e164="100" h323="a" conf="1827b3c7e909d31192e80090331032dd"/>
<event msg="alert-from" time="0" e164="100" h323="a"/>
<event msg="conn-from" time="2" e164="100" h323="a"/>
<event msg="transfer-from" time="9" e164="100" h323="a">
<to e164="102" h323="c"/>
</event><event msg="connected" time="10" e164="102" h323="c"/>
<event msg="rel-to" time="12" cause="0"/>
</cdr>
<cdr guid="9362bef8e909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="b" cn="B" e164="101" h323="b" dir="from" utc="1272613535" local="1272620735">
<user/>
<event msg="setup-from" time="0" conf="8fc0cfc0e909d311b722009033102603"/>
<event msg="alert-to" time="2" e164="102" h323="c"/>
<event msg="conn-to" time="4" e164="102" h323="c"/>
<event msg="transfer-from" time="6" e164="102" h323="c" conf="1827b3c7e909d31192e80090331032dd">
<to e164="100" h323="a"/>
</event>
<event msg="connected" time="4" e164="100" h323="a"/>
<event msg="rel-from" time="6" cause="0"/>
</cdr>
Object C CDR
<cdr guid="8f47c0cfe909d31188ce0090330602e8" sys="PBX" pbx="." node="root" device="c" cn="C" e164="102" h323="c" dir="to" utc="1272613537" local="1272620737">
<user/>
<event msg="setup-to" time="0" e164="101" h323="b" conf="8fc0cfc0e909d311b722009033102603"/>
<event msg="alert-from" time="0" e164="101" h323="b"/>
<event msg="conn-from" time="2" e164="101" h323="b"/>
<event msg="transfer-to" time="4" e164="101" h323="b" conf="1827b3c7e909d31192e80090331032dd">
<to e164="100" h323="a"/>
</event>
<event msg="connected" time="4" e164="100" h323="a"/>
<event msg="rel-from" time="6" cause="0"/>
</cdr>
CDRs are sent through the CDR0/1 interfaces (see Reference pages) which have an internal buffering capacity of 300kB. PBX CDRs can get quite large (the sample "A(100) calls B(101) transfer with consultation to C(102)" above is about 0.8kB) though.
The CDRs created by the PBX can be displayed for test-purposes in a Web-Browser. In this case the CDR0/1 - Interface must not be configured, the CDR-Generation must be enabled. This test-mode can be enabled by:
http://x.x.x.x/!config change CDR0 /test-cdr http://x.x.x.x/!config activate
After making the desired call, the CDR0-buffer can be displayed using the URL:
http://x.x.x.x/CDR0/mod_cmd.xml?cmd=test-cdr
By default all CDRs are deleted by read them with this command. Add the argumment "keep" to not delete the CDRs. This way they can be read multiple times.
http://x.x.x.x/CDR0/mod_cmd.xml?cmd=test-cdr&keep=on
There is the file cdrs.xsl available, which can read from the firmware to format the essential information from the CDRs read with the test-cdr command to have it more readable. This xsl can be applied directly with the following command url
http://x.x.x.x/CDR0/mod_cmd.xml?cmd=test-cdr&keep=on&xsl=cdrs.xsl
Please note that this test-mode must not be used in production environments, only in test systems.