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">&lt;<a href="mailto:geoffreymina@gmail.com">geoffreymina@gmail.com</a>&gt;</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&#39;t really answer the question as to why a 250ms pause in my<br>
FastAGI script provides a &#39;fix&#39; 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 &lt;<a href="mailto:oej@edvina.net">oej@edvina.net</a>&gt; wrote:<br>
&gt;<br>
&gt; 29 jan 2010 kl. 14.19 skrev Geoffrey Mina:<br>
&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt; I am not sure exactly how to trouble shoot this one, and until I have<br>
&gt;&gt; more detailed information I would rather not open a bug report.  I<br>
&gt;&gt; have a problem with channel variables created on a local channel never<br>
&gt;&gt; getting copied to the SIP channel after Local optimizes itself out.  I<br>
&gt;&gt; am running 1.4.26.1 right now.  I have checked chan_local extensively<br>
&gt;&gt; and don&#39;t see any work on a fix for this type of problem through<br>
&gt;&gt; 1.4.29, so I&#39;m pretty sure the bug still exists.<br>
&gt;&gt;<br>
&gt;&gt; Here is what I am doing to recreate this problem:<br>
&gt;&gt;<br>
&gt;&gt; 1) Manager Originate Local@blah with variables set in the command<br>
&gt;&gt; 2) Dial(SIP/blah2,30) from the [blah] context<br>
&gt;&gt; 3) Call FastAGI on Answer<br>
&gt;&gt; 4) The FastAGI script performs some DB lookups and sets context,<br>
&gt;&gt; extension, priority and promptly exits.<br>
&gt;&gt; 5) The channel exits the FastAGI script and moves to the destination<br>
&gt;&gt; context/extension<br>
&gt;&gt;<br>
&gt;&gt; At this point, none of my variables exist on the SIP channel.  &quot;core<br>
&gt;&gt; show channels&quot; shows a channel type of &quot;Local&quot; instead of &quot;SIP&quot;.  It<br>
&gt;&gt; seems that the &#39;redirect&#39; after the FastAGI may have clobbered the<br>
&gt;&gt; optimization process.<br>
&gt;&gt;<br>
&gt;&gt; All I have to do to work around the bug is insert a 250ms sleep<br>
&gt;&gt; between step 3 and 4.  I am guessing this short pause gives the Local<br>
&gt;&gt; channel enough time to optimize itself out and copy all of the<br>
&gt;&gt; variables into the destination SIP channel.<br>
&gt;&gt;<br>
&gt;&gt; If anyone can provide any info on how I should word this in the Bug<br>
&gt;&gt; Tracker, i would really appreciate it.<br>
&gt;&gt;<br>
&gt; Have you tried prefixing the variable names with two underscores?<br>
&gt; __MYVARIABLE<br>
&gt;<br>
&gt; With one underscore, a channel variable is inherited once. With two,<br>
&gt; as long as there&#39;s a channel spawned, we copy the variable.<br>
&gt;<br>
&gt; /O<br>
&gt;<br>
&gt; --<br>
&gt; _____________________________________________________________________<br>
&gt; -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
&gt;<br>
&gt; asterisk-dev mailing list<br>
&gt; To UNSUBSCRIBE or update options visit:<br>
&gt;   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
&gt;<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>