Solved

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

Posted on 2011-02-15
1
1,459 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PBX digital voice and VoIP 4 69
Simplest RTP QoS for Ethernet WAN Cisco 2 43
Implementing Cisco Jabber 1 71
Shared number solutions 1 54
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.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
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…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now