[asterisk-users] Agent-Login/out in 1.6
Jim Dickenson
dickenson at cfmc.com
Sat May 16 09:27:32 CDT 2009
Where do you want to get the value that agent uses to validate?
You can do your own code to do the validation.
Get the value from where ever and then do a read and compare the value read
with the value you retrieved from where ever. If there is match you are
done if no match say error, maybe setup some counter and ask for value
again.
Or else use
Authenticate(password[,options[,maxdigits]]): This application asks the
caller
to enter a given password in order to continue dialplan execution. If the
password
begins with the '/' character, it is interpreted as a file which contains a
list of
valid passwords, listed 1 password per line in the file.
When using a database key, the value associated with the key can be
anything.
Users have three attempts to authenticate before the channel is hung up.
Options:
a - Set the channels' account code to the password that is entered
d - Interpret the given path as database key, not a literal file
m - Interpret the given path as a file which contains a list of account
codes and password hashes delimited with ':', listed one per line
in
the file. When one of the passwords is matched, the channel will
have
its account code set to the corresponding account code in the file.
r - Remove the database key upon successful entry (valid with 'd' only)
maxdigits - maximum acceptable number of digits. Stops reading after
maxdigits have been entered (without requiring the user to
press the '#' key).
Defaults to 0 - no limit - wait for the user press the '#' key.
--
Jim Dickenson
mailto:dickenson at cfmc.com
CfMC
http://www.cfmc.com/
From: David Anthony O Reilly <oreillda at tcd.ie>
Date: Sat, 16 May 2009 14:54:00 +0100
To: <dickenson at cfmc.com>
Cc: <asterisk-users at lists.digium.com>
Subject: Agent-Login/out in 1.6
Hi Jim
Thanks for your code!! I see you use the Voicemail system to authenticate,
have you ever managed to avoid that as I don't use voicemail at all and I am
thinking if I use that solution I will need to set up a voicemail for all
the queue members just to get them to log in.
hehe What were the developers thinking by removing the old system! It worked
perfect!! and by the looks of it nobody has ever recovered from the command
removal unless they hack around with the voicemail system.
Hopefully somebody out there has managed to create an agent login/logout
without bringing voicemail into it???? If I find a way I will let you and
post a wiki on it as I am sure loads of people have this problem.
Thanks
Dave
; #### Agent login logout ####
exten => *20,1,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(CHA
NNEL,-,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()"
--
_________________________________________
Mr. David Anthony O'Reilly, B.Sc Comp (Hons)
M.Sc MOB Postgraduate @ University College Cork, Ireland - M.Sc (Mob) - 2009
Computer Science Graduate of The University of Dublin, Trinity College -
B.Sc (Comp) 2008
Email: oreillda at tcd.ie / dor3 at student.cs.ucc.ie
Tel: +353 (0) 86 030 60 32
_________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090516/f50d20ac/attachment.htm
More information about the asterisk-users
mailing list