<div class="gmail_quote">On Thu, Mar 29, 2012 at 10:10 AM, Steve Edwards <span dir="ltr"><<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>></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 => *9,peer/both,AGI,/etc/<u></u>asterisk/agi/<a href="http://map.pl" target="_blank">map.pl</a><br>
</blockquote>
<br></div>
I've never invoked an AGI from 'features,' but I'll assume it's 'the same' as executing an AGI from the dialplan.</blockquote><div><br>Neither have I. I'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's hung up, including the execution of the *9 feature code. Also, knowing which version of Asterisk and DAHDI we're dealing with here couldn'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 'fails' 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's STDIN and STDOUT 'belong' 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 "wrong", not the script'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>