[asterisk-dev] AGI:async

Daniel McFarlane daniel at szeto.ca
Tue Nov 22 09:04:58 CST 2016


Hi Salvatore,

I don't have any experience with the "Queue" command, as I basically 
pass the call directly to agi:async and control the call every step of 
the way from my C program (where I've implemented my own queue/call 
tracking).

However, here are my suggestions:

1) Upon taking a quick look at 
http://www.voip-info.org/wiki/view/Asterisk+cmd+Queue, I think your 
"failed to add agi command to channel.." error may be since the call is 
not answered yet.  You'll notice on that web page that the dial plan 
calls "Answer" before Queue in example 1, and Playback (which itself 
internally answers the call to be able to then play the announcement) 
before Queue in example 3 (I'm skipping example 2, as it's a link to a 
German site and not directly on the page).  Please try one of those 
commands, before calling your Queue command, and I think you'll get 
better results.

2) You are correct that AGI(agi:async) stops execution of the dialplan.  
In your attempt to execute AGI(agi:async) before Queue, that's exactly 
what happened.  The call entered agi:async mode and from that point on 
you are supposed to issue commands to control the call from your AGI 
program.

That's probably the reason you don't hear ringing on the phone, as (in 
your AGI call on priority 1 example) your inbound call never reached the 
"Queue" dialplan priority.

3) This is a minor detail, but I'm not sure your syntax is correct.  Try 
removing the comma before the "n", so that you have the following in 
your dial plan: "same => n,AGI(agi:async)"

Hope this helps,

Daniel



On 11/22/2016 05:03 AM, Salvatore Franco wrote:
> Hi,
> I'm trying to answer a call that is in Queue through AMI, launching 
> AGI command ANSWER.
> I read about putting AGI(agi:async) in extensions.conf dialplan but if 
> i set in this order:
>
> exten=> 1000,1,Queue(queuename)
> same=>        ,n,AGI(agi:async)
>
> and try to answer using AMI the response is : failed to add agi 
> command to channel XXX queue.
>
> Else if i set the dial plan in this order:
>
>
> exten=>1000,1,AGI(agi:async)
> same=>       ,n,Queue(queuename)
>
>  the phone doesn't ring and the command execute successful, but 
> nothing happens. Isn't agi:async "really" async but stops execution of 
> the dialplan?
>
> Any suggestions?
>
>
> Thanks
>
> Best Regards
>
> *Salvatore Franco*
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20161122/4f8ab7a8/attachment.html>


More information about the asterisk-dev mailing list