Is there a way to have PBX email who is logged into a ACD queue at a certain time?

I’m trying to think of a way where FPBX has a cronjob that runs every day at 8pm. That cronjob would check to see if anyone is still logged into an ACD queue, and if someone is, send out an email saying which phones are logged in (or just someone is still logged in).

Basically, we used to have a procedure in our office where at the end of the day last one out the door checks to make sure everyone is logged out of the helpdesk queue. However in this WFH world we are in, harder to know who is still working at the end of the day… and if someone forgot to logout.

It’s not a huge deal because we have timeouts on the helpdesk queue for callers waiting for a while.

But I thought maybe some sort of email blast saying, “hey dude you forgot to logout” might help.

any suggestions would be helpful.

Out of curiosity: Whats the reason you want to route after hours calls to that queue but you want the queue to be empty, why not just route the after hours calls to the failover destination?

If for some reason you do want the calls to go to that queue, maybe a cronjob that logs them out instead of sending an email would work?

If you do want to send an email instead of logging them out, it’s doable.

We recently had the opposite request, a critical queue which is required to be staffed 24/7, and if the queue is empty they wanted an email alert. So instead of having a process running or a crontab every couple of minutes, In the Agent Logoff context and as well as the incoming calls context we had a single line and it works fine so far.

exten => s,n,ExecIf($["${QUEUE_MEMBER(QueueNum,logged)}" = "0"]?System(echo "Queue is empty" | mail -s "This is the subject" [email protected]))

So normally, as soon as the last agent logged of it would trigger this email, but if for some reason the last agent was removed from the queue via CLI or a different way, then an email would be sent as soon as the next caller hits the Trunk.

You can do the opposite:

exten => s,n,ExecIf($["${QUEUE_MEMBER(QueueNum,logged)}" != "0"]?System(echo "Members in queue: ${QUEUE_MEMBER_LIST(QueueNum)}" | mail -s "This is the subject" [email protected]))

However, if you want to run this with a bash script and a cronjob, you can run something like:

/usr/sbin/asterisk -x"database showkey Queue/PersistentMembers/QueueNum"

If no one is logged in, it should return:

0 results found.

If someone or more than one logged in, it should return: (in the example here two agents are logged in)

/Queue/PersistentMembers/QueueNum                     : Local/204@from-queue/n;0;0;Jean;hint:204@ext-local|Local/202@from-queue/n;0;0;Mike;hint:202@ext-local
1 results found.

So write your script to send an email based on the result it returns.

Hope that helps.

1 Like

Making use of FOP2, you can just assign a grunt the responsibility to look at it at the end of the day and log people out.

Thanks @PitzKey , going to try that out.

I do have a failover destination… but we’re trying to know if calls are being unnecessarily sitting in queue when there are no agents actively answering. Basically reducing their hold time when nobody is there.

@sorvani Nobody wants to be the grunt. :slight_smile:

1 Like

I’m passing familiar with queues, but I could have sworn there was a setting that said “when there are no agents, everyone goes home” and “if an agent doesn’t answer and the call goes to the alternate destination, that agent is disabled”.

Of course, I’m old and misremember things all the time, so maybe not.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.