System information
Shaw and Danielle Roberts in the sales queue so Kay Madsen is preferred, and penalize
James Shaw and Kay Madsen in the billing queue so Danielle Roberts is preferred.
Penalizing queue members can be done either in the queues.conf file, if you’re specifying
queue members statically, or through the AddQueueMember() dialplan application. Let’s
look at how our queues would be set up with static members in queues.conf. We’ll be
using the StandardQueue template we defined earlier in this chapter:
[support](StandardQueue)
member => SIP/0000FFFF0001,0,James Shaw ; preferred
member => SIP/0000FFFF0002,10,Kay Madsen ; second preferred
member => SIP/0000FFFF0003,20,Danielle Roberts ; least preferred
[sales](StandardQueue)
member => SIP/0000FFFF0002,0,Kay Madsen
member => SIP/0000FFFF0003,10,Danielle Roberts
member => SIP/0000FFFF0001,20,James Shaw
[billing](StandardQueue)
member => SIP/0000FFFF0003,0,Danielle Roberts
member => SIP/0000FFFF0001,10,James Shaw
member => SIP/0000FFFF0002,20,Kay Madsen
By defining different penalties for each member of the queue, we can help control the
preference for where callers are delivered, but still ensure that other queue members
will be available to answer calls if the preferred member is unavailable. Penalties can
also be defined using AddQueueMember(), as the following example demonstrates:
exten => *54,1,Verbose(2,Logging In Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
; *CLI> database put queue support/0000FFFF0001/penalty 0
same => n,Set(QueuePenalty=${DB(queue/support/${CHANNEL(peername)}/penalty)})
; *CLI> database put queue support/0000FFFF0001/membername "James Shaw"
same => n,Set(MemberName=${DB(queue/support/${CHANNEL(peername)}/membername)})
; AddQueueMember(queuename[,interface[,penalty[,options[,membername
; [,stateinterface]]]]])
same => n,AddQueueMember(support,${MemberChannel},${QueuePenalty},,${MemberName})
Using AddQueueMember(), we’ve shown how you could retrieve the penalty associated
with a given member name for a particular queue and assign that value to the member
when she logs into the queue. Some additional abstraction would need to be done to
make this work for multiple queues; for more information see “Automatically Logging
Into and Out of Multiple Queues” on page 270.
Changing Penalties Dynamically (queuerules.conf)
Using the queuerules.conf file, it is possible to specify rules to change the values of the
QUEUE_MIN_PENALTY and QUEUE_MAX_PENALTY channel variables. The QUEUE_MIN_PENALTY
and QUEUE_MAX_PENALTY channel variables are used to control which members of a queue
Advanced Queues | 285