Solved

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

Posted on 2011-02-15
1
1,555 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
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, fr…

691 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