Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Whenever a channel is created.
  • Whenever a channel leaves a bridge and is not hung up.
  • When a CDR is forked from a prior record.
  • When a channel enters a multi-party bridge.
  • When a channel dials more than one channel.

When it is created, a CDR inherits the uniqueid and linkedid from its Party A channel, and a new sequence number is generated. When created as a result of a dial operation, the channel acting as the caller is always the Party A.

...

When a channel is known to dial other channels, a CDR is created for each dial attempt. The dial status is recorded for each dial attempt as a CDR Disposition. Note that not all dial attempts may be dispatched depending on the CDR configuration. The caller is always the Party A in the created CDRs.

Anchor
cdr_bridging
cdr_bridging

Bridging

If a channel is bridged with another channel, the following procedure is performed:

  • The CDR is marked as having entered a bridge. If there is no other channel in the bridge, the CDR waits for another channel to join.
  • For each pairing of channels, the channels are compared to determine which is the Party A channel and which is the Party B channel. (See Choosing the Party A channel).
    • If the channel entering the bridge is the Party A, the CDR has a Party B, and the channel it is bridged with is the Party B, the CDR continues.
    • If the channel entering the bridge is the Party A, the CDR has a Party B, and the channel is not already the Party B, the current CDR is finalized and a new CDR is created for the relationship between the two parties. Note that the original CDR will be re-activated if the existing Party B enters the bridge.
    • If the channel entering the bridge is the Party A, the CDR has no Party B, then the channel it is bridged with becomes the Party B.
    • If the channel entering the bridge is the Party B, the other channel has a CDR with no Party B, this channel becomes the Party B and the existing CDR is finalized.
    • If the channel entering the bridge is the Party B, the other channel has a CDR with a Party B, and this channel is that CDR's Party B, then the existing CDR is finalized and the other channel's CDR activated.
    • If the channel entering the bridge is the Party B, the other channel has a CDR with a Party B, and this channel is not that CDR's Party B, then the existing CDR is finalized and a new CDR is created for that other channel with this channel as the Party B.
  • If a third party joins the bridge with Party A and Party B, the process Choosing the Party A channel is repeated for each pairing of channels. Thus, in a three-way call there will be three CDR records; in a four-way call there will be six records, etc.

...

If a Party A channel in a CDR is not hung up but the CDR is finalized - such as when the channel leaves a bridge of its Party B hangs up - a new CDR is made for that channel and the process in CDR Creation is begun again. Note that if the Party B in a CDR continues on in the the dialplan and/or is bridged with a new party, it may become Party A for a new CDR.

If at any point the Party A channel for a CDR is hung up, all CDR records for that Party A are dispatched.

Anchor
CDR_dispatch
CDR_dispatch

...

Field

Type

Description

Access

accountcode

String (20)

An account code associated with the Party A channel

r/w

src

String (80)

The Caller ID Number

r

dst

String (80)

The destination extension

r

dcontext

String (80)

The destination context

r

clid

String (80)

The Caller ID with text

r

channel

String (80)

The name of the Party A channel

r

dstchannel

String (80)

The name of the Party B channel

r

lastapp

String (80)

The last application the Party A channel executed

r

lastdata

String (80)

The application data for the last application the Party A channel executed

r

start

Date/time

The time the CDR was created

r

answer

Date/time

The time when Party A was answered, or when the bridge between Party A and Party B was created

r

end

Date/time

The time when the CDR was finished. This occurs when either party hangs up, or when the bridge between the parties is broken

r

duration

Integer

The time in seconds from start until end

r

billsec

Integer

The time in seconds from answer until end

r

disposition

Enum

The final known disposition of the CDR record. See CDR dispositions for possible values

r

amaflags

Enum

A flag specified on the Party A channel. See AMA records for possible values

r/w

userfield

String (255)

A user defined field set on the channels. If set on both the Party A and Party B channel, the userfields of both are concatenated and separated by a ;

r/w

uniqueid

String (32)

A unique identifier for the Party A channel

r

linkedid

String (32)

A unique identifier that unites multiple CDR records. See linkedid propagation for more details

r

peeraccount

String (80)

The account code of the Party B channel

r/w

sequence

Integer

A numeric value that, combined with uniqueid and linkedid, can be used to uniquely identify a single CDR record

r

...

When a Local channel optimization occurs, the CDR records associated with the Local channel are finalized. New CDR records are generated for the channels in the merged bridge, per the rules outlined in CDR Consolidation.Bridging. That is, new CDRs are generated from each pair of channels that result from the merging of the bridges.

Warning

CDR properties set on optimized Local channels are not propagated to other channels. Setting CDR information on optimizing Local channels will cause that information to be lost.

In prior versions of Asterisk it was sometimes necessary to set CDR information on Local channels - with the addition of Pre-Dial handlers, it is always possible to set CDR information on the appropriate channel at the time of creation.

...

Name

Type

Description

enable

Boolean

Enable/disable the CDR engine

batch

Boolean

Dispatch CDRs in batches.

unanswered

Boolean

Dispatch unanswered CDRs. See the definition of Unanswered in Terminology for more information.

congestion

Boolean

Treat congestion calls as failed calls

endbeforehexten

Boolean

Finalize CDRs before the h extension or hangup handlers are executed

initiatedseconds

Boolean

Count microseconds for the purposes of the billsec field

size

Integer

The number of records to buffer before initiating a batch

time

Integer

The time, in seconds, before initiating a batch

scheduleronly

Boolean

Deprecated. See usethreadpool instead.

usethreadpool

Boolean

For any CDRs that are dispatched, use a thread pool thread to perform the dispatching. This prevents the CDR taskprocessor thread from being blocked by any CDR backends.

safeshutdown

Boolean

Block Asterisk shutdown on dispatching of CDRs

...