No subject


Fri Sep 2 03:59:05 CDT 2011


=09<li>Duration - the End time minus the Start time</li>
=09<li>Billing - the End time minus the Answer time</li>
</ul>


<p>Note that a CDR only tracks information about a single path of communica=
tion between two endpoints. In many scenarios, there will be multiple paths=
 of communication between multiple endpoints. Each path of communication re=
sults in a new CDR. Those CDRs are associated by virtue of a special linked=
 identifier field, <tt>linkedid</tt>. The CDRs themselves, however, do <b>n=
ot</b> aggregate the time between records. It is up to billing systems to d=
etermine which CDRs should be used for their billing records, and add up th=
e times/durations themselves.</p>

<h1><a name=3D"Asterisk12CDRSpecification-SemanticsandSyntax"></a>Semantics=
 and Syntax</h1>

<h2><a name=3D"Asterisk12CDRSpecification-CDRLayout"></a>CDR Layout</h2>

<h3><a name=3D"Asterisk12CDRSpecification-StandardFields"></a>Standard Fiel=
ds</h3>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> Field </th>
<th class=3D'confluenceTh'> Type </th>
<th class=3D'confluenceTh'> Description </th>
<th class=3D'confluenceTh'> Access </th>
</tr>
<tr>
<td class=3D'confluenceTd'> accountcode </td>
<td class=3D'confluenceTd'> String (20) </td>
<td class=3D'confluenceTd'> An account code associated with the Party A cha=
nnel </td>
<td class=3D'confluenceTd'> r/w </td>
</tr>
<tr>
<td class=3D'confluenceTd'> src </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The Caller ID Number </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> dst </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The destination extension </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> dcontext </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The destination context </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> clid </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The Caller ID with text </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> channel </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The name of the Party A channel </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> dstchannel </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The name of the Party B channel </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> lastapp </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The last application the Party A channel execut=
ed </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> lastdata </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The application data for the last application t=
he Party A channel executed </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> start </td>
<td class=3D'confluenceTd'> Date/time </td>
<td class=3D'confluenceTd'> The time the CDR was created </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> answer </td>
<td class=3D'confluenceTd'> Date/time </td>
<td class=3D'confluenceTd'> The time when Party A was answered, or when the=
 bridge between Party A and Party B was created </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> end </td>
<td class=3D'confluenceTd'> Date/time </td>
<td class=3D'confluenceTd'> The time when the CDR was finished. This occurs=
 when either party hangs up, or when the bridge between the parties is brok=
en </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> duration </td>
<td class=3D'confluenceTd'> Integer </td>
<td class=3D'confluenceTd'> The time in seconds from start until end </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> billsec </td>
<td class=3D'confluenceTd'> Integer </td>
<td class=3D'confluenceTd'> The time in seconds from answer until end </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> disposition </td>
<td class=3D'confluenceTd'> Enum </td>
<td class=3D'confluenceTd'> The final known disposition of the CDR record. =
See <a href=3D"/wiki/pages/createpage.action?spaceKey=3DAST&amp;title=3DCDR=
+dispositions&amp;linkCreation=3Dtrue&amp;fromPageId=3D22088359" class=3D"c=
reatelink">CDR dispositions</a> for possible values </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> amaflags </td>
<td class=3D'confluenceTd'> Enum </td>
<td class=3D'confluenceTd'> A flag specified on the Party A channel. See <a=
 href=3D"/wiki/pages/createpage.action?spaceKey=3DAST&amp;title=3DAMA+recor=
ds&amp;linkCreation=3Dtrue&amp;fromPageId=3D22088359" class=3D"createlink">=
AMA records</a> for possible values </td>
<td class=3D'confluenceTd'> r/w </td>
</tr>
<tr>
<td class=3D'confluenceTd'> userfield </td>
<td class=3D'confluenceTd'> String (255) </td>
<td class=3D'confluenceTd'> A user defined field set on the Party A channel=
 </td>
<td class=3D'confluenceTd'> r/w </td>
</tr>
<tr>
<td class=3D'confluenceTd'> uniqueid </td>
<td class=3D'confluenceTd'> String (32) </td>
<td class=3D'confluenceTd'> A unique identifier for the Party A channel </t=
d>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> linkedid </td>
<td class=3D'confluenceTd'> String (32) </td>
<td class=3D'confluenceTd'> A unique identifier the unites multiple CDR rec=
or ds. See <a href=3D"#Asterisk12CDRSpecification-cdrlinkedid">linkedid pro=
pagation</a> for more details </td>
<td class=3D'confluenceTd'> r </td>
</tr>
<tr>
<td class=3D'confluenceTd'> peeraccount </td>
<td class=3D'confluenceTd'> String (80) </td>
<td class=3D'confluenceTd'> The account code of the Party B channel </td>
<td class=3D'confluenceTd'> r/w </td>
</tr>
<tr>
<td class=3D'confluenceTd'> sequence </td>
<td class=3D'confluenceTd'> Integer </td>
<td class=3D'confluenceTd'> A numeric value that, combined with uniqueid an=
d linkedid, can be used to uniquely identify a single CDR record </td>
<td class=3D'confluenceTd'> r </td>
</tr>
</tbody></table>
</div>


<p>Any of the values may be accessed using the <a href=3D"/wiki/display/AST=
/Asterisk+11+Function_CDR" title=3D"Asterisk 11 Function_CDR">CDR function<=
/a>. Any value that is read/write may be modified using this same function.=
 CDR field values cannot be modified once the CDR is finalized.</p>

<p><a name=3D"Asterisk12CDRSpecification-cdrdispositions"></a></p>
<h4><a name=3D"Asterisk12CDRSpecification-Dispositions"></a>Dispositions</h=
4>

<p>Dispositions represent the final state of the call from the perspective =
of Party A.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> Value </th>
<th class=3D'confluenceTh'> Description </th>
<th class=3D'confluenceTh'> <a href=3D"/wiki/display/AST/Hangup+Cause+Mappi=
ngs" title=3D"Hangup Cause Mappings">Hangup Cause Mapping</a> </th>
</tr>
<tr>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> The channel was never answered. This is the def=
ault disposition for an unanswered channel. </td>
<td class=3D'confluenceTd'> Any not explicitly listed </td>
</tr>
<tr>
<td class=3D'confluenceTd'> FAILED </td>
<td class=3D'confluenceTd'> The channel attempted to dial but the call fail=
ed. </td>
<td class=3D'confluenceTd'><ul>
=09<li>AST_CAUSE_CONGESTION</li>
=09<li>AST_CAUSE_NO_ROUTE_DESTINATION</li>
=09<li>AST_CAUSE_UNREGISTERED</li>
</ul>
</td>
</tr>
<tr>
<td class=3D'confluenceTd'> BUSY </td>
<td class=3D'confluenceTd'> The channel attempted to dial but the remote pa=
rty was busy. </td>
<td class=3D'confluenceTd'><ul>
=09<li>AST_CAUSE_BUSY</li>
</ul>
</td>
</tr>
<tr>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> The channel was answered. When the channel is a=
nswered, the hangup cause no longer changes the disposition. </td>
<td class=3D'confluenceTd'> Any not explicitly listed </td>
</tr>
</tbody></table>
</div>


