Skip to end of metadata
Go to start of metadata

If the channel has a CDR, that CDR has its own set of variables which can be accessed just like channel variables. The following builtin variables are available.

  • ${CDR(clid)} Caller ID
  • ${CDR(src)} Source
  • ${CDR(dst)} Destination
  • ${CDR(dcontext)} Destination context
  • ${CDR(channel)} Channel name
  • ${CDR(dstchannel)} Destination channel
  • ${CDR(lastapp)} Last app executed
  • ${CDR(lastdata)} Last app's arguments
  • ${CDR(start)} Time the call started.
  • ${CDR(answer)} Time the call was answered.
  • ${CDR(end)} Time the call ended.
  • ${CDR(duration)} Duration of the call.
  • ${CDR(billsec)} Duration of the call once it was answered.
  • ${CDR(disposition)} ANSWERED, NO ANSWER, BUSY
  • ${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc
  • ${CDR(accountcode)} The channel's account code.
  • ${CDR(uniqueid)} The channel's unique id.
  • ${CDR(userfield)} The channels uses specified field.

In addition, you can set your own extra variables by using Set(CDR(name)=value). These variables can be output into a text-format CDR by using the cdr_custom CDR driver; see the cdr_custom.conf.sample file in the configs directory for an example of how to do this.

  • No labels

1 Comment

  1. Running Asterisk 13.16.0, a recent call detail record is:

    "","polycom1","7034371234","outgoing","""Polycom 1"" <polycom1>","SIP/polycom1-00000000","SIP/voipms-00000001","Dial","SIP/voipms/7034371234","2017-08-15 02:44:13","2017-08-15 02:44:35","2017-08-15 02:44:38",25,3,"ANSWERED","DOCUMENTATION","1502765053.0",""

    It appears that there is a source channel "SIP/polycom1-00000000" between the channel name """Polycom 1"" <polycom1>" and the destination channel "SIP/voipms-00000001". The variable list omits source channel.

    Also, the description for the last variable, userfield, probably should be "The channel's user-specified field."