Solved

Asterisk - log agents into multiple queues with one code (simultaneously)

Posted on 2011-02-15
1
1,485 Views
Last Modified: 2012-05-11
I have multiple queues in our Asterisk PBX system.  Is there a way to log the agents into/out of more than one queue at once?  Currently, an agent dials 701* to log into the main queue (701 is the queue number).  But with one code (e.g. 600*, whatever*) I want the agent to be present in multiple queues instead of logging into one, hanging up, dialing the next and logging in, etc.  Is this possible?
0
Comment
Question by:RareSeeds
1 Comment
 

Accepted Solution

by:
RareSeeds earned 0 total points
ID: 35037324
Since no one has answered, I spent the time to figure it out myself.

PHPMyAdmin was not installed by default, so I yum installed it.  This gave access to the MySQL database for ease of configuration.  I added a new column to the queues_config table called 'qgroup'.  I assigned the same number (800 in my case) to all the queues I wanted to log into with one login.

Then I created a custom dialplan in extensions_custom.conf:

exten => 801,1,Answer
exten => 801,n,Set(QEXT1=${CALLERID(number)})
exten => 801,n,MYSQL(Connect connid localhost [USERNAME] [PASSWORD] asterisk)
exten => 801,n,MYSQL(Query resultid ${connid} SELECT\ DISTINCT\ 'extension'\ FROM\ 'queues_config'\ WHERE\ 'qgroup'\ =\ '800')
exten => 801,n,MYSQL(Fetch foundRow ${resultid} id)
exten => 801,n,GotoIf($["${foundRow}" = "1"]?7:9)
exten => 801,n,AddQueueMember(${id}|Local/${QEXT1}@from-internal/n)
exten => 801,n,Goto(5)
exten => 801,n,MYSQL(Clear ${resultid})
exten => 801,n,MYSQL(Disconnect ${connid})
exten => 801,n,Playback(agent-loginok)
exten => 801,n,Hangup

exten => 802,1,Answer
exten => 802,n,Set(QEXT1=${CALLERID(number)})
exten => 802,n,MYSQL(Connect connid localhost freepbx fpbx asterisk)
exten => 802,n,MYSQL(Query resultid ${connid} SELECT\ DISTINCT\ 'extension'\ FROM\ 'queues_config'\ WHERE\ 'qgroup'\ =\ '800')
exten => 802,n,MYSQL(Fetch foundRow ${resultid} id)
exten => 802,n,GotoIf($["${foundRow}" = "1"]?7:9)
exten => 802,n,RemoveQueueMember(${id}|Local/${QEXT1}@from-internal/n)
exten => 802,n,Goto(5)
exten => 802,n,MYSQL(Clear ${resultid})
exten => 802,n,MYSQL(Disconnect ${connid})
exten => 802,n,Playback(agent-loggedoff)
exten => 802,n,Hangup

This dialplan obtains the caller's extension number, searches queues_config for all queues assigned to qgroup 800 (which I had set previously), and fires an Asterisk command, "AddQueueMember" for each queue.  Now when a user picks up the phone and dials '801', this dialplan automatically logs that extension into all queues assigned to qgroup 800.  The removal process is the same when the extension dials '802'.

I actually went a lot further and put an entry field in the FreePBX interface so that queue groups can be assigned without the need for PHPMyAdmin or other MySQL interaction.  You could actually take this a lot further, but this worked well for me.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hey there Heard about jingle, the add on for XMPP that enables point to point audio between two XMPP clients. No server config necessary. Actually quite a cool feature. However, how good is it if you can not use those voice capabilities to do a P…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question