[asterisk-dev] CDR variables

Tilghman Lesher tlesher at digium.com
Sat Nov 21 08:35:12 CST 2009


On Saturday 21 November 2009 04:26:00 Olle E. Johansson wrote:
> I was looking into adding the RTPAUDIOQOS variables directly to the cdr's
> from chan_sip as a cdr variable. I notice that there are no other modules
> that does add cdr variables directly.
>
> Is this because developers hasn't noticed this feature or because it will
> fail miserably and cause disruptions in the Asterisk space/time
> relationship?

I think this would be in danger of colliding with namespace that existing
administrators have set up.  Certainly this would need a clear warning in
UPGRADE.txt.

> If this works, is it safe to add variables to the cdr as long as I have an
> AST_CHANNEL available? We have two closures of cdr - after or before "h"
> processing - but when will the CDR be stored - at destruction of the
> ast_channel or when we freeze it?

It's safe, as long as you use the published API of ast_cdr_setvar().  This
correctly deals with the cases when a CDR has already been locked from
further changes.

CDR is stored at a point following its detachment from the channel.  This
event could occur at any point in time after that, considering that Asterisk
can be configured for CDR batching and error recovery.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list