System information
; queues.conf
[support](StandardQueue)
member => Local/SIP-0000FFFF0001@MemberConnector ; pass the technology to dial over
; and the device identifier,
; separated by a hyphen. We'll
; break it apart inside the
; MemberConnector context.
Notice how we passed the type of technology we want to call along with
the device identifier to the MemberConnector context. We’ve simply used
a hyphen (although we could have used nearly anything as a separator
argument) as the field marker. We’ll use the CUT() function inside the
MemberConnector context and assign the first field (SIP) to one channel
variable and the second field (0000FFFF0001) to another channel variable,
which will then be used to call the endpoint.
Passing information to be later “exploded” in the context used by the
Local channel is a common and useful technique (kind of like the
explode() function in PHP).
Of course, we’ll need the MemberConnector context to actually connect the caller to the
agent:
[MemberConnector]
exten => _[A-Za-z0-9].,1,Verbose(2,Connecting ${CALLERID(all)} to Agent at ${EXTEN})
; filter out any bad characters, allowing alphanumeric characters and the hyphen
same => n,Set(QueueMember=${FILTER(A-Za-z0-9\-,${EXTEN})
; assign the first field of QueueMember to Technology using the hyphen separator
same => n,Set(Technology=${CUT(QueueMember,-,1)})
; assign the second field of QueueMember to Device using the hyphen separator
same => n,Set(Device=${CUT(QueueMember,-,2)})
; dial the agent
same => n,Dial(${Technology}/${Device})
same => n,Hangup()
So, now we’ve passed our queue member to the context, and we can dial the device.
However, because we’re using the Local channel as the queue member, the Queue()
won’t necessarily know the state the call is in, especially when the Local channel is
optimized out of the path (see https://wiki.asterisk.org/wiki/display/AST/Local+Channel
+Modifiers for information about the /n modifier, which causes the Local channel to
not be optimized out of the path). The queue will be monitoring the state of the Local
channel, and not that of the device we really want to monitor.
Luckily, we can give the Queue() the actual device to monitor and associate that with
the Local channel, so that the Local channel’s state is always that of the device we’ll
end up calling. Our queue member would be modified in the queues.conf file like so:
294 | Chapter 13: Automatic Call Distribution (ACD) Queues