Queue pause member

Hello,

I am running into the following problem.

Context:

An plain asterisk server, realtime with queues and hotdesking.
Scripts to pause or unpause a queuemember and update a database which are called by the dialplan.

The strange thing is that the script to unpause an agent from the queue works, but pause does not.

The dialplan:

exten => *1000,1,NoOp(Remove Pause)
same => n,Set(LOCATION=${CUT(CHANNEL,-,1)})
same => n,System(/etc/asterisk/scripts/unpause.sh ${LOCATION})
same => n,Answer()
same => n,Playback(do-not-disturb)
same => n,Playback(de-activated)
same => n,Hangup()

exten => *2000,1,NoOp(add Pause)
same => n,Set(LOCATION=${CUT(CHANNEL,-,1)})
same => n,System(/etc/asterisk/scripts/pause.sh ${LOCATION})
same => n,Answer()
same => n,Playback(do-not-disturb)
same => n,Playback(activated)
same => n,Hangup()

Pause script:

#!/bin/sh
. /etc/asterisk/scripts/config.sh

location=$1

asterisk -rx “queue pause member $location”

Insert standby in queue member table

mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e “update queue_member_table set paused=1 where interface=’$location’”

Unpause script:

#!/bin/sh
. /etc/asterisk/scripts/config.sh

location=$1

asterisk -rx “queue pause member $location”

Insert standby in queue member table

mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e “update queue_member_table set paused=1 where interface=’$location’”

Also when I pause an interface within the asterisk command line, the system gives an error but DOES pause the member, see log:

pabx02CLI> queue pause member SIP/toestel20
Unable to pause interface 'SIP/toestel20’
Command ‘queue pause member SIP/toestel20’ failed.
[Jul 17 13:49:21] WARNING[3414]: app_queue.c:6314 set_member_paused: Failed pausing realtime queue member KAZLOW:SIP/toestel20
pabx02
CLI> queue show kazlow
KAZLOW has 0 calls (max 1) in ‘rrmemory’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 30s
Members:
meightee (SIP/toestel20 from SIP/toestel20) with penalty 5 (ringinuse disabled) (realtime) (paused) (Not in use) has taken no calls yet
No Callers

-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected

And no, the member was not paused when the command was given. The strange thing is the system gives an error notification but does pause the member.

To make things even more interesting, yes I have tried the *1000 and *2000 extensions with the PauseQueueMember and UnpauseQueueMember command, same result. PauseQueueMember does not work, UnpauseQueueMember does work.

Im using Asterisk 11.18.0 on Ubuntu 14.04.2 LTS.

Has anyone had this problem? Tips would be appreciated.

Thanks.