The way chan_local decides when to optimize itself out is very nondeterministic, (based on incoming frames and the ability to get locks), and has caused me plenty of problems in the past with whether or not certain parts of the dialplan are executed on Local or real channels and what channel variables will be available.. What I sometimes do is use the G option to dial to throw away the local channel on purpose, but that only makes sense in certain circumstances. <br>
<br><div class="gmail_quote">On Fri, Jan 29, 2010 at 8:29 AM, Geoffrey Mina <span dir="ltr"><<a href="mailto:geoffreymina@gmail.com">geoffreymina@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That doesn't really answer the question as to why a 250ms pause in my<br>
FastAGI script provides a 'fix' to the problem. The pause would lead<br>
me to believe that there is a timing bug in the Local channel<br>
optimizing itself out of the chain.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Fri, Jan 29, 2010 at 8:25 AM, Olle E. Johansson <<a href="mailto:oej@edvina.net">oej@edvina.net</a>> wrote:<br>
><br>
> 29 jan 2010 kl. 14.19 skrev Geoffrey Mina:<br>
><br>
>> Hello,<br>
>> I am not sure exactly how to trouble shoot this one, and until I have<br>
>> more detailed information I would rather not open a bug report. I<br>
>> have a problem with channel variables created on a local channel never<br>
>> getting copied to the SIP channel after Local optimizes itself out. I<br>
>> am running 1.4.26.1 right now. I have checked chan_local extensively<br>
>> and don't see any work on a fix for this type of problem through<br>
>> 1.4.29, so I'm pretty sure the bug still exists.<br>
>><br>
>> Here is what I am doing to recreate this problem:<br>
>><br>
>> 1) Manager Originate Local@blah with variables set in the command<br>
>> 2) Dial(SIP/blah2,30) from the [blah] context<br>
>> 3) Call FastAGI on Answer<br>
>> 4) The FastAGI script performs some DB lookups and sets context,<br>
>> extension, priority and promptly exits.<br>
>> 5) The channel exits the FastAGI script and moves to the destination<br>
>> context/extension<br>
>><br>
>> At this point, none of my variables exist on the SIP channel. "core<br>
>> show channels" shows a channel type of "Local" instead of "SIP". It<br>
>> seems that the 'redirect' after the FastAGI may have clobbered the<br>
>> optimization process.<br>
>><br>
>> All I have to do to work around the bug is insert a 250ms sleep<br>
>> between step 3 and 4. I am guessing this short pause gives the Local<br>
>> channel enough time to optimize itself out and copy all of the<br>
>> variables into the destination SIP channel.<br>
>><br>
>> If anyone can provide any info on how I should word this in the Bug<br>
>> Tracker, i would really appreciate it.<br>
>><br>
> Have you tried prefixing the variable names with two underscores?<br>
> __MYVARIABLE<br>
><br>
> With one underscore, a channel variable is inherited once. With two,<br>
> as long as there's a channel spawned, we copy the variable.<br>
><br>
> /O<br>
><br>
> --<br>
> _____________________________________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> asterisk-dev mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</div></div></blockquote></div><br>