Re: [asterisk-dev] AGI:async
On Fri, Nov 25, 2016 at 10:14 AM, Salvatore Francowrote: > Hi, > It means that the call still waiting something but never enter in Queue > (as if async is not really async). > So I think the dialplan never calls the next step. > You seem to misunderstand what AGI actually is. AGI _is_ dialplan. What you can do in dialplan is what you can do in AGI. The call will stay in your AGI until you tell it continue in normal dialplan or the call hangs up. AGI simply allows you to write your dialplan in a scripting language more familiar to you. Depending upon your scripting language, AGI also allows you better access to things outside of Asterisk such as querying databases. Async AGI is a very specialized flavor of the three AGI modes available as it merges AGI into AMI. However it is still AGI. Your earlier emails in this chain indicate that app_queue does not do what you seem to want from an automatic call distribution system. In that case you can modify app_queue, write your own app_queue in C, or you can use ARI. ARI is available in the currently supported Asterisk v13 and later versions. ARI gives you access to the building blocks normally available to dialplan applications so you can write your own applications such as queue and voicemail. Richard [1] https://wiki.asterisk.org/wiki/display/AST/Interfaces [2] https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573 (ARI interface page) -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] AGI:async
Hi, It means that the call still waiting something but never enter in Queue (as if async is not really async). So I think the dialplan never calls the next step. Thanks Regards Salvatore Franco Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Sat, 26 Nov 2016 00:05:32 +0800 Oggetto: Re: [asterisk-dev] AGI:async This might be a question more suited at asterisk-users. I believe the 2nd example is what should work but I don't know what you exactly mean by "nothing happens". On Tue, Nov 22, 2016 at 6:03 PM, Salvatore Franco <s.fra...@fast-auto.it> 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] AGI:async
This might be a question more suited at asterisk-users. I believe the 2nd example is what should work but I don't know what you exactly mean by "nothing happens". On Tue, Nov 22, 2016 at 6:03 PM, Salvatore Francowrote: > 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* > > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-dev mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-dev > -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] AGI:async
Hi Salvatore, Be careful with SIP softphones. I've seen them do weird stuff with AMI commands (i.e.: Commands received are messed up/cut-out in parts), especially when it comes to DTMFs. I've found SFLphone (not Ring) to work the best, but even it had issues. In the end I opted for Digium cards (analog and PRI work best) and hardware SIP devices. Sorry, I don't really have any experience using queues and even less with ARI (like I said, I went pure AMI from a C-application and I've never tried controlling/handling a call via a web interface). I learnt a few queue dialplan concepts years ago, but don't recall the details. In all of this you didn't mention how you were trying to answer the calls. Have you used the AddQueueMember application (with no members defined in queues.conf, as specified within the "Return codes" section of http://www.voip-info.org/wiki/view/Asterisk+cmd+Queue) to add someone with whom to receive/answer calls? If not, that might be something to read up on.. To answer your question, I imagine either you need to use Asterisk queue's or write your own queue. I mean, there has to be some way of tracking all the calls and allowing you to select one to deal with at a time. Here's a tutorial on queues which I came across. Maybe you could try following along with it and see if it helps you progress with queues: http://www.orderlyq.com/asterisk-queues-tutorial/ Hope this helps, Daniel On 11/23/2016 03:24 AM, Salvatore Franco wrote: Hi Daniel, the Queue works well if I use a SIP Client (Zoiper) but if I try to answer using AMI i receive that error :( ARI command ANSWER only works if I use it on a single channel, the queue is a strange application that cannot be in Stasis directly. Is writing my own queue the only way to handle calls via http in queue? Thanks Regards *Salvatore Franco* Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 12:33:38 -0500 Oggetto: Re: [asterisk-dev] AGI:async Hi, Unfortunately, I wish I had a simple queue to share but my implementation is quite complex due to how I control the call on a per-operation basis. If you choose this route then perhaps you can use store your channel/queue name(s) within simple storage elements such as a stack, array, or even a hashtable (although the last may not be ideal for retrieving calls in order) and then use AMI to control the calls from there. Sorry I can't be more helpful in providing you an example. I imagine Asterisk queue's work though, so perhaps it might be worth your while to pursue that approach a bit more (unfortunately I've never tried them, so I can't tell you how it's done!). That being said, perhaps getting Asterisk Queue's going will require a more step-by-step approach to figure out why it's not working for you. Here are my suggestions: Have you tried the exact dialplans in the examples within http://www.voip-info.org/wiki/view/Asterisk+cmd+Queue ? i.e.: Have you been able to get Asterisk queue's working without AMI? If not, that might be where to start and then add AMI in afterward.. Another suggestion I have is to use the QueueAdd AMI command, rather then calling Queue within your dialplan. If you have success on doing something like an Answer/Playback via AMI, then you will probably have no issues with the QueueAdd AMI command. Please try that and maybe you'll have more luck. Here's the API reference: http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+QueueAdd Hope this helps & good luck, Daniel On 11/22/2016 10:35 AM, Salvatore Franco wrote: Hi, Thanks for your suggestions. The comma was an error in my email, not in my dialplan. Even if i use Answer command before Queue i received the same error back, so i think the best way is to have my own queue. Have you got any example of how to implement a simple queue that use the "fewestcalls" strategy? Best Regards Salvatore Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 10:04:58 -0500 Oggetto: Re: [asterisk-dev] AGI:async 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 exa
Re: [asterisk-dev] AGI:async
Hi Daniel, the Queue works well if I use a SIP Client (Zoiper) but if I try to answer using AMI i receive that error :( ARI command ANSWER only works if I use it on a single channel, the queue is a strange application that cannot be in Stasis directly. Is writing my own queue the only way to handle calls via http in queue? Thanks Regards Salvatore Franco Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 12:33:38 -0500 Oggetto: Re: [asterisk-dev] AGI:async Hi, Unfortunately, I wish I had a simple queue to share but my implementation is quite complex due to how I control the call on a per-operation basis. If you choose this route then perhaps you can use store your channel/queue name(s) within simple storage elements such as a stack, array, or even a hashtable (although the last may not be ideal for retrieving calls in order) and then use AMI to control the calls from there. Sorry I can't be more helpful in providing you an example. I imagine Asterisk queue's work though, so perhaps it might be worth your while to pursue that approach a bit more (unfortunately I've never tried them, so I can't tell you how it's done!). That being said, perhaps getting Asterisk Queue's going will require a more step-by-step approach to figure out why it's not working for you. Here are my suggestions: Have you tried the exact dialplans in the examples within http://www.voip-info.org/wiki/view/Asterisk+cmd+Queue ? i.e.: Have you been able to get Asterisk queue's working without AMI? If not, that might be where to start and then add AMI in afterward.. Another suggestion I have is to use the QueueAdd AMI command, rather then calling Queue within your dialplan. If you have success on doing something like an Answer/Playback via AMI, then you will probably have no issues with the QueueAdd AMI command. Please try that and maybe you'll have more luck. Here's the API reference: http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+QueueAdd Hope this helps & good luck, Daniel On 11/22/2016 10:35 AM, Salvatore Franco wrote: Hi, Thanks for your suggestions. The comma was an error in my email, not in my dialplan. Even if i use Answer command before Queue i received the same error back, so i think the best way is to have my own queue. Have you got any example of how to implement a simple queue that use the "fewestcalls" strategy? Best Regards Salvatore Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 10:04:58 -0500 Oggetto: Re: [asterisk-dev] AGI:async 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 r
Re: [asterisk-dev] AGI:async
Hi, Unfortunately, I wish I had a simple queue to share but my implementation is quite complex due to how I control the call on a per-operation basis. If you choose this route then perhaps you can use store your channel/queue name(s) within simple storage elements such as a stack, array, or even a hashtable (although the last may not be ideal for retrieving calls in order) and then use AMI to control the calls from there. Sorry I can't be more helpful in providing you an example. I imagine Asterisk queue's work though, so perhaps it might be worth your while to pursue that approach a bit more (unfortunately I've never tried them, so I can't tell you how it's done!). That being said, perhaps getting Asterisk Queue's going will require a more step-by-step approach to figure out why it's not working for you. Here are my suggestions: Have you tried the exact dialplans in the examples within http://www.voip-info.org/wiki/view/Asterisk+cmd+Queue ? i.e.: Have you been able to get Asterisk queue's working without AMI? If not, that might be where to start and then add AMI in afterward.. Another suggestion I have is to use the QueueAdd AMI command, rather then calling Queue within your dialplan. If you have success on doing something like an Answer/Playback via AMI, then you will probably have no issues with the QueueAdd AMI command. Please try that and maybe you'll have more luck. Here's the API reference: http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+QueueAdd Hope this helps & good luck, Daniel On 11/22/2016 10:35 AM, Salvatore Franco wrote: Hi, Thanks for your suggestions. The comma was an error in my email, not in my dialplan. Even if i use Answer command before Queue i received the same error back, so i think the best way is to have my own queue. Have you got any example of how to implement a simple queue that use the "fewestcalls" strategy? Best Regards Salvatore Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 10:04:58 -0500 Oggetto: Re: [asterisk-dev] AGI:async 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* -- Daniel McFarlane Szeto Technologies Inc. 885 Ellingham Ave Pointe Claire, Québec Canada, H9R 5E8 tel: (514) 630-7878 fax: (514) 630-6394 http://www.szeto.ca -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] AGI:async
Hi, Thanks for your suggestions. The comma was an error in my email, not in my dialplan. Even if i use Answer command before Queue i received the same error back, so i think the best way is to have my own queue. Have you got any example of how to implement a simple queue that use the "fewestcalls" strategy? Best Regards Salvatore Da: asterisk-dev-boun...@lists.digium.com A: "Asterisk Developers Mailing List" asterisk-dev@lists.digium.com Cc: Data: Tue, 22 Nov 2016 10:04:58 -0500 Oggetto: Re: [asterisk-dev] AGI:async 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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] AGI:async
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* -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
[asterisk-dev] AGI:async
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 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev