Re: [asterisk-users] Count Available Queue members
On Sat, Jul 18, 2009 at 11:11 AM, Gabriel Ortiz Lour wrote: > Hi all, > > Someone know how can I check for available members on a queue Before I > queue the call, so I can do something else with it? Note that is not the > case for joinempty > > Thanks, > Gabriel Ortiz > > Maybe too simple or not what you are looking for, but you can timeout people in the queue quickly and then redirect them via the dialplan. Similar to the cascading queues below, but do what you want. http://www.voip-info.org/wiki/view/Asterisk+call+queues Cascading Queues You can set up a series of queues that cascade to each other. You can get a similar effect by using the penalty feature but this can be a better way to do things for some situations (e.g. if you want to overflow calls to your receptionist into your office for when your receptionist is busy). The first thing you must do is have a timeout on our queue. This is done as a parameter of the Queue command used in extensions.conf (example: Queue(dave|t|||45)). You can then set up a number of queues and simply have your dialplan call each queue in succession. example: exten => 1589,1,Answer exten => 1589,2,Ringing exten => 1589,3,Wait(2) exten => 1589,4,Queue(testq|t|||45) exten => 1589,5,Queue(testq2|t|||45) exten => 1589,6,Hangup -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Maybe this function will help QUEUE_MEMBER_COUNTQUEUE_MEMBER_COUNT() Count number of members answering a queue This is in at least version 1.6.0.x. There are a few other related functions that can be seen by using the CLI command: core show functions like QUEUE Function names are upper case so you need to use upper case when trying to list them! -- Jim Dickenson mailto:dicken...@cfmc.com CfMC http://www.cfmc.com/ From: Steve Totaro Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion Date: Sat, 18 Jul 2009 11:17:05 -0400 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Count Available Queue members On Sat, Jul 18, 2009 at 11:11 AM, Gabriel Ortiz Lour wrote: > Hi all, > > Someone know how can I check for available members on a queue Before I queue > the call, so I can do something else with it? Note that is not the case for > joinempty > > Thanks, > Gabriel Ortiz > Maybe too simple or not what you are looking for, but you can timeout people in the queue quickly and then redirect them via the dialplan. Similar to the cascading queues below, but do what you want. http://www.voip-info.org/wiki/view/Asterisk+call+queues Cascading Queues You can set up a series of queues that cascade to each other. You can get a similar effect by using the penalty feature but this can be a better way to do things for some situations (e.g. if you want to overflow calls to your receptionist into your office for when your receptionist is busy). The first thing you must do is have a timeout on our queue. This is done as a parameter of the Queue command used in extensions.conf (example: Queue(dave|t|||45)). You can then set up a number of queues and simply have your dialplan call each queue in succession. example: exten => 1589,1,Answer exten => 1589,2,Ringing exten => 1589,3,Wait(2) exten => 1589,4,Queue(testq|t|||45) exten => 1589,5,Queue(testq2|t|||45) exten => 1589,6,Hangup -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Gabriel Ortiz Lour wrote: > Someone know how can I check for available members on a queue Before I > queue the call, so I can do something else with it? Note that is not the > case for joinempty It's going to take some sort of hack, since there appears to be no dialplan app to do this succinctly. One option is to call an AGI script that in turn runs: asterisk -rx 'queue show your-queue-name' | egrep 'SIP\/.+ \(Not in use\)' | wc -l It can set a channel variable and you can then evaluate its value in the dial plan with GotoIf(). Another, more sophisticated option is to have a piece of middleware that keeps track of when agents are connected to a caller via listening to the Asterisk manager interface, or by reading the queue log. It can then be queried via FastAGI. Really, there should be a dialplan app for this. Feature request? -- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
> Gabriel Ortiz Lour wrote: >> Someone know how can I check for available members on a queue Before >> I queue the call, so I can do something else with it? Note that is not >> the case for joinempty On Sat, 18 Jul 2009, Alex Balashov wrote: > It's going to take some sort of hack, since there appears to be no > dialplan app to do this succinctly. > > One option is to call an AGI script that in turn runs: > >asterisk -rx 'queue show your-queue-name' | >egrep 'SIP\/.+ \(Not in use\)' | wc -l > You could reduce the number of process creations from 4 (AGI, asterisk -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
On Sat, Jul 18, 2009 at 12:57 PM, Steve Edwards wrote: > > Gabriel Ortiz Lour wrote: > > >> Someone know how can I check for available members on a queue Before > >> I queue the call, so I can do something else with it? Note that is not > >> the case for joinempty > > On Sat, 18 Jul 2009, Alex Balashov wrote: > > > It's going to take some sort of hack, since there appears to be no > > dialplan app to do this succinctly. > > > > One option is to call an AGI script that in turn runs: > > > >asterisk -rx 'queue show your-queue-name' | > >egrep 'SIP\/.+ \(Not in use\)' | wc -l > > > > You could reduce the number of process creations from 4 (AGI, asterisk > -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. > > -- > Thanks in advance, > - > Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST > Newline Fax: +1-760-731-3000 > > *QueueMemberStatus* (may generate a WHOLE LOT of extra manager events) Scary! -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
On Saturday 18 July 2009 11:57:32 Steve Edwards wrote: > > Gabriel Ortiz Lour wrote: > >> Someone know how can I check for available members on a queue Before > >> I queue the call, so I can do something else with it? Note that is not > >> the case for joinempty > > On Sat, 18 Jul 2009, Alex Balashov wrote: > > It's going to take some sort of hack, since there appears to be no > > dialplan app to do this succinctly. > > > > One option is to call an AGI script that in turn runs: > > > >asterisk -rx 'queue show your-queue-name' | > >egrep 'SIP\/.+ \(Not in use\)' | wc -l > > You could reduce the number of process creations from 4 (AGI, asterisk > -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. Or he could just use the builtin dialplan function: ${QUEUE_MEMBER_COUNT(myqueue)} -- Tilghman & Teryl with Peter, Cottontail, Midnight, Thumper, & Johnny (bunnies) and Harry, BB, & George (dogs) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
On Sat, Jul 18, 2009 at 1:50 PM, Tilghman Lesher < tilgh...@mail.jeffandtilghman.com> wrote: > On Saturday 18 July 2009 11:57:32 Steve Edwards wrote: > > > Gabriel Ortiz Lour wrote: > > >> Someone know how can I check for available members on a queue Before > > >> I queue the call, so I can do something else with it? Note that is not > > >> the case for joinempty > > > > On Sat, 18 Jul 2009, Alex Balashov wrote: > > > It's going to take some sort of hack, since there appears to be no > > > dialplan app to do this succinctly. > > > > > > One option is to call an AGI script that in turn runs: > > > > > >asterisk -rx 'queue show your-queue-name' | > > >egrep 'SIP\/.+ \(Not in use\)' | wc -l > > > > You could reduce the number of process creations from 4 (AGI, asterisk > > -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. > > Or he could just use the builtin dialplan function: > ${QUEUE_MEMBER_COUNT(myqueue)} > > -- > Tilghman & Teryl > with Peter, Cottontail, Midnight, Thumper, & Johnny (bunnies) > and Harry, BB, & George (dogs) > I don't think that answers OP's question. "Someone know how can I check for available members on a queue Before I queue the call, so I can do something else with it? Note that is not the case for joinempty" My understanding of QUEUE_MEMBER_COUNT just give a total of "agents" in the queue. Synopsis Count number of members answering a queue -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Assuming that connecting to the socket and authenticating and getting the data is really less latent and resource-intensive. But that's just splitting hairs. -- Sent from mobile device On Jul 18, 2009, at 12:57 PM, Steve Edwards wrote: >> Gabriel Ortiz Lour wrote: > >>> Someone know how can I check for available members on a queue >>> Before >>> I queue the call, so I can do something else with it? Note that is >>> not >>> the case for joinempty > > On Sat, 18 Jul 2009, Alex Balashov wrote: > >> It's going to take some sort of hack, since there appears to be no >> dialplan app to do this succinctly. >> >> One option is to call an AGI script that in turn runs: >> >> asterisk -rx 'queue show your-queue-name' | >> egrep 'SIP\/.+ \(Not in use\)' | wc -l >> > > You could reduce the number of process creations from 4 (AGI, asterisk > -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. > > -- > Thanks in advance, > --- > -- > Steve Edwards sedwa...@sedwards.com Voice: > +1-760-468-3867 PST > Newline Fax: +1-760-731-3000 > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Assuming he just wants people routed somewhere else if a queue if full, then my original fast queue timeout answer is the simplest. Just continue on in the dialplan. I hope OP posts again with his/her solution. Thanks, Steve T On Sat, Jul 18, 2009 at 3:18 PM, Alex Balashov wrote: > Assuming that connecting to the socket and authenticating and getting > the data is really less latent and resource-intensive. But that's > just splitting hairs. > > -- > Sent from mobile device > > On Jul 18, 2009, at 12:57 PM, Steve Edwards > wrote: > > >> Gabriel Ortiz Lour wrote: > > > >>> Someone know how can I check for available members on a queue > >>> Before > >>> I queue the call, so I can do something else with it? Note that is > >>> not > >>> the case for joinempty > > > > On Sat, 18 Jul 2009, Alex Balashov wrote: > > > >> It's going to take some sort of hack, since there appears to be no > >> dialplan app to do this succinctly. > >> > >> One option is to call an AGI script that in turn runs: > >> > >> asterisk -rx 'queue show your-queue-name' | > >> egrep 'SIP\/.+ \(Not in use\)' | wc -l > >> > > > > You could reduce the number of process creations from 4 (AGI, asterisk > > -rx, egrep, wc) to 1 (AGI) by using AMI in the AGI. > > > > -- > > Thanks in advance, > > --- > > -- > > Steve Edwards sedwa...@sedwards.com Voice: > > +1-760-468-3867 PST > > Newline Fax: +1-760-731-3000 > > > > ___ > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
On Saturday 18 July 2009 13:09:27 Steve Totaro wrote: > On Sat, Jul 18, 2009 at 1:50 PM, Tilghman Lesher wrote: > > On Saturday 18 July 2009 11:57:32 Steve Edwards wrote: > > > > Gabriel Ortiz Lour wrote: > > > >> Someone know how can I check for available members on a queue > > > >> Before I queue the call, so I can do something else with it? Note > > > >> that is not the case for joinempty > > > > > Or he could just use the builtin dialplan function: > > ${QUEUE_MEMBER_COUNT(myqueue)} > > I don't think that answers OP's question. "Someone know how can I check > for available members on a queue Before I queue the call, so I can do > something else with it? Note that is not the case for joinempty" > > My understanding of QUEUE_MEMBER_COUNT just give a total of "agents" in the > queue. > > Synopsis Count number of members answering a queue It may or may not be the answer to the OP's question, depending upon what he meant by "available". Without clarification, it's impossible to know. -- Tilghman & Teryl with Peter, Cottontail, Midnight, Thumper, & Johnny (bunnies) and Harry, BB, & George (dogs) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
On Sat, Jul 18, 2009 at 9:42 PM, Tilghman Lesher < tilgh...@mail.jeffandtilghman.com> wrote: > On Saturday 18 July 2009 13:09:27 Steve Totaro wrote: > > On Sat, Jul 18, 2009 at 1:50 PM, Tilghman Lesher wrote: > > > On Saturday 18 July 2009 11:57:32 Steve Edwards wrote: > > > > > Gabriel Ortiz Lour wrote: > > > > >> Someone know how can I check for available members on a queue > > > > >> Before I queue the call, so I can do something else with it? Note > > > > >> that is not the case for joinempty > > > > > > > Or he could just use the builtin dialplan function: > > > ${QUEUE_MEMBER_COUNT(myqueue)} > > > > I don't think that answers OP's question. "Someone know how can I check > > for available members on a queue Before I queue the call, so I can do > > something else with it? Note that is not the case for joinempty" > > > > My understanding of QUEUE_MEMBER_COUNT just give a total of "agents" in > the > > queue. > > > > Synopsis Count number of members answering a queue > > It may or may not be the answer to the OP's question, depending upon what > he > meant by "available". Without clarification, it's impossible to know. > > -- > Tilghman & Teryl > with Peter, Cottontail, Midnight, Thumper, & Johnny (bunnies) > and Harry, BB, & George (dogs) > > OK, I can admit when I am wrong. -- Thanks, Steve Totaro +18887771888 (Toll Free) +12409381212 (Cell) +12024369784 (Skype) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Tilghman Lesher wrote: >> My understanding of QUEUE_MEMBER_COUNT just give a total of "agents" in the >> queue. >> >> Synopsis Count number of members answering a queue > > It may or may not be the answer to the OP's question, depending upon what he > meant by "available". Without clarification, it's impossible to know. And along with this, even if it just returns the total number of queue members available, that could be useful if you're calling via something like a Local channel, where you could use the GROUP() and GROUP_COUNT() functions. Place a GROUP() in the Local channel prior to calling the member, and then you can do: exten => start,n,Set(MEMBERS_TO_TAKE_CALLS=$[${GROUP_COUNT(agents)} - ${QUEUE_MEMBER_COUNT(queue)}]) Something like that anyways. Leif Madsen. http://www.leifmadsen.com http://www.oreilly.com/catalog/asterisk ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Hi all, Thanks for all the advices given here, but I for what i've found is: - cant be done with GROUP+GROUP_COUNT+QUEUE_MEMBER_COUNT because it wouldn't know about the paused members. - cant be done with the quick queue timeout: it works, but I dont want the call to get counted for another queued call (maybe I could ignore this calls later on a report, but i dont like this idea to leave to the report to do it) - the AGI calling either AMI or a shell script is the easiest solution, but I wonder about the proc/resource consuming. (I've had problems using too much of "asterisk -rx ..." on scripts, leaving 'zombie' asterisk -rx processes lying around... And the AMI QueueStatus really gives lots of info) Since the Asterisk I'm using already have a lot of patches for tiny features that I needed I started to code a variant of the QUEUE_MEMBER_COUNT called QUEUE_MEMBER_COUNT_AVAILABLE, so as soon as its finished I could post it here Thanks a LOT for the storm of ideas, Gabriel Ortiz 2009/7/20 Leif Madsen > Tilghman Lesher wrote: > >> My understanding of QUEUE_MEMBER_COUNT just give a total of "agents" in > the > >> queue. > >> > >> Synopsis Count number of members answering a queue > > > > It may or may not be the answer to the OP's question, depending upon what > he > > meant by "available". Without clarification, it's impossible to know. > > And along with this, even if it just returns the total number of queue > members > available, that could be useful if you're calling via something like a > Local > channel, where you could use the GROUP() and GROUP_COUNT() functions. > > Place a GROUP() in the Local channel prior to calling the member, and then > you > can do: > > exten => start,n,Set(MEMBERS_TO_TAKE_CALLS=$[${GROUP_COUNT(agents)} - > ${QUEUE_MEMBER_COUNT(queue)}]) > > Something like that anyways. > > Leif Madsen. > http://www.leifmadsen.com > http://www.oreilly.com/catalog/asterisk > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Gabriel Ortiz Lour escribió: Gabriel Ortiz Lour wrote: > > >> Someone know how can I check for available members on a queue Before > > >> I queue the call, so I can do something else with it? Note that is not > > >> the case for joinempty > > - the AGI calling either AMI or a shell script is the easiest > solution, but I wonder about the proc/resource consuming. (I've had > problems using too much of "asterisk -rx ..." on scripts, leaving > 'zombie' asterisk -rx processes lying around... And the AMI > QueueStatus really gives lots of info) If you choose an AMI solution, you could take a look to the QueueSummary action and QueueSummary events (1.6). That events give you the info you need without having to issue and parse the QueueStatus info. This events were extremely useful for me, so I decided to backport them from 1.6 to 1.4. They work like a charm. If you want to give the patch a try, just let me know with the asterisk version you use. -- Ing. Miguel Molina Grupo de Tecnología Millenium Phone Center ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Count Available Queue members
Miguel, That sound pretty good, sure I would like your patch. I'm using asterisk 1.4.19, but if your patch is for another version just give me the closest you got that will be fine. Thanks, Gabriel 2009/7/21 Miguel Molina > Gabriel Ortiz Lour escribió: > > Gabriel Ortiz Lour wrote: > > > > >> Someone know how can I check for available members on a queue > Before > > > >> I queue the call, so I can do something else with it? Note that is > not > > > >> the case for joinempty > > > > - the AGI calling either AMI or a shell script is the easiest > > solution, but I wonder about the proc/resource consuming. (I've had > > problems using too much of "asterisk -rx ..." on scripts, leaving > > 'zombie' asterisk -rx processes lying around... And the AMI > > QueueStatus really gives lots of info) > If you choose an AMI solution, you could take a look to the QueueSummary > action and QueueSummary events (1.6). That events give you the info you > need without having to issue and parse the QueueStatus info. This events > were extremely useful for me, so I decided to backport them from 1.6 to > 1.4. They work like a charm. If you want to give the patch a try, just > let me know with the asterisk version you use. > > -- > Ing. Miguel Molina > Grupo de Tecnología > Millenium Phone Center > > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users