<p><a name=3D"Asterisk12CDRSpecification-cdrama"></a></p>
<h4><a name=3D"Asterisk12CDRSpecification-AMAFlags"></a>AMA Flags</h4>

<ul>
=09<li>OMIT</li>
=09<li>BILLING</li>
=09<li>DOCUMENTATION</li>
</ul>


<h3><a name=3D"Asterisk12CDRSpecification-UserDefinedFields"></a>User Defin=
ed Fields</h3>

<p>Any CDR record may have user defined fields associated with it. Fields c=
an be added to either the Party A or Party B channel. Note that not all CDR=
 backends will generate user defined fields; in those cases the user field =
is simply dropped.</p>

<p>If a Party A channel and a Party B channel both contain a field with the=
 same key, only the Party A channel's field will be written to the CDR.</p>

<p>User defined CDR fields are created using the <a href=3D"/wiki/display/A=
ST/Asterisk+11+Function_CDR" title=3D"Asterisk 11 Function_CDR">CDR functio=
n</a>, and read using the same function.</p>

<h2><a name=3D"Asterisk12CDRSpecification-CDRAPIs"></a>CDR APIs</h2>

<p>While there are many APIs in Asterisk for manipulating CDRs, in general,=
 backends will be concerned with the C structure representing CDRs and the =
APIs needed to register for receiving CDRs.</p>

<p>CDRs themselves are generated from the <a href=3D"/wiki/display/AST/Aste=
risk+12+API+Improvements" title=3D"Asterisk 12 API Improvements">Stasis</a>=
 message bus in Asterisk, from a combination of Channel and Bridge messages=
. These messages inform the CDR engine of the state of the channels/bridges=
. See <a href=3D"#Asterisk12CDRSpecification-CDRlifetime">Lifetime</a> for =
a state diagram of how these messages alter the state of a CDR.</p>

<h3><a name=3D"Asterisk12CDRSpecification-Types"></a>Types</h3>

<h4><a name=3D"Asterisk12CDRSpecification-astcdrbe"></a>ast_cdrbe</h4>

<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<pre class=3D"theme: Confluence; brush: java; gutter: false">/*!
 * \brief CDR backend callback
 * \warning CDR backends should NOT attempt to access the channel associate=
d
 * with a CDR record.  This channel is not guaranteed to exist when the CDR
 * backend is invoked.
 */
typedef int (*ast_cdrbe)(struct ast_cdr *cdr);</pre>
</div></div>

<h3><a name=3D"Asterisk12CDRSpecification-DataStructures"></a>Data Structur=
es</h3>

<h4><a name=3D"Asterisk12CDRSpecification-structastcdr"></a>struct ast_cdr<=
/h4>

<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<pre class=3D"theme: Confluence; brush: java; gutter: false">struct ast_cdr=
 {
=09/*! Caller*ID with text */
=09char clid[AST_MAX_EXTENSION];
=09/*! Caller*ID number */
=09char src[AST_MAX_EXTENSION];
=09/*! Destination extension */
=09char dst[AST_MAX_EXTENSION];
=09/*! Destination context */
=09char dcontext[AST_MAX_EXTENSION];
        /*! The party A channel */
=09char channel[AST_MAX_EXTENSION];
=09/*! Destination channel if appropriate */
=09char dstchannel[AST_MAX_EXTENSION];
=09/*! Last application if appropriate */
=09char lastapp[AST_MAX_EXTENSION];
=09/*! Last application data */
=09char lastdata[AST_MAX_EXTENSION];
        /*! The time the CDR was created for Party A */
=09struct timeval start;
        /*! The time Party A was answered or Party A could communicate with=
 the destination */
=09struct timeval answer;
        /*! The end time for this CDR */
=09struct timeval end;
=09/*! Total time in system, in seconds */
=09long int duration;
=09/*! Total time call is up, in seconds */
=09long int billsec;
=09/*! What happened to the call */
=09long int disposition;
=09/*! What flags to use */
=09long int amaflags;
=09/*! What account number to use */
=09char accountcode[AST_MAX_ACCOUNT_CODE];
=09/*! Account number of the last person we talked to */
=09char peeraccount[AST_MAX_ACCOUNT_CODE];
=09/*! flags */
=09unsigned int flags;
=09/*! Unique Channel Identifier
=09 * 150 =3D 127 (max systemname) + "-" + 10 (epoch timestamp) + "." + 10 =
(monotonically incrementing integer) + NULL */
=09char uniqueid[150];
=09/* Linked group Identifier */
=09char linkedid[32];
=09/*! User field */
=09char userfield[AST_MAX_USER_FIELD];
=09/*! Sequence field */
=09int sequence;
=09/*! A linked list for variables */
=09struct varshead varshead;
        /*! The next CDR in the chain of CDRs for this channel */
=09struct ast_cdr *next;
};</pre>
</div></div>

<h3><a name=3D"Asterisk12CDRSpecification-Functions"></a>Functions</h3>

<h4><a name=3D"Asterisk12CDRSpecification-astcdrregister"></a>ast_cdr_regis=
ter</h4>

<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<pre class=3D"theme: Confluence; brush: java; gutter: false">/*!
 * \brief Register a CDR handling engine
 * \param name name associated with the particular CDR handler
 * \param desc description of the CDR handler
 * \param be function pointer to a CDR handler
 * Used to register a Call Detail Record handler.
 * \retval 0 on success.
 * \retval -1 on error
 */
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be);</pr=
e>
</div></div>

<h4><a name=3D"Asterisk12CDRSpecification-astcdrunregister"></a>ast_cdr_unr=
egister</h4>

<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<pre class=3D"theme: Confluence; brush: java; gutter: false">/*!
 * \brief Unregister a CDR handling engine
 * \param name name of CDR handler to unregister
 * Unregisters a CDR by it's name
 */
void ast_cdr_unregister(const char *name);</pre>
</div></div>

<h2><a name=3D"Asterisk12CDRSpecification-CDRSemantics"></a>CDR Semantics</=
h2>

<p><a name=3D"Asterisk12CDRSpecification-CDRlifetime"></a></p>
<h3><a name=3D"Asterisk12CDRSpecification-Lifetime"></a>Lifetime</h3>


<table style=3D"background-color: #2C8FCF;  height: 38px">
    <tr>
        <td style=3D"vertical-align: middle; padding-top: 0px; padding-bott=
om: 0px;">
            <div style=3D"padding: 3px"><img
                    src=3D"/wiki/download/resources/com.gliffy.integration.=
confluence:gliffy-macro-key/icons/gliffy_logo_32px.png"/>
            </div>
        </td>
        <td style=3D"border-right: 2px solid white; padding:3px">
            <span style=3D"font-size:120%; font-weight: bold; color: white"=
>Gliffy Macro Error</span>
        </td>
        <td style=3D"padding: 3px;">
            <span style=3D"color:white;">
                Cannot find a diagram with these parameters: <br>
                <strong>name:</strong> CDR Flowchart <br>
                 <strong>version:</strong> 1 <br>                          =
                                   </span>

                        <hr/>
            <span style=3D"font-weight: bold; ">
                <a href=3D"/wiki/plugins/gliffy/adddiagram.action?name=3DCD=
R Flowchart&ceoid=3D22088359&key=3DAST&pageId=3D22088359">Create Diagram</a=
>
            </span>
                    </td>
    </tr>
</table>


<p><a name=3D"Asterisk12CDRSpecification-CDRcreation"></a></p>
<h4><a name=3D"Asterisk12CDRSpecification-Creation"></a>Creation</h4>

<p>A CDR record is created in any one of the following situations:</p>
<ul>
=09<li>Whenever a channel is created</li>
=09<li>Whenever a channel leaves a bridge</li>
=09<li>When a CDR is forked from a prior record</li>
=09<li>When a channel <a href=3D"#Asterisk12CDRSpecification-cdrdialing">di=
als more than one channel</a></li>
</ul>


<p>A new CDR inherits the <tt>uniqueid</tt> from its channel, and a new <tt=
>sequence</tt> number is generated. If the channel dialed other channels it=
 will record the dial result. If the channel is never bridged with another =
channel, the CDR will record the last application and its data for the chan=
nel, as well as the disposition for the channel.</p>

<p>If a channel is bridged with another channel, the following procedure is=
 performed:</p>
<ul>
=09<li>The CDR is marked as having entered a bridge. If the channel is chos=
en as a Party A channel, the CDR will not be discarded upon termination of =
the bridge or channel. If the channel is never chosen as the Party A channe=
l, the CDR will be discarded when it transitions to finalization.</li>
=09<li>The two channels are compared to determine which is the Party A chan=
nel and which is the Party B channel. (See <a href=3D"#Asterisk12CDRSpecifi=
cation-choosingpartya">Choosing the Party A channel</a>).</li>
=09<li>Once chosen, the Party A channel receives the Party B channel's info=
rmation. The Party B's CDR record is not used for this particular call.</li=
>
=09<li>If a third party joins the bridge with Party A and Party B, the proc=
ess <a href=3D"#Asterisk12CDRSpecification-choosingpartya">Choosing the Par=
ty A channel</a> 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.</li>
</ul>


<p><a name=3D"Asterisk12CDRSpecification-cdrdialing"></a></p>
<h5><a name=3D"Asterisk12CDRSpecification-DialingParties"></a>Dialing Parti=
es</h5>

<p>When a channel is known to dial other channels, a CDR is created for eac=
h dial attempt. The dial status is recorded for each dial attempt as a <a h=
ref=3D"#Asterisk12CDRSpecification-cdrdispositions">CDR Disposition</a>. No=
te that not all dial attempts may be dispatched depending on the CDR config=
uration.</p>

<p><a name=3D"Asterisk12CDRSpecification-choosingpartya"></a></p>
<h5><a name=3D"Asterisk12CDRSpecification-ChoosingthePartyAchannel"></a>Cho=
osing the Party A channel</h5>

<p>Asterisk does not have the concept of "internal" versus "external" devic=
es. As such, what constitutes the Party A channel is highly dependent on a =
particular system configuration which is outside the control of the CDR sys=
tem. As such, choosing a Party A uses the following simple rules:</p>
<ol>
=09<li>If one of the two channels has the <tt>party_a</tt> flag set, then t=
hat channel is chosen as the Party A.</li>
=09<li>If neither channel has the <tt>party_A</tt> flag, the channel with t=
he oldest creation time is chosen as the Party A.</li>
=09<li>If both channels have the <tt>party_A</tt> flag, then the channel wi=
th the oldest creation time is chosen as the Party A.</li>
</ol>


<p>The <tt>party_A</tt> flag may be set using the <a href=3D"/wiki/pages/cr=
eatepage.action?spaceKey=3DAST&amp;title=3DCDR+function&amp;linkCreation=3D=
true&amp;fromPageId=3D22088359" class=3D"createlink">CDR function</a>. Note=
 that if you need to set the <tt>party_A</tt> flag on a channel dialed usin=
g the <a href=3D"/wiki/display/AST/Dial+Application" title=3D"Dial Applicat=
ion">Dial Application</a>, you may need to use either a <a href=3D"/wiki/pa=
ges/createpage.action?spaceKey=3DAST&amp;title=3DPre-dial+subroutine&amp;li=
nkCreation=3Dtrue&amp;fromPageId=3D22088359" class=3D"createlink">Pre&#45;d=
ial subroutine</a> or a <a href=3D"/wiki/pages/createpage.action?spaceKey=
=3DAST&amp;title=3DPre-bridge+subroutine&amp;linkCreation=3Dtrue&amp;fromPa=
geId=3D22088359" class=3D"createlink">Pre&#45;bridge subroutine</a> to set =
the <tt>party_A</tt> flag on that channel.</p>

<p><a name=3D"Asterisk12CDRSpecification-cdrlinkedid"></a></p>
<h5><a name=3D"Asterisk12CDRSpecification-LinkedIDPropagation"></a>LinkedID=
 Propagation</h5>

<p>When a Party A channel is chosen and its CDR inherits the properties of =
the Party B's CDR, the <tt>linkedid</tt> of the Party A and the Party B cha=
nnel is compared. The oldest <tt>linkedid</tt> is the <tt>linkedid</tt> cho=
sen for the resulting CDR. Note that this might not be the <tt>linkedid</tt=
> of the Party A channel, if the <tt>linkedid</tt> of the Party B channel o=
riginally came from a channel that was older than the Party A channel.</p>

<p>When the <tt>linkedid</tt> is updated for a CDR record, that <tt>linkedi=
d</tt> is propagated to all non-dispatched CDRs associated with both Party =
A and Party B. If the propagation affects a CDR involving another channel, =
the <tt>linkedid</tt> may be propagated to that channel's CDRs as well, unl=
ess the <tt>linkedid</tt> of that CDR is older than the current propagating=
 <tt>linkedid</tt>, or those CDRs have already been dispatched.</p>

<p>If, while propagating a <tt>linkedid</tt> an older <tt>linkedid</tt> is =
encountered, the older <tt>linkedid</tt> is chosen and that <tt>linkedid</t=
t> propagated to all CDR records.</p>

<p><a name=3D"Asterisk12CDRSpecification-CDRfinalization"></a></p>
<h4><a name=3D"Asterisk12CDRSpecification-Finalization"></a>Finalization</h=
4>

<p>A CDR is finalized in one of the following scenarios:</p>
<ul>
=09<li>If in a bridge, either party A or party B leaves the bridge</li>
=09<li>If not in a bridge, party A hangs up</li>
=09<li>The CDR is forked</li>
</ul>


<p>When a CDR is finalized, no further modifications can be made to the CDR=
 by the user or Asterisk. The only exception to this rule is when a <tt>lin=
kedid</tt> <a href=3D"#Asterisk12CDRSpecification-cdrlinkedid">propagation<=
/a> occurs.</p>

<p>If either party is not hung up, a new CDR record is made for the party t=
hat is not hung up and the process in <a href=3D"#Asterisk12CDRSpecificatio=
n-CDRcreation">CDR Creation</a> is begun again. Note that if Party B contin=
ues on the in the dialplan and is bridged with a new party, it may become P=
arty A for that new CDR. If the Party A channel is hung up, all CDR records=
 for Party A are <a href=3D"#Asterisk12CDRSpecification-CDRdispatch">dispat=
ched</a>.</p>

<p><a name=3D"Asterisk12CDRSpecification-CDRdispatch"></a></p>
<h4><a name=3D"Asterisk12CDRSpecification-Dispatch"></a>Dispatch</h4>

<p>When a CDR is dispatched, all CDRs associated with the channel are commi=
tted to permanent storage. The CDRs at this point are removed from memory.<=
/p>

<p><a name=3D"Asterisk12CDRSpecification-CDRconsolidation"></a></p>
<h3><a name=3D"Asterisk12CDRSpecification-Consolidation"></a>Consolidation<=
/h3>

<p>CDR records may be consolidated when a Local channel is optimized away. =
When consolidation happens, the following occurs:</p>
<ul>
=09<li>The channels that are not Local channels are compared to determine t=
he Party A channel, using the <a href=3D"#Asterisk12CDRSpecification-choosi=
ngpartya">normal process</a>.</li>
=09<li>The start time used is Party A's start time</li>
=09<li>The answer time used is the most recent answer time between Party A =
and Party B.</li>
=09<li>An end time, if present, is discarded from the CDR. The end time wil=
l be whenever the bridge breaks between the new Party A and Party B.</li>
</ul>


<p>Note that if the Local channel optimization results in a bridge between =
multiple parties, the same process repeats for all combinations of channels=
.</p>

<h2><a name=3D"Asterisk12CDRSpecification-Scenarios"></a>Scenarios</h2>

<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>The following scenarios show examples of the C=
DRs created in common use cases. If a particular scenario is not shown belo=
w, its behavior should still match the behavior described previously. Some =
applications, however, may have undefined behavior as their use is not comm=
on or the mechanism by which they manipulate channels does not allow for th=
e capturing of the channel state.

<p>Undefined behavior means that the behavior of CDRs in those cases is uns=
upported and will not be addressed as a bug.</p></td></tr></table></div>

<h3><a name=3D"Asterisk12CDRSpecification-Unanswered%22Inbound%22Call"></a>=
Unanswered "Inbound" Call</h3>

<div class=3D'panelMacro'><table class=3D'tipMacro'><colgroup><col width=3D=
'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/icons/=
emoticons/check.gif" width=3D"16" height=3D"16" align=3D"absmiddle" alt=3D"=
" border=3D"0"></td><td>Unanswered calls may not always be logged to CDR ba=
ckends if the configuration has explicitly disabled unanswered calls.</td><=
/tr></table></div>

<p>Alice calls into Asterisk at extension 500 using a SIP phone and, during=
 dialplan execution of a NoOp(), hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 500 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> NoOp </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:20 </td>
<td class=3D'confluenceTd'> 2 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 34 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-Unanswered%22Outbound%22Call"></a=
>Unanswered "Outbound" Call</h3>

<p>Asterisk creates a call file to dial Alice and playback tt-monkeys to he=
r. Alice, anticipating the screeching of howler monkeys, never picks up the=
 phone. Note that in this case there is no application executed on the chan=
nel, as Alice never picked up the phone.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> s </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:20 </td>
<td class=3D'confluenceTd'> 2 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 4 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-SingleParty"></a>Single Party</h3=
>

<p>Alice calls into Asterisk's VoiceMailMain application. This implicitly A=
nswers the channel. She checks her voicemail for awhile, then hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 8500 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Hangup </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 112 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-BasicTwoPartyCall"></a>Basic Two =
Party Call</h3>

<p>Two party calls can be initiated in a variety of ways. Several of the mo=
re common ways are illustrated here.</p>

<h4><a name=3D"Asterisk12CDRSpecification-BasicCall"></a>Basic Call</h4>

<p>Alice calls into Asterisk, which dials Bob. Bob Answers, and a bridge is=
 formed between Alice and Bob. Alice and Bob talk for awhile, then Bob hang=
s up. This breaks the bridge between Alice and Bob, and Alice is hung up on=
 as well.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:26 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:18 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> 112 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 12 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-UnansweredDial"></a>Unanswered Di=
al</h4>

<p>Alice calls into Asterisk, which dials Bob. Bob refuses to pick up his p=
hone, and the call eventually times out.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,10,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 1 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-ParallelDial"></a>Parallel Dial</=
h4>

<p>Alice calls into Asterisk, which dials Bob's SIP desk phone as well as h=
is IAX2 soft phone. Both ring for awhile, and Bob eventually presses the An=
swer button on his IAX2 soft phone.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob&amp;IAX2/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 12 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> IAX2/bob-00000000 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob&amp;IAX2/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:28 </td>
<td class=3D'confluenceTd'> 70 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 13 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-CallForward"></a>Call Forward</h4=
>

<p>Alice calls into Asterisk, which dials Bob's SIP desk phone. Bob is on v=
acation, and the SIP phone returns a "302" and redirects Asterisk to dial h=
is SIP mobile.</p>

<h3><a name=3D"Asterisk12CDRSpecification-Transfers"></a>Transfers</h3>

<p>Transfers create multiple CDRs. In general, a CDR is created for each pa=
th of communication between two endpoints. Note that Asterisk does <b>not</=
b> attempt to compute the total duration or billing time of any of the vari=
ous channels involved - it is up to the businesses consuming CDRs to know w=
hether or not the amount of time they want to bill a party includes the tra=
nsfer, the time spent dialing another party, consultation time, etc.</p>

<h4><a name=3D"Asterisk12CDRSpecification-BlindTransfer"></a>Blind Transfer=
</h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Bob decides to send Alice off t=
o Charlie, and he blind transfers Alice to Charlie's extension. Asterisk di=
als Charlie's SIP phone, and Charlie answers. Alice and Charlie talk for aw=
hile until Alice decides to hang up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 30 </td>
<td class=3D'confluenceTd'> 20 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:53 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:53 </td>
<td class=3D'confluenceTd'> 65 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-AttendedTransfertoChannel"></a>At=
tended Transfer to Channel</h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Bob decides to send Alice off t=
o Charlie, and he initiates an attended transfer. Alice is put on hold, and=
 Bob dials Charlie's extension. Asterisk dials Charlie's SIP phone, and Cha=
rlie answers. Bob and Charlie talk for a bit, and Charlie agrees to talk to=
 Alice. Bob completes the attended transfer, Alice is taken off hold, and A=
lice and Charlie are bridged. Alice talks to Charlie for awhile, then hangs=
 up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:53 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 30 </td>
<td class=3D'confluenceTd'> 26 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:53 </td>
<td class=3D'confluenceTd'> 45 </td>
<td class=3D'confluenceTd'> 45 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>In the example above, note the following:
<ul>
=09<li>Hold time is not reflected in CDRs.</li>
=09<li>When Bob dials Charlie, he becomes the Party A channel. However, the=
 <tt>linkedid</tt> from Alice 'wins', and so the CDR reflects the <tt>linke=
did</tt> from Alice's CDR.</li>
=09<li>Alice and Charlie are bridged automatically by the attended transfer=
, so their start and answer times are identical.</li>
=09<li>The billsec/duration of Alice and Charlie are reflective of their po=
rtion of the call, and do not include the times from Alice and Bob.</li>
</ul>
</td></tr></table></div>

<h4><a name=3D"Asterisk12CDRSpecification-AttendedTransfertoApplication"></=
a>Attended Transfer to Application</h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Bob decides to send Alice off i=
nto Charlie's voicemail mailbox, and he initiates an attended transfer. Ali=
ce is put on hold, and Bob dials an extension that calls into VoiceMail. Bo=
b enters in the Charlie's voicemail mailbox number, then completes the atte=
nded transfer to put Alice into the voicemail mailbox. Alice records some v=
oicemail, then hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 8500 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> VoiceMail </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:49 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 30 </td>
<td class=3D'confluenceTd'> 29 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 8500 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> VoiceMail </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-BlondeTransfer"></a>Blonde Transf=
er</h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Bob decides to send Alice off t=
o Charlie, and he initiates an attended transfer. Alice is put on hold, and=
 Bob dials Charlie's extension. Asterisk dials Charlie's SIP phone, but bef=
ore Charlie answers Bob hangs up. Asterisk recognizes that this is a blonde=
 transfer, takes Alice off hold, and ties Charlie's ringing phone to Alice.=
 Charlie answers, Alice talks to Charlie for awhile, then hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:50</td>
<td class=3D'confluenceTd'> 2 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:50 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:55 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:30 </td>
<td class=3D'confluenceTd'> 40 </td>
<td class=3D'confluenceTd'> 35 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-ThreeWayCall"></a>Three Way Call<=
/h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Bob decides to bring Charlie in=
to the mix. He puts Alice on hold and dials Charlie's extension. Asterisk d=
ials Charlie's SIP phone, and Charlie answers. Bob and Charlie talk for awh=
ile, and Bob then finishes the three-way call by finalizing the attempt. Al=
ice is taken off hold, and Alice, Bob, and Charlie can all talk. Eventually=
, Bob hangs up, and all parties are ejected and hung up on.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:18 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> 110 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:53 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08</td>
<td class=3D'confluenceTd'> 20 </td>
<td class=3D'confluenceTd'> 15 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:18 </td>
<td class=3D'confluenceTd'> 70 </td>
<td class=3D'confluenceTd'> 70 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:18 </td>
<td class=3D'confluenceTd'> 70 </td>
<td class=3D'confluenceTd'> 70 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 104 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>In the example above, note the following:
<ul>
=09<li>The consultation between Bob and Charlie is treated as a separate co=
nversation from the conversation between all three parties. Thus, there are=
 two CDRs between Bob and Charlie.</li>
=09<li>Because the path of communication never was broken between Alice and=
 Bob (despite Alice being put on hold), there is only one CDR for Alice to =
Bob.</li>
</ul>
</td></tr></table></div>

<h4><a name=3D"Asterisk12CDRSpecification-SIPAttendedTransfer"></a>SIP Atte=
nded Transfer</h4>

<p>Alice calls into Asterisk, which dials Bob's SIP phone. Bob answers, and=
 Alice and Bob talk for awhile. Eventually, Alice decides to transfer Bob t=
o Charlie, and performs an attended transfer using her SIP phone. Bob is pu=
t on hold. Alice and Charlie talk for awhile, and then Alice finishes the a=
ttended transfer. Bob is taken off hold, and bridged with Charlie. Alice is=
 hung up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000002 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000003 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:48 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:53 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:08</td>
<td class=3D'confluenceTd'> 20 </td>
<td class=3D'confluenceTd'> 15 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000003 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:28 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>The important point to note here is that a SIP=
 attended transfer uses two channels to communicate with Bob - <tt>SIP/bob-=
00000001</tt> and <tt>SIP/bob-00000002</tt>. The CDR records are associated=
 by virtue of the <tt>linkedid</tt> field.</td></tr></table></div>

<h3><a name=3D"Asterisk12CDRSpecification-LocalChannels"></a>Local Channels=
</h3>

<p>Local channels are a special Asterisk construct that create a path of co=
mmunication between two bridges or a bridge and an application. A Local cha=
nnel always consists of two channels with the same name prefix - the first =
of the Local channel pair is delineated with a <tt>;1</tt>; the second is d=
elineated with a <tt>;2</tt>. Local channels have two different modes in As=
terisk:</p>
<ul>
=09<li>They can exist permanently. In that case, the Local channel pair app=
ears as two separate channels. From the perspective of CDRs, they are treat=
ed as such with an implicit bridge between the channels. CDRs with a perman=
ent Local channel pair will share the same <tt>linkedid</tt>.</li>
=09<li>They can optimize. A Local channel optimization occurs when a pair o=
f Local channels exist between two bridges and the Local channel has been c=
onfigured to optimize. If that situation occurs, the Local channel will cau=
se the two bridges to merge into a single merge, and the Local channel will=
 disappear.</li>
</ul>


<p>Each situation and how it appears in CDRs is explored further below.</p>

<h4><a name=3D"Asterisk12CDRSpecification-NonoptimizingLocalChannels"></a>N=
on-optimizing Local Channels</h4>

<h5><a name=3D"Asterisk12CDRSpecification-Localchanneltoanapplication"></a>=
Local channel to an application</h5>

<p>An external application <a href=3D"/wiki/display/AST/Asterisk+11+Manager=
Action_Originate" title=3D"Asterisk 11 ManagerAction_Originate">Originates<=
/a> a Local channel. The first half of the Local channel Dials Alice over a=
 SIP channel. The second half of the Local channel is placed into her Voice=
Mail account. Alice listens to her VoiceMail through the Local channel, the=
n hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "" </td>
<td class=3D'confluenceTd'> dial_alice </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> Local/dial_alice at default-00000001;1 </td>
<td class=3D'confluenceTd'> SIP/alice-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/alice,,tT </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "" </td>
<td class=3D'confluenceTd'> voicemail </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> Local/dial_alice at default-00000001;2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> VoiceMailMain </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
</tr>
</tbody></table>
</div>


<h5><a name=3D"Asterisk12CDRSpecification-Localchannelbetweenbridges"></a>L=
ocal channel between bridges</h5>

<p>An external application <a href=3D"/wiki/display/AST/Asterisk+11+Manager=
Action_Originate" title=3D"Asterisk 11 ManagerAction_Originate">Originates<=
/a> a Local channel. The first half of the Local channel Dials Alice over a=
 SIP channel; Alice answers. This triggers the second half of the Local cha=
nnel, which Dials Bob. Bob Answers, and Alice and Bob talk. Alice hangs up,=
 the Local channels are hung up, and Bob is hung up on.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "" </td>
<td class=3D'confluenceTd'> dial_alice </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> Local/dial_alice at default-00000001;1 </td>
<td class=3D'confluenceTd'> SIP/alice-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/alice,,tT </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "" </td>
<td class=3D'confluenceTd'> dial_bob </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> Local/dial_alice at default-00000001;2 </td>
<td class=3D'confluenceTd'> SIP/bob-00000003 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,tT </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 50 </td>
<td class=3D'confluenceTd'> 40 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424290.1 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-LocalChannelOptimization"></a>Loc=
al Channel Optimization</h4>

<p>When a Local channel optimization occurs, the CDR records associated wit=
h the Local channel are discarded. New CDR records are generated for the ch=
annels in the merged bridge, per the rules in <a href=3D"#Asterisk12CDRSpec=
ification-CDRconsolidation">CDR Consolidation</a>.</p>

<div class=3D'panelMacro'><table class=3D'warningMacro'><colgroup><col widt=
h=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ic=
ons/emoticons/forbidden.gif" width=3D"16" height=3D"16" align=3D"absmiddle"=
 alt=3D"" border=3D"0"></td><td>CDR properties set on optimized Local chann=
els are <b>not</b> propagated to other channels. Setting CDR information on=
 optimizing Local channels will cause that information to be lost.

<p>In prior versions of Asterisk it was sometimes necessary to set CDR info=
rmation on Local channels - with the addition of <a href=3D"/wiki/display/A=
ST/Pre-Dial+Handlers" title=3D"Pre-Dial Handlers">Pre-Dial handlers</a>, it=
 is always possible to set CDR information on the appropriate channel at th=
e time of creation.</p></td></tr></table></div>

<h3><a name=3D"Asterisk12CDRSpecification-CallHold"></a>Call Hold</h3>

<p>Call Hold is a state of the media between two or more channels, and not =
a change in the actual bridging of those channels. As such, Call Hold is <b=
>not</b> reflected in CDRs. Channels may be put on hold, taken off hold, pu=
t on hold again, forgotten about, found again, taken off hold, etc. without=
 affecting CDRs at all.</p>

<h3><a name=3D"Asterisk12CDRSpecification-CallPark"></a>Call Park</h3>

<p>Call Park is different from Call Hold. Whereas Call Hold is a change of =
media state, Call Park implies that the channel has been moved into a state=
 where it can be retrieved by any other channel. As such, calls in Park rec=
eive their own CDR.</p>

<p>Alice calls into Asterisk and Bob answers. Alice says she wants to talk =
to Charlie, but Bob isn't sure Charlie wants to talk to Alice so he blind t=
ransfers her into Park. Alice sits, waiting in her parking slot, listening =
to serenading robots while Bob asks if Charlie wants to talk to Alice. Char=
lie says sure, so he picks Alice up out of Park and they talk for awhile be=
fore Alice hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:38 </td>
<td class=3D'confluenceTd'> 20 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Park </td>
<td class=3D'confluenceTd'> 60000,default,200,1 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:38 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Park </td>
<td class=3D'confluenceTd'> 60000,default,200,1 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:13:38 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 103 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-CallQueues"></a>Call Queues</h3>

<h4><a name=3D"Asterisk12CDRSpecification-CallQueueExample1"></a>Call Queue=
 - Example 1</h4>

<p>Alice calls into Asterisk and enters <a href=3D"/wiki/display/AST/Asteri=
sk+11+Application_Queue" title=3D"Asterisk 11 Application_Queue">Queue</a> =
without being Answered. She waits in the queue for a period of time. At som=
e point in time, she enters into the head of the queue and the queue perfor=
ms a ring-all on the members of the queue. There are two queue members - Bo=
b and Charlie. Bob is out to lunch, so his queue member is paused and it re=
turns a Busy indication. Charlie, on the other hand, is not busy and answer=
s. Alice and Charlie talk for awhile, and eventually Alice hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 800 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> complaints </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> BUSY </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 800 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> complaints </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h4><a name=3D"Asterisk12CDRSpecification-CallQueueExample2"></a>Call Queue=
 - Example 2</h4>

<p>Alice calls into Asterisk and enters Queue without being Answered. She w=
aits in the queue for a period of time. At some point in time, she enters i=
nto the head of the queue and the queue performs a round-robin strategy rin=
g on the members of the queue. Bob is rung first, but being lazy, he ignore=
s his phone. After some time of ringing, it times out and goes on to Charli=
e. When Charlie's SIP phone rings, he immediately answers. Alice and Charli=
e talk for some period of time, and eventually Alice hangs up.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 800 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> complaints </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 101 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 800 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> complaints </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:38 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 102 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-ConferenceCall"></a>Conference Ca=
ll</h3>

<p>Alice calls into Asterisk and joins a ConfBridge conference. Bob does a =
bit later as well. Finally, Charlie joins the Conference. After talking for=
 awhile, Bob realizes he's late for lunch and hangs up. Alice and Charlie t=
alk for a bit longer, then finally Alice hangs up. Charlie stays in the con=
ference for another second before he hangs up as well.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 1000 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> ConfBridge </td>
<td class=3D'confluenceTd'> 1000,public_bridge,public_user,public_menu </td=
>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> 170 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 1 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 1000 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> ConfBridge </td>
<td class=3D'confluenceTd'> 1000,public_bridge,public_user,public_menu </td=
>
<td class=3D'confluenceTd'> 2013-03-04 13:11:28 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:14:18 </td>
<td class=3D'confluenceTd'> 170 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 1000 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000002 </td>
<td class=3D'confluenceTd'> ConfBridge </td>
<td class=3D'confluenceTd'> 1000,public_bridge,public_user,public_menu </td=
>
<td class=3D'confluenceTd'> 2013-03-04 13:11:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:12:18 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:15:18 </td>
<td class=3D'confluenceTd'> 240 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 3 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<h3><a name=3D"Asterisk12CDRSpecification-AComplexExample"></a>A Complex Ex=
ample</h3>

<p>Alice calls into Asterisk and Dials Bob. Bob answers, and he and Alice t=
alk for awhile. Bob realizes that what Alice really needs is to talk to Sal=
es, so he blind transfers Alice off to the Sales Queue. As Alice is heading=
 off to the Sales Queue, Bob realizes that he should talk with Charlie abou=
t Alice, so he Dials Charlies and he and Charlie talk for awhile. Alice ent=
ers into the Sales Queue, where she waits for a bit while agents David and =
Frank are dialed using Local channels to SIP devices. Alice is eventually A=
nswered by David, a sales agent. David and Alice talk for a bit, but David =
isn't able to sell her on their new fantastic product, so he puts Alice on =
hold for a bit and calls Ellen from engineering. Ellen agrees to be on the =
call, and Alice, David, and Ellen are put into a three-way call. Around thi=
s time, Charlie decides that he should talk to Alice as well. He transfers =
himself to the Sales bridge, hanging up on Bob in the process. This turns t=
he Sales bridge into a four-way call. The four parties talk for awhile, and=
 eventually Alice is sold on the new whiz-bang product, so she hangs up. El=
len realizes she isn't need any more either, and hangs up as well. Charlie =
and David talk about the weather for awhile, and then Charlie hangs up, han=
ging up David as well.</p>

<ul>
=09<li>Alice calls into Asterisk and Dials Bob. Bob and Alice talk for awhi=
le.</li>
</ul>


<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/bob-00000001 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/bob,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:00:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:00:05 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:00 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 55 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 1 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<ul>
=09<li>Bob realizes Alice wants to talk to Sales, so he blind transfers her=
 off to the Sales Queue. Alice enters into the Sales Queue, where she waits=
 for a bit while agents David and Frank are dialed using Local channels to =
SIP devices. Alice is eventually Answered by David, a sales agent.</li>
</ul>


<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> Local/member1 at default-00000001;1 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> sales </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:00 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:00 </td>
<td class=3D'confluenceTd'> 60 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> member1 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'>  Local/member1 at default-00000001;2 </td>
<td class=3D'confluenceTd'> SIP/frank-00000002 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/frank </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:50 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:00 </td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> 0 </td>
<td class=3D'confluenceTd'> NO ANSWER </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 3 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> Local/member2 at default-00000002;1 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> sales </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:05:00  </td>
<td class=3D'confluenceTd'> 240 </td>
<td class=3D'confluenceTd'> 180 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 4 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> member2 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'>  Local/member2 at default-00000002;2 </td>
<td class=3D'confluenceTd'> SIP/david-00000003 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/david </td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:05 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:06:00 </td>
<td class=3D'confluenceTd'> 240 </td>
<td class=3D'confluenceTd'> 235 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.3 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 5 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>Note that with non-optimizing Local channels, =
the duration of the Alice to the Local channel (which in turns passes media=
 to/from David) may not reflect the length of time that the Local channel t=
o David is in the bridge. As we'll see, additional channels joining the bri=
dge will change that CDR's durations.</td></tr></table></div>

<ul>
=09<li>Meanwhile, Bob calls Charlie.</li>
</ul>


<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Bob &lt;200&gt;" </td>
<td class=3D'confluenceTd'> 200 </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/bob-00000004 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000005 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/charlie,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:10 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:01:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 130 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424277.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 6 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424277.1 </td>
</tr>
</tbody></table>
</div>


<ul>
=09<li>David and Alice talk for a bit, but David isn't able to sell her on =
their new fantastic product, so he puts Alice on hold for a bit and calls E=
llen from engineering. Ellen agrees to be on the call, and Alice, David, an=
d Ellen are put into a three-way call.</li>
</ul>


<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "David &lt;900&gt;" </td>
<td class=3D'confluenceTd'> 900 </td>
<td class=3D'confluenceTd'> 901 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/david-00000003 </td>
<td class=3D'confluenceTd'> SIP/ellen-00000006 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/ellen,,Tt </td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:30 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:02:40 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:00 </td>
<td class=3D'confluenceTd'> 30 </td>
<td class=3D'confluenceTd'> 20 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424300.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 7 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/ellen-00000006 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> sales </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:05:00 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 8 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> member2 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> Local/member2 at default-00000002;2 </td>
<td class=3D'confluenceTd'> SIP/ellen-00000006 </td>
<td class=3D'confluenceTd'> Dial </td>
<td class=3D'confluenceTd'> SIP/david </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:00 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:05:00 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> 120 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424280.3 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 9 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>During the consultation period, David's SIP ch=
annel directly Dials Ellen's SIP device. However, when Ellen joins the brid=
ge with David, it is the Local channel to David that is in the bridge, not =
David's SIP channel. Thus, the CDR reflects the Local channel to Ellen's SI=
P channel.</td></tr></table></div>

<ul>
=09<li>Around this time, Charlie decides that he should talk to Alice as we=
ll. He transfers himself to the Sales bridge, hanging up on Bob in the proc=
ess. This turns the Sales bridge into a four-way call. The four parties tal=
k for awhile, and eventually Alice is sold on the new whiz-bang product, so=
 she hangs up. Ellen realizes she isn't need any more either, and hangs up =
as well. Charlie and David talk about the weather for awhile, and then Char=
lie hangs up, hanging up David as well.</li>
</ul>


<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> clid </th>
<th class=3D'confluenceTh'> src </th>
<th class=3D'confluenceTh'> dst </th>
<th class=3D'confluenceTh'> dcontext </th>
<th class=3D'confluenceTh'> channel </th>
<th class=3D'confluenceTh'> dstchannel </th>
<th class=3D'confluenceTh'> lastapp </th>
<th class=3D'confluenceTh'> lastdata </th>
<th class=3D'confluenceTh'> start </th>
<th class=3D'confluenceTh'> answer </th>
<th class=3D'confluenceTh'> end </th>
<th class=3D'confluenceTh'> duration </th>
<th class=3D'confluenceTh'> billsec </th>
<th class=3D'confluenceTh'> disposition </th>
<th class=3D'confluenceTh'> amaflags </th>
<th class=3D'confluenceTh'> accountcode </th>
<th class=3D'confluenceTh'> peeraccount </th>
<th class=3D'confluenceTh'> uniqueid </th>
<th class=3D'confluenceTh'> userfield </th>
<th class=3D'confluenceTh'> sequence </th>
<th class=3D'confluenceTh'> linkedid </th>
</tr>
<tr>
<td class=3D'confluenceTd'> "Alice &lt;100&gt;" </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 700 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> SIP/charlie-00000005 </td>
<td class=3D'confluenceTd'> Queue </td>
<td class=3D'confluenceTd'> sales </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:05:00 </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> 100 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 10 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Charlie &lt;300&gt;" </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> 701 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/charlie-00000005 </td>
<td class=3D'confluenceTd'> Local/member2 at default-00000002;2 </td>
<td class=3D'confluenceTd'> Bridge </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:06:00 </td>
<td class=3D'confluenceTd'> 160 </td>
<td class=3D'confluenceTd'> 160 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424278.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 11 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> "Charlie &lt;300&gt;" </td>
<td class=3D'confluenceTd'> 300 </td>
<td class=3D'confluenceTd'> 701 </td>
<td class=3D'confluenceTd'> default </td>
<td class=3D'confluenceTd'> SIP/charlie-00000005 </td>
<td class=3D'confluenceTd'> SIP/ellen-00000006 </td>
<td class=3D'confluenceTd'> Bridge </td>
<td class=3D'confluenceTd'> SIP/alice-00000000 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-4 13:03:20 </td>
<td class=3D'confluenceTd'> 2013-03-04 13:05:05 </td>
<td class=3D'confluenceTd'> 105 </td>
<td class=3D'confluenceTd'> 105 </td>
<td class=3D'confluenceTd'> ANSWERED </td>
<td class=3D'confluenceTd'> DOCUMENTATION </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> Asterisk-01-1362424278.1 </td>
<td class=3D'confluenceTd'>&nbsp;</td>
<td class=3D'confluenceTd'> 12 </td>
<td class=3D'confluenceTd'> Asterisk-01-1362424276.2 </td>
</tr>
</tbody></table>
</div>


<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>Because Charlie's channel is older then either=
 the Local channel to David's SIP channel or Ellen's SIP channel, Charlie i=
s chosen as Party A for those CDRs. Alice, on the other hand, is older than=
 Charlie, so she is Party A for that CDR. Because Alice is the oldest chann=
el, her <tt>linkedid</tt> is propagated to all CDRs in the bridge. However,=
 the CDR between Charlie and Bob is not affected, as Bob is the Party A in =
that CDR and the CDR would already have been dispatched by the time Charlie=
 joined this bridge.</td></tr></table></div>

<h1><a name=3D"Asterisk12CDRSpecification-AsteriskCDRAPIs"></a>Asterisk CDR=
 APIs</h1>

<p>The following details high level APIs that Asterisk provides for manipul=
ating CDRs.</p>

<div class=3D'panelMacro'><table class=3D'noteMacro'><colgroup><col width=
=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/images/ico=
ns/emoticons/warning.gif" width=3D"16" height=3D"16" align=3D"absmiddle" al=
t=3D"" border=3D"0"></td><td>These still describe applications/functions av=
ailable in Asterisk 11. When documentation has been updated for these appli=
cations/functions for Asterisk 12, the links will be updated appropriately.=
</td></tr></table></div>

<h2><a name=3D"Asterisk12CDRSpecification-Applications"></a>Applications</h=
2>

<h3><a name=3D"Asterisk12CDRSpecification-NoCDRAST%3AASterisk11ApplicationN=
oCDR"></a><a href=3D"/wiki/display/AST/Asterisk+11+Application_NoCDR" title=
=3D"Asterisk 11 Application_NoCDR">NoCDR</a></h3>

<p>When this application is executed on a channel, the channel is no longer=
 considered for CDRs. Any previous CDRs involving the channel will continue=
 to be updated.</p>

<h3><a name=3D"Asterisk12CDRSpecification-ForkCDRAST%3AAsterisk11Applicatio=
nForkCDR"></a><a href=3D"/wiki/display/AST/Asterisk+11+Application_ForkCDR"=
 title=3D"Asterisk 11 Application_ForkCDR">ForkCDR</a></h3>

<p>ForkCDR now does significantly less than it used to. The application wil=
l finalize the current CDR and create a new CDR for the party A channel. Th=
e new CDR record may or may not inherit properties of the previously finali=
zed CDR, based on parameters passed to the application.</p>

<h3><a name=3D"Asterisk12CDRSpecification-ResetCDRAST%3AAsterisk11Applicati=
onResetCDR"></a><a href=3D"/wiki/display/AST/Asterisk+11+Application_ResetC=
DR" title=3D"Asterisk 11 Application_ResetCDR">ResetCDR</a></h3>

<p>ResetCDR has two purposes:</p>
<ol>
=09<li>It resets the start time/answer time for the current CDR. If the cha=
nnel is answered, the start time and answer time will reflect when ResetCDR=
 was called on the channel.</li>
=09<li>Alternatively, it simply enables CDRs on a channel that previously h=
ad NoCDR executed on it.</li>
</ol>


<h2><a name=3D"Asterisk12CDRSpecification-Functions"></a>Functions</h2>

<h3><a name=3D"Asterisk12CDRSpecification-CDRAST%3AAsterisk11FunctionCDR"><=
/a><a href=3D"/wiki/display/AST/Asterisk+11+Function_CDR" title=3D"Asterisk=
 11 Function_CDR">CDR</a></h3>

<p>Retrieve or modify a field in a CDR record.</p>

<h4><a name=3D"Asterisk12CDRSpecification-Example%3ASettingthecalledpartyas=
PartyAoftheCDR"></a>Example: Setting the called party as Party A of the CDR=
</h4>

<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<pre class=3D"theme: Confluence; brush: java; gutter: false">[default]

exten =3D&gt; 100,1,NoOp()
 same =3D&gt;     n,Dial(SIP/bob,,b(default^callee_handler^1))
 same =3D&gt;     n,Hangup()

exten =3D&gt; callee_handler,1,NoOp()
 same =3D&gt;                n,Set(CDR(party_a)=3Dtrue)
 same =3D&gt;                n,Return()</pre>
</div></div>

<h2><a name=3D"Asterisk12CDRSpecification-Configuration"></a>Configuration<=
/h2>

<p>The following parameters can be configured for the CDR engine. Additiona=
l CDR backends may have their own configuration settings that are outside t=
he scope of this specification.</p>

<h3><a name=3D"Asterisk12CDRSpecification-GeneralSettings"></a>General Sett=
ings</h3>

<p>The following settings must appear in the context {{ <a href=3D"/wiki/pa=
ges/createpage.action?spaceKey=3DAST&amp;title=3Dgeneral&amp;linkCreation=
=3Dtrue&amp;fromPageId=3D22088359" class=3D"createlink">general</a> }}.</p>

<div class=3D'table-wrap'>
<table class=3D'confluenceTable'><tbody>
<tr>
<th class=3D'confluenceTh'> Name </th>
<th class=3D'confluenceTh'> Type </th>
<th class=3D'confluenceTh'> Description </th>
</tr>
<tr>
<td class=3D'confluenceTd'> enable </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Enable/disable the CDR engine </td>
</tr>
<tr>
<td class=3D'confluenceTd'> batch </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Dispatch CDRs in batches. </td>
</tr>
<tr>
<td class=3D'confluenceTd'> unanswered </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Dispatch unanswered CDRs. See <a href=3D"#Aster=
isk12CDRSpecification-cdrunanswered">Definition of Unanswered</a> for more =
information. </td>
</tr>
<tr>
<td class=3D'confluenceTd'> congestion </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Treat congestion calls as failed calls </td>
</tr>
<tr>
<td class=3D'confluenceTd'> endbeforehexten </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Finalize CDRs before the <tt>h</tt> extension o=
r hangup handlers are executed </td>
</tr>
<tr>
<td class=3D'confluenceTd'> initiatedseconds </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Count microseconds for the purposes of the <tt>=
billsec</tt> field </td>
</tr>
<tr>
<td class=3D'confluenceTd'> size </td>
<td class=3D'confluenceTd'> Integer </td>
<td class=3D'confluenceTd'> The number of records to buffer before initiati=
ng a batch </td>
</tr>
<tr>
<td class=3D'confluenceTd'> time </td>
<td class=3D'confluenceTd'> Integer </td>
<td class=3D'confluenceTd'> The time, in seconds, before initiating a batch=
 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> scheduleronly </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Deprecated. See <tt>usethreadpool</tt> instead.=
 </td>
</tr>
<tr>
<td class=3D'confluenceTd'> usethreadpool </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> 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. </td>
</tr>
<tr>
<td class=3D'confluenceTd'> safeshutdown </td>
<td class=3D'confluenceTd'> Boolean </td>
<td class=3D'confluenceTd'> Block Asterisk shutdown on dispatching of CDRs =
</td>
</tr>
</tbody></table>
</div>

    </div>
    <div id=3D"commentsSection" class=3D"wiki-content pageSection">
       <div style=3D"float: right;" class=3D"grey">
                        <a href=3D"https://wiki.asterisk.org/wiki/users/rem=
ovespacenotification.action?spaceKey=3DAST">Stop watching space</a>
            <span style=3D"padding: 0px 5px;">|</span>
                <a href=3D"https://wiki.asterisk.org/wiki/users/editmyemail=
settings.action">Change email notification preferences</a>
</div>
       <a href=3D"https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CD=
R+Specification">View Online</a>
              |
       <a href=3D"https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CD=
R+Specification?showComments=3Dtrue&amp;showCommentArea=3Dtrue#addcomment">=
Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>



More information about the asterisk-wiki-changes mailing list