check if devices reachable in queue

Home » Asterisk Users » check if devices reachable in queue
Asterisk Users 4 Comments

On 11/20/2011 02:49 PM, Matt Hamilton wrote:
>
>
> 2. if the devices/members in the queue are not reachable, I would like
> to forward him to a phone B.

> I’m looking for a fast/practical way of accomplishing the second one.
> In other words, before sending a call to a queue, I would like to see
> if the members/devices in that queue are available/reachable.
>
>
> I define the members statically in queue.conf and QUEUE_MEMBER_COUNT
> gives the count of those – doesn’t care if they are
> available/reachable or not (even if phone is unhooked, still counted).
>
> I should be able to loop through each member and use
> ${DEVICE_STATE()}. for every incoming call, isn’t this
> overkill? Any other way?
Have you tried, instead of pre-processing the caller before calling
Queue(), checking the ${QUEUESTATUS} variable. On a Timeout, it will be
TIMEOUT, but there are also JOINEMPTY, LEAVEEMPTY, JOINEUNAVAIL and
LEAVEUNAVAIL options as well (core show application Queue). If you set
your queues.conf to consider the queue to be empty when the members are
unavailable, invalid or unknown, the Queue() app should return
immediately to the next dialplan step with the QUEUSTATUS of JOINEMPTY.

Dale

4 thoughts on - check if devices reachable in queue

  • Queue(), checking the ${QUEUESTATUS} variable.

    Even when the phones are UNREACHABLE, QUEUE is still trying until it times out – ${QUEUESTATUS} = TIMEOUT

    I get the following for all the members of the queue, in a loop, until it times out.

    Executing [1001@handle-queue:3] Dial(“Local/1001@handle-queue-6d01;2”, “SIP/1001”) in new stack
    [Nov 21 18:57:42] WARNING[4780]: app_dial.c:2196 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 – Unknown)
    == Everyone is busy/congested at this time (1:0/0/1)

  • You are calling the Dial() application here. If you are using queues,
    you should use the Queue() application.
    Dial() does not interact with the queue or the device state for the
    queue members, it just attempts to make the call.
    If the queue members are not available, the Queue() app will immediately
    return to the next dialplan step.
    If the members are available, the call will be placed into the queue.
    If then caller waits for TIMEOUT time, then dialplan will continue at
    the next step.
    Either way, the ${QUEUESTATUS} variable will contain the reason it
    continued.

    Dale

  • Thanks Dale, you pointed me in the right direction.

    queues, you should use the Queue() application.

    I’m using Local channels with the queue: