Log off all agents from all queues…

Home » Asterisk Users » Log off all agents from all queues…
Asterisk Users 3 Comments

We are having a problem where agents are not logging off at the end of
the day and they complain about receiving calls early the next day. Is
there a simple way to automatically log off all agents (dynamic) from
all queues at a certain hour? Or do I have to parse all queues for
agents and remove them one by one?

3 thoughts on - Log off all agents from all queues…

  • Hi,

    Maybe autopause = yes in queues.conf can solve your problem. Other way is AMI script which checks agent and logoff them after some timeout.

  • The original poster probably does not want them to pause but to actually logout so reporting does not skew.

    A script like this which can be scheduled under cron 1 hour after the queue should be empty works… myscript.sh techsup

    #!/bin/bash
    for agent in `rasterisk -rx “show queue $1” | grep SIP | awk ‘{print $1}’`; do
    echo $agent
    done

    Wrap that in a larger for loop to parse all queues and all agents…

    #!/bin/bash
    for queue in `rasterisk -rx “show queues” | grep strategy | awk ‘{print $1}’`; do
    for agent in `rasterisk -rx “show queue $queue” | grep SIP | awk ‘{print $1}’`; do
    echo $agent
    done
    done

    hope that helps…

  • sorry that was some debug script, echo $agent does nothing, rasterisk -rx “queue remove member $agent from $queue” is what your after…

    for queue in `rasterisk -rx “show queues” | grep strategy | awk ‘{print $1}’`; do
    for agent in `rasterisk -rx “show queue $queue” | grep SIP | awk ‘{print $1}’`; do
    rasterisk -rx “queue remove member $agent from $queue”
    done
    done