[asterisk-dev] Violent Objections? CDR dst/dcontext probs in 1.4+ when a macro is involved.

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Jun 28 13:32:49 CDT 2007

On Thursday 28 June 2007 12:28, Steve Murphy wrote:
> May I do this? Any violent objections?

I violently object.  The CDRs are supposed to reflect exactly certain
channel settings.  When you make a change in the channel, the CDR is
thus updated.  While we have created the ability for you to have
arbitrary CDR variables, the core information should remain unaltered,
more for sanity's sake (i.e. you might change something in the CDR, then
the channel is altered, and your change to the CDR is overwritten with
new channel information) than for any other reason.  We do NOT want to
go down this route, which will then create the need to "protect" CDR
variables which have been altered by the CDR() dialplan function (and
"unprotect" them in certain circumstances, etc.)  This is likely to get
messy, whereas prohibiting their change (current behavior) is simple
and clean.

I would strongly suggest that you use the following logic in the Macro:
exten => s,1,Goto(${MACRO_EXTEN},1)
exten => _NXX-XXXX,1,Whatever()

This will ensure that you get the dst that you desired to have in your
CDR, should the call end while the Macro is executing.

Over the long haul, Macro will be going away completely, which will
resolve this little nastiness anyway.


More information about the asterisk-dev mailing list