[asterisk-dev] Problem with chan_local variables, optimization, and timing

Olle E. Johansson oej at edvina.net
Fri Jan 29 07:25:07 CST 2010


29 jan 2010 kl. 14.19 skrev Geoffrey Mina:

> Hello,
> I am not sure exactly how to trouble shoot this one, and until I have
> more detailed information I would rather not open a bug report.  I
> have a problem with channel variables created on a local channel never
> getting copied to the SIP channel after Local optimizes itself out.  I
> am running 1.4.26.1 right now.  I have checked chan_local extensively
> and don't see any work on a fix for this type of problem through
> 1.4.29, so I'm pretty sure the bug still exists.
> 
> Here is what I am doing to recreate this problem:
> 
> 1) Manager Originate Local at blah with variables set in the command
> 2) Dial(SIP/blah2,30) from the [blah] context
> 3) Call FastAGI on Answer
> 4) The FastAGI script performs some DB lookups and sets context,
> extension, priority and promptly exits.
> 5) The channel exits the FastAGI script and moves to the destination
> context/extension
> 
> At this point, none of my variables exist on the SIP channel.  "core
> show channels" shows a channel type of "Local" instead of "SIP".  It
> seems that the 'redirect' after the FastAGI may have clobbered the
> optimization process.
> 
> All I have to do to work around the bug is insert a 250ms sleep
> between step 3 and 4.  I am guessing this short pause gives the Local
> channel enough time to optimize itself out and copy all of the
> variables into the destination SIP channel.
> 
> If anyone can provide any info on how I should word this in the Bug
> Tracker, i would really appreciate it.
> 
Have you tried prefixing the variable names with two underscores?
__MYVARIABLE

With one underscore, a channel variable is inherited once. With two,
as long as there's a channel spawned, we copy the variable.

/O



More information about the asterisk-dev mailing list