Copying to asterisk-users, as it's of use there too.
 
I copied this code years ago from the net, it may have been modified
since...    
This however is only used by managers, as it allows the manager to log a
user in and out.
 
For agent logged in/out status:
where 8501 is the queue number and 8512 is the agent's extension, and
SIP0001 is the agent's device.
 
in extensions.conf
    ;ring the queue
    exten => 8501,1,Goto(itg-queue,itg,1)
    ;AGENT Login/Logout to queue 8501
    exten => _8501.,1,Macro(custom-agent-inout,itg_queue)

The agent status' are hints like, 
    exten => 8501SIP0001-99,hint,Custom:q8501_a8512
 
[macro-custom-agent-inout]
;
; Standard extension macro:
;   ${ARG1} - Queue to Join
;
exten => s,1,Answer()

exten => s,n,MYSQL(Connect connid localhost asterisk xxxxxx yyyyy)
exten => s,n,MYSQL(Query resultid ${connid} SELECT channel, extension, name
FROM pbx WHERE cid_num='${MACRO_EXTEN:4}')
exten => s,n,MYSQL(Fetch fetchid ${resultid} channelpath CALLBACKNUM
callername)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid})

exten => s,n,AddQueueMember(${ARG1},SIP/${MACRO_EXTEN:4})
;If they're already logged in, log off
exten => s,n,GotoIf($["${AQMSTATUS}" = "MEMBERALREADY"]?out)
exten =>
s,n,Set(DEVICE_STATE(Custom:q${MACRO_EXTEN:0:4}_a${CALLBACKNUM})=INUSE)
exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup()
 
exten => s,n(out),RemoveQueueMember(${ARG1},SIP/${MACRO_EXTEN:4})
exten =>
s,n,Set(DEVICE_STATE(Custom:q${MACRO_EXTEN:0:4}_a${CALLBACKNUM})=NOT_INUSE)
exten => s,n,UserEvent(Agentlogoff,Agent: ${CALLBACKNUM})
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup()
 
Alec

 

  _____  

From: Ron Hartmann [mailto:[email protected]] 
Sent: Saturday, 4 May 2013 3:08 a.m.
To: Alec Davis
Subject: RE: BLF and asterisk Queue


Alec, 


I was able to get this working and my staff loves it.  Thanks a
million!!!!!!!!


Now off to find a way to show an agents status via blf :-)


~ron


  _____  

From: [email protected]
To: [email protected]
Subject: RE: BLF and asterisk Queue
Date: Wed, 24 Apr 2013 13:09:04 +0000


Thank you very much :-)  I appreciate the information 

~ron


  _____  

Date: Wed, 24 Apr 2013 21:28:46 +1200
From: [email protected]
Subject: RE: BLF and asterisk Queue
To: [email protected]


In case my earlier email was a bit cryptic.
 
I didn't commit the change, due to time zone differences, so don't have the
actual patch that was commited.
 
The patch that was comitted to asterisk 11 is at the following link.
http://svnview.digium.com/svn/asterisk/branches/11/apps/app_queue.c?r1=37323
4
<http://svnview.digium.com/svn/asterisk/branches/11/apps/app_queue.c?r1=3732
34&r2=373235&view=patch> &r2=373235&view=patch
 
Alec



  _____  

From: Ron Hartmann [mailto:[email protected]] 
Sent: Wednesday, 24 April 2013 8:09 a.m.
To: [email protected]
Subject: BLF and asterisk Queue


Alec, 

I am very interested in trying out your Queue patch to allow my staff to see
if there are any calls waiting in the Queue.

Unfortunately the "View Diff" for https://reviewboard.asterisk.org/r/1619/
only shows the changes Olle added (the removal of the debug)

I was wondering if you still have the Patch.  I will need to back port this,
but am happy to do that, if i can just get the patch.

~ron

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to