<HTML>
<HEAD>
<TITLE>Re: Agent-Login/out in 1.6</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Where do you want to get the value that agent uses to validate?<BR>
<BR>
You can do your own code to do the validation.<BR>
<BR>
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.<BR>
<BR>
Or else use<BR>
<BR>
Authenticate(password[,options[,maxdigits]]): This application asks the caller<BR>
to enter a given password in order to continue dialplan execution. If the password<BR>
begins with the '/' character, it is interpreted as a file which contains a list of<BR>
valid passwords, listed 1 password per line in the file.<BR>
When using a database key, the value associated with the key can be anything.<BR>
Users have three attempts to authenticate before the channel is hung up.<BR>
Options:<BR>
a - Set the channels' account code to the password that is entered<BR>
d - Interpret the given path as database key, not a literal file<BR>
m - Interpret the given path as a file which contains a list of account<BR>
codes and password hashes delimited with ':', listed one per line in<BR>
the file. When one of the passwords is matched, the channel will have<BR>
its account code set to the corresponding account code in the file.<BR>
r - Remove the database key upon successful entry (valid with 'd' only)<BR>
maxdigits - maximum acceptable number of digits. Stops reading after<BR>
maxdigits have been entered (without requiring the user to<BR>
press the '#' key).<BR>
Defaults to 0 - no limit - wait for the user press the '#' key.<BR>
<BR>
-- <BR>
Jim Dickenson<BR>
<a href="mailto:dickenson@cfmc.com">mailto:dickenson@cfmc.com</a><BR>
<BR>
CfMC<BR>
<a href="http://www.cfmc.com/">http://www.cfmc.com/</a><BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>David Anthony O Reilly <oreillda@tcd.ie><BR>
<B>Date: </B>Sat, 16 May 2009 14:54:00 +0100<BR>
<B>To: </B><dickenson@cfmc.com><BR>
<B>Cc: </B><asterisk-users@lists.digium.com><BR>
<B>Subject: </B>Agent-Login/out in 1.6<BR>
<BR>
Hi Jim<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
Thanks<BR>
Dave<BR>
<BR>
<BR>
; #### Agent login logout ####<BR>
exten => *20,1,Answer()<BR>
exten => *20,n,wait(.0.5)<BR>
exten => *20,n,Read(AgentNumber,agent-<BR>
user)<BR>
exten => *20,n,Set(UserID=${DB(ExtenToUser/${AgentNumber})})<BR>
exten => *20,n,GotoIf($["${UserID}"=""]?NOUSER)<BR>
exten => *20,n,Set(AgentStatus=${DB(users/${UserID}/AgentStatus)})<BR>
exten => *20,n,GotoIf($["${AgentStatus}"="1"]?VERIFY)<BR>
exten => *20,n,GotoIf($["${AgentStatus}"="2"]?VERIFY)<BR>
exten => *20,n(NOUSER),Playback(cfmc/bad-agent)<BR>
exten => *20,n,Playback(vm-goodbye)<BR>
exten => *20,n,Hangup()<BR>
exten => *20,n(VERIFY),VMAuthenticate(${AgentNumber}@ourvm)<BR>
exten => *20,n,GotoIf($["${AgentStatus}"="2"]?AGENTOFF)<BR>
exten => *20,n,Set(DB(users/${UserID}/AgentStatus)=2)<BR>
exten => *20,n,Set(DB(users/${UserID}/AgentDevice)=${CUT(CHANNEL,-,1)})<BR>
exten =><BR>
*20,n,AddQueueMember(support,Local/Queue${AgentNumber}@ansqueue,,,,${CUT(CHA<BR>
NNEL,-,1)})<BR>
; AQMSTATUS can be ADDED | MEMBERALREADY | NOSUCHQUEUE<BR>
exten => *20,n,Playback(agent-loginok)<BR>
exten => *20,n,Verbose(2,Agent ${AgentNumber} added<BR>
${DB(users/${UserID}/AgentDevice)})<BR>
exten => *20,n,HangUp()<BR>
exten => *20,n(AGENTOFF),Set(DB(users/${UserID}/AgentStatus)=1)<BR>
exten => *20,n,Set(OldVal=${DB_DELETE(users/${UserID}/AgentDevice)})<BR>
exten => *20,n,RemoveQueueMember(support,Local/Queue${AgentNumber}@ansqueue)<BR>
exten => *20,n,Playback(agent-loggedoff)<BR>
exten => *20,n,Verbose(2,Agent ${AgentNumber} removed)<BR>
exten => *20,n,Hangup()"<BR>
<BR>
<BR>
-- <BR>
_________________________________________<BR>
<BR>
Mr. David Anthony O'Reilly, B.Sc Comp (Hons)<BR>
<BR>
M.Sc MOB Postgraduate @ University College Cork, Ireland - M.Sc (Mob) - 2009<BR>
<BR>
Computer Science Graduate of The University of Dublin, Trinity College - B.Sc (Comp) 2008<BR>
<BR>
Email: oreillda@tcd.ie / dor3@student.cs.ucc.ie<BR>
Tel: +353 (0) 86 030 60 32<BR>
_________________________________________<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>