[asterisk-users] Agents

Jim Dickenson dickenson at cfmc.com
Mon May 17 08:27:32 CDT 2010


Here is what I do to handle agent login/logout

; #### 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,,,,${CUT(CHANNEL,-,1)})
;   AQMSTATUS can be  ADDED | MEMBERALREADY | NOSUCHQUEUE 
exten => *20,n,Playback(agent-loginok)
exten => *20,n,Verbose(2,Agent ${AgentNumber} added ${DB(users/${UserID}/AgentDevice)})
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()

[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 ${DEVSTATE(${AgentDevice})})
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()


[support]
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_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()


-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



On May 17, 2010, at 5:30 AM, Peter Childs wrote:

> On 17 May 2010 08:40, Lenz Emilitri <lenz.loway at gmail.com> wrote:
>> Use Addmember and removemeber instead :)
>> l.
> 
> 
> Hmm I'm getting that kind of.
> 
> From What I can work out.
> 
> Agents have been deprecated and are going to be removed.
> 
> The replacement, is some complex dialplan using "Local Channels" which
> the admin will have to dream up for themselves.
> 
> I'm quite happy to use some new method, but I don't really understand
> how yet as all the docs I can find point to using agents....
> 
> Ideally I need to be able to
> 
> a> Log into a queue, both by dialing and using the management API
> 
> AgentCallbackLogin....
> 
> b> Log Out a que, both by dialing and using the management API
> 
> System("agent logoff agent/x") or agentlogoff in management api.
> 
> c> If the SIP channel (Phone) is not working (Unavailable) remove it
> from the queue.
> 
> autologoffunavail=yes in agents.conf (but it don't seam to work)
> 
> d> If the phone is not answered within 10 secs log remove it from the que..
> 
> autologoff=10 in agent.conf
> 
> e> Allow hotdesking extensions so that people don't always need to
> login to the same extension.
> 
> dial(agent/${EXTEN})
> 
> f> If the queue is empty or nobody is handling the que drop out, and
> ring every phone.
> 
> joinempty=strict, leavewhenempty=strict
> 
> Using Asterisk 1.4 and a Sark 850.
> 
> Any help, or at least where to go....
> 
> Peter.
> 
> -- 
> _____________________________________________________________________
> -- 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




More information about the asterisk-users mailing list