<div class="gmail_quote">On Thu, Mar 29, 2012 at 10:10 AM, Steve Edwards <span dir="ltr">&lt;<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, 29 Mar 2012, Mikhail Lischuk wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have the following line in features.conf:<br>
parse =&gt; *9,peer/both,AGI,/etc/<u></u>asterisk/agi/<a href="http://map.pl" target="_blank">map.pl</a><br>
</blockquote>
<br></div>
I&#39;ve never invoked an AGI from &#39;features,&#39; but I&#39;ll assume it&#39;s &#39;the same&#39; as executing an AGI from the dialplan.</blockquote><div><br>Neither have I.  I&#39;d be really curious to see the entire CLI log of the call, with verbose set to 6 and AGI debug enabled, from when the call first comes in to when it&#39;s hung up, including the execution of the *9 feature code.  Also, knowing which version of Asterisk and DAHDI we&#39;re dealing with here couldn&#39;t hurt<br>
<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
During outgoing call, those variables get messed up.<br>
</blockquote>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is that some bug, or misconfiguration, or maybe wrong programming?<br>
</blockquote>
<br></div>
Usual &#39;fails&#39; in AGIs are:<br>
<br>
1) Not using an established AGI library. While the AGI protocol is simple, nobody gets it right the first time.<br>
<br>
2) Forgetting that your AGI&#39;s STDIN and STDOUT &#39;belong&#39; to Asterisk and printing a debugging message or something similar.<br>
<br>
3) Not reading the AGI environment from STDIN before requesting an AGI command.<br clear="all"><br></blockquote><div><br>While I would normally completely agree with you on this, he showed in his original example the AGI environment that is being sent to the script is what is &quot;wrong&quot;, not the script&#39;s handling of said environment.  To be more specific, the <span>agi_callerid: and the </span><span>agi_dnid: variables appear to have incorrect values for an outbound call.</span><span>  My guess would be that this has to do with calling the AGI from a features.conf feature code, and not </span>from within dialplan itself.  <br>
<br>To the OP - just trying to think outside the box here, but what if instead of calling the AGI directly from the features.conf feature code, you wrote a Macro or GoSub that you could then use as your application, and within the Macro / GoSub you executed your AGI?<br>
 </div></div><br>-- <br>Thanks,<br>--Warren Selby, dCAP<br><a href="http://www.selbytech.com" target="_blank">http://www.SelbyTech.com</a><br><br>