[asterisk-users] Real replacement for AgentCallBackLogin() on Asterisk 1.6

Jim Dickenson dickenson at cfmc.com
Mon Nov 2 10:56:36 CST 2009


I have sent this before but here is how I do agent login and queue:

; #### Agent login logout ####
exten => *20,1,Verbose(2,Doing agent login/logout)
exten => *20,n,Answer()
exten => *20,n,wait(.0.5)
exten => *20,n,Read(AgentNumber,agent-user)
exten => *20,n,Set(UserID=${DB(ExtenToUser/${AgentNumber})})
exten => *20,n,GotoIf($["${UserID}"=""]?NOUSER)
exten => *20,n,Set(AgentStatus=${DB(users/${UserID}/AgentStatus)})
exten => *20,n,GotoIf($["${AgentStatus}"="1"]?VERIFY)
exten => *20,n,GotoIf($["${AgentStatus}"="2"]?VERIFY)
exten => *20,n(NOUSER),Playback(cfmc/bad-agent)
exten => *20,n,Playback(vm-goodbye)
exten => *20,n,Hangup()
exten => *20,n(VERIFY),VMAuthenticate(${AgentNumber}@ourvm)
exten => *20,n,GotoIf($["${AgentStatus}"="2"]?AGENTOFF)
exten => *20,n,Set(DB(users/${UserID}/AgentStatus)=2)
exten => *20,n,Set(DB(users/${UserID}/AgentDevice)=${CUT(CHANNEL,-,1)})
exten => *20,n,AddQueueMember(support,Local/Queue${AgentNumber} 
@ansqueue,,,,${C$
;   AQMSTATUS can be  ADDED | MEMBERALREADY | NOSUCHQUEUE
exten => *20,n,Playback(agent-loginok)
exten => *20,n,Verbose(2,Agent ${AgentNumber} added ${DB(users/$ 
{UserID}/AgentD$
exten => *20,n,Hangup()
exten => *20,n(AGENTOFF),Set(DB(users/${UserID}/AgentStatus)=1)
exten => *20,n,Set(OldVal=${DB_DELETE(users/${UserID}/AgentDevice)})
exten => *20,n,RemoveQueueMember(support,Local/Queue${AgentNumber} 
@ansqueue)
exten => *20,n,Playback(agent-loggedoff)
exten => *20,n,Verbose(2,Agent ${AgentNumber} removed)
exten => *20,n,Hangup()


exten => 201,1,Verbose(2,Doing support call)
exten => 201,n,Answer()
exten => 201,n,Wait(0.5)
;exten => 201,n,Set(qac=${QUEUE_MEMBER(support,free)})
exten => 201,n,Set(qac=${QUEUE_MEMBER_COUNT(support)})
exten => 201,n,GotoIf($[${qac} > 0]?HAVEAGNT)
exten => 201,n,Verbose(2,No agents free in support queue)
exten => 201,n,Playback(cfmc/support-no-agent)
exten => 201,n,Voicemail(201 at ourvm,u)
exten => 201,n,Playback(goodbye)
exten => 201,n,Hangup()
exten => 201,n(HAVEAGNT),Playback(cfmc/support-intro)
exten => 201,n,Verbose(2,Queuing caller for support agent)
exten => 201,n,Queue(support,nrt,,,120)
exten => 201,n,Verbose(2,Support agent did not answer call)
exten => 201,n,Voicemail(201 at ourvm,b)
exten => 201,n,Playback(goodbye)
exten => 201,n,Hangup()


[ansqueue]
exten => _Queue.,1,Set(AgentNumber=${EXTEN:5})
exten => _Queue.,n,Set(UserID=${DB(ExtenToUser/${AgentNumber})})
exten => _Queue.,n,Set(AgentDevice=${DB(users/${UserID}/AgentDevice)})
;exten => _Queue.,n,Verbose(2,Agent ${AgentNumber} status is $ 
{DEVICE_STATE(${A$
exten => _Queue.,n,Verbose(2,Agent ${AgentNumber} status is ${DEVSTATE 
(${AgentD$
;exten => _Queue.,n,GotoIf($["${DEVICE_STATE($ 
{AgentDevice})}"="NOT_INUSE"]?DIA$
exten => _Queue.,n,GotoIf($["${DEVSTATE(${AgentDevice})}"="NOT_INUSE"]? 
DIALIT)
exten => _Queue.,n,Busy()
exten => _Queue.,n,Hangup()
exten => _Queue.,n(DIALIT),Dial(${AgentDevice},,g)
exten => _Queue.,n,Hangup()

-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



On Nov 2, 2009, at 8:44 AM, Lenz Emilitri wrote:

> We were thinking about doing something similar as well. A lot of  
> people are asking for this. If there is anybody else interested, we  
> could share the load....
>
> I was thinking about creating a context like @agents, so that when  
> you do the log-on you basically add Local/106 at agents as a member of  
> the queue. When you ring it, it basically looks up for the actual  
> device in AstDB and dials it like:
>
> Queue -> (member) Local/106 at agents -> (astdb) SIP/234
>
> I think that we should be able to forward channel state as well  
> (using hints? I've never done it)  so that app_queue does not try  
> dialling agents that are busy.
>
> I was thinking about storing queue-agent associations into config  
> strings, and/or AstDB, and/or http over curl. And yes, ideally it  
> should work fine on 1.4's as well....
>
> Things that should be working from version one:
> - logging compatible with older asterisk's
> - authentication using Voicemail
> -.plug and play on most systems
> - channel states
> - pause/unpause with pause codes
> - ...you tell me....
>
> Anybody interested?
> l.
>
>
> 2009/10/30 Mariano Lecuona <mlecuona at gmail.com>
> Hi all,
>
> I would like to know if there is any application replacement for the  
> AgentCallBackLogin() from asterisk 1.4 on asterisk 1.6. I know, from  
> what I've read that the call back login agent can be done using a  
> smart dialplan as showed on the docs. But I cannot thinks a flexible  
> dialplan for a dinamic reassignation of agents to different queues  
> every day.
>
> Thanks in advance.
>
> Mariano
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> -- 
> Loway - home of QueueMetrics - http://queuemetrics.com
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091102/d888cb3d/attachment.htm 


More information about the asterisk-users mailing list