Simple CDR Format

From Bizfon Wiki

Jump to: navigation, search

Using the Simple CDR Format

There are several commercial tools available that collect CDR information through simple TCP-based communication. Each CDR is sent in one line of ASCII text terminated by a CRLF pair over a TCP-based communication link.

In order to send the simple CDR to an external server, you need to specify the IP address and the port for the server. You do this in the SOAP CDR setting on the admin level of the PBX. In order to differentiate the destination from a SOAP CDR, you must use the scheme "cdr" in front of the IP address and the port. The fields are separated by a colon. For example, "cdr:192.168.1.2:10000" would send the CDR to the IP address 192.168.1.2 on port 10000.

Note: You can not set the CDR format via the web interface.

Format

You can define a format string that the PBX uses to generate the CDR line. You can use any characters in this string; however the dollar sign has a special meaning. The format can be defined in the global setting with the name "cdr_format" (see Global Configuration File).

When sending plain text CDR from the PBX, you can use the following fields:

   * '$$' inserts a dollar sign.
   * '$i' inserts the Call-ID of the call, as seen in the SIP packet.
   * '$v' inserts the variety (type) of the call. The type can be one of the following: attendant, acd, ivrnode, hunt, conference, mailbox, extcall, starcode, srvflag etc. Default is "attendant".
   * '$m' inserts the domain name of the domain of the call, for example domain.com.
   * '$l' inserts the language of the call, for example "en".
   * '$f' inserts the from-header as seen on the SIP packet.
   * '$t' inserts the to-header as seen on the SIP packet.
   * '$F' is the calling extension number, if present (for example, "123").
   * '$T' is the called extension number, if present (for example, "123").
   * '$x' inserts the name of the originating trunk, if present (for example "Trunk 1").
   * '$y' inserts the name of the destination trunk, if present (for example "Trunk 1").
   * '$R' inserts the account that is being charged for a redirected call. Used only if the call is redirected.
   * '$r' inserts the destination for a redirected call. Used only if the call is redirected.
   * '$S' inserts the start time in seconds since January 1, 1970.
   * '$C' inserts the connected duration for the call.
   * '$A' inserts the answered duration for the call (useful if the call is ringing/answered through the queue).
   * '$E' inserts the hold duration for the call.
   * '$W' inserts the ivr duration for the call
   * '$w' inserts the start time in the format YYYYMMDDHHMMSS (for example, "20071223123224")
   * '$b' inserts the date in YYYYMMDD format (version 2.1.9).
   * '$B' inserts the time in HHMMSS format (version 2.1.9).
   * '$e' inserts the extension number for the call, either originating or receiving.
   * '$o' inserts the direction of the call. "I" is used for inbound calls, "O" for outbound calls.
   * '$c' inserts the caller-ID of the remote party.
   * '$d' inserts the duration of the call in seconds.
   * '$s' inserts the duration of the call connected to an extension. 

You can put the length of the string between the dollar sign and the character. For example the expression '$10c' will insert a 10-digit caller-ID into the string.

An example would look like "$w$5e$12c$5d". It would generate line that could look like this: "20071223123224 123 9781234567 120".

Personal tools
Getting Help