Remove members from Queue

Hi,

I have a queue “5558”.
I have dynamic users who login to the queue to answer calls.
Many times users forget to logout from the queue at the end of the day.


myasteriskCLI> show queues
5558 has 0 calls (max unlimited) in ‘ringall’ strategy (2s holdtime), W:0, C:1, A:1, SL:0.0% within 0s
Members: myasterisk
CLI>
Local/[email protected]/n (dynamic) (Not in use) has taken no calls yet
Local/[email protected]/n (dynamic) (Not in use) has taken 2 calls (last was 234790 secs ago)

How can I remove these users from the queue using a script which can run at the end-of-day?

I believe “queue remove member” command should help, but I could not use it successfully. Rather, I could not construct the command. I tried various combinations, but none worked.

Please help.
Thank you.
Vai

I’ve had some success in running an asterisk command from a linux script with the following within the script:

/usr/sbin/asterisk -rx “asterisk command”

Bill/W5WAF

Thx for the command from shell script.
Thats a step forward for me.

But I am majorly stuck with the Asterisk command to remove members from queue.
Requesting forum members for help.

Thx again.
Vai

queue remove member (membername) from (queue #)

Hitting tab after the member noun will display active members and help with the syntax. I have not tested with wildcards.

Why don’t you fix the real problem? This is an agent adherence issue not a technical one… Make them log out at the end of each shift and penalise them if they continue to offend.

YES!!! Its worked.

I have been struggling with this since such a long time and finally I have managed to get this right.

Thx “SkykingOH”.

You string has done this.

This is the first cut of my script.
If it helps others…


#!/bin/bash

CNTR=/usr/sbin/asterisk -rx "queue show 5555" | grep -c "from-internal"

for (( c=1; c<=$CNTR; c++ ))
do

mem=/usr/sbin/asterisk -rx "queue show 5555" | grep -m1 "from-internal" | cut -d"(" -f1
echo $mem
cmmd=/usr/sbin/asterisk -rx "queue remove member $mem from 5555"
echo $cmmd

done


I needed to do this today with multiple queues. Maybe this can help others…

#!/bin/sh

if [ "$*" == "" ]; then
  echo "need to know which queues"
  echo "usage: $0 queue1 queue2 queue3 ..."
  exit
fi

for i in  $*
do
  CNTR=`/usr/sbin/asterisk -rx "queue show ${i}" | grep "from-internal" | awk '{print $1}'`
  for j in  ${CNTR}
  do
    echo "running: /usr/sbin/asterisk -rx queue remove member ${j} from ${i}"
echo    `/usr/sbin/asterisk -rx "queue remove member ${j} from ${i}"`
  done
done

hi , i have a member 127 and want to remove it from queue 30
i typed
queue remove member Local/[email protected] from 30
but it failed

==========================
Unable to remove interface ‘Local/[email protected]’ from queue ‘30’: Not there
Command ‘queue remove member Local/[email protected] from 30’ failed.

command queue show 30 :
Local/[email protected]/n (Not in use) has taken no calls yet

wt i need to type to remove the memebrr 127 ???

regards

Perhaps:

queue remove member Local/[email protected]/n from 30

Now I can’t remove them from the queue. Here’s the output from “show queue 2500”:
2500 has 0 calls (max unlimited) in ‘linear’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
Members:
Helen Hoffman (Local/[email protected]/n from hint:[email protected]) (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
Tom Shedd (Local/[email protected]/n from hint:[email protected]) (ringinuse enabled) (dynamic) (In use) has taken no calls yet
Chad Ramer (Local/[email protected]/n from hint:[email protected]) (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
Local/0464*@from-queue/n (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
Local/[email protected]/n (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
The two at the bottom appeared when a user hit the wrong buttons when attempting to login. How can I remove those entries?
I’ve tried “queue remove member Local/0464 from 2500” but get "Unable to remove interface ‘Local/0464’ from queue ‘2500’: Not there"
Any suggestions?

Same problem:

CLI> queue show 312

312 has 0 calls (max unlimited) in ‘rrmemory’ strategy (68s holdtime, 208s talktime), W:1, C:20, A:10, SL:60.0% within 60s
Members:
Local/[email protected]/n from hint:[email protected] (ringinuse enabled) (dynamic) (paused) (Not in use) has taken no calls yet

CLI> queue remove member Local/[email protected]/n from 312
Unable to remove interface ‘Local/[email protected]/n’ from queue ‘312’: Not there
Command ‘queue remove member Local/[email protected]/n from 312’ failed.

Can’t remove member from queue…