Solved

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

Posted on 2011-02-15
1
1,502 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

820 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