Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Determining if a queue member is paused in Dialplan logic. [1.8]


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
kevin.larsen at pionee...
Guest





PostPosted: Wed Mar 25, 2015 2:14 pm    Post subject: [asterisk-users] Determining if a queue member is paused in Reply with quote

asterisk-users-bounces@lists.digium.com wrote on 03/25/2015 01:38:26 PM:
Quote:
I'm looking at enabling autopause on one of my queues where my queue
members are bad about leaving their desks without pausing.

Quote:
The problem I see is that when the queue pauses an Member it doesn't
jump into the dialplan to do so which means my handy device state
and asterisk database driven Light for the Member showing their
paused status won't update.

Quote:
My idea for solving this problem is to check the status of my Member
in the queue before I send the calls into it and toggle on the
Members Paused light at that point in time if they are paused.

Quote:
Sadly I don't see a way to determine if my Staff are paused or not
from the dialplan, There doesn't appear to be a function to retrieve
the status of the members in the queue.

Quote:
Does the list have any suggestions?

First, let me say I feel dirty for even posting this. It is probably far from ideal, but it does get the job done. I had the same issue. Also, I am using Asterisk 11. I just looked and it doesn't appear that the QUEUE_MEMBER function supports the paused option in 1.8. To be honest, I am not sure if there is a good replacement for what I have done below in the 1.8 series.

[sub_autopause_status]
exten => s,1,NoOp(Checking for autopaused members for ${arg1} queue)
same => n,Set(MEMBERS=${QUEUE_MEMBER_LIST(${arg1})})
same => n,Set(i=1)
same => n,Set(max=${FIELDQTY(MEMBERS,,)})

same => n,While($[${i} <= ${max}])
same => n,Set(MEMBER=${CUT(MEMBERS,\,,${i})})
same => n,Set(STATUS=${QUEUE_MEMBER(${arg1},paused,${MEMBER})})
same => n,Set(MEMBER_EXT=${CUT(MEMBER,\/,2)})
same => n,ExecIf($["${STATUS}" = "0"]?System(echo "IN" > /var/spool/asterisk/status/agent-${MEMBER_EXT}-status.txt))
same => n,ExecIf($["${STATUS}" = "1"]?System(echo "PAU" > /var/spool/asterisk/status/agent-${MEMBER_EXT}-status.txt))
same => n,NoOp(${MEMBER}: ${STATUS})
same => n,Set(i=$[${i} + 1])
same => n,EndWhile()

same => n,Return()


So, as an explanation, I have multiple queues and agents who autopause. I show their status on their phones, hence the System(echo...) commands to the /var/spool/asterisk/status directory. Those files are used to generate a simple web page that is shown on their phones that lets them see their status. You should be able to adapt that to what you do.

Basically, you pass the queue name into the subroutine as arg1. The subroutine gets a list of every person logged into that queue and then loops through checking the status of each person using the QUEUE_MEMBER function.

It isn't elegant and if you have a lot of queues/queue members to check, it will constitute a lot of looping, but it does work. Like you, I would like to have a way to check the pause status of a member easier. If the queue application could call a subroutine with it autopaused someone, that would actually make an elegant solution, but for now, this was the way I could see to do it.

You could maybe call a script that would parse the queue_log file looking for an agents status and pass that back into the dialplan.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services