<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 &nbsp;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>
&nbsp;&nbsp;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>
&nbsp;&nbsp;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>
&nbsp;&nbsp;Options:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a - Set the channels' account code to the password that is entered<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d - Interpret the given path as database key, not a literal file<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m - Interpret the given path as a file which contains a list of account<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;codes and password hashes delimited with ':', listed one per line in<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the file. When one of the passwords is matched, the channel will have<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;its account code set to the corresponding account code in the file.<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r - Remove the database key upon successful entry (valid with 'd' only)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxdigits &nbsp;- maximum acceptable number of digits. Stops reading after<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxdigits have been entered (without requiring the user to<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;press the '#' key).<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 &lt;oreillda@tcd.ie&gt;<BR>
<B>Date: </B>Sat, 16 May 2009 14:54:00 +0100<BR>
<B>To: </B>&lt;dickenson@cfmc.com&gt;<BR>
<B>Cc: </B>&lt;asterisk-users@lists.digium.com&gt;<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 =&gt; *20,1,Answer()<BR>
exten =&gt; *20,n,wait(.0.5)<BR>
exten =&gt; *20,n,Read(AgentNumber,agent-<BR>
user)<BR>
exten =&gt; *20,n,Set(UserID=${DB(ExtenToUser/${AgentNumber})})<BR>
exten =&gt; *20,n,GotoIf($[&quot;${UserID}&quot;=&quot;&quot;]?NOUSER)<BR>
exten =&gt; *20,n,Set(AgentStatus=${DB(users/${UserID}/AgentStatus)})<BR>
exten =&gt; *20,n,GotoIf($[&quot;${AgentStatus}&quot;=&quot;1&quot;]?VERIFY)<BR>
exten =&gt; *20,n,GotoIf($[&quot;${AgentStatus}&quot;=&quot;2&quot;]?VERIFY)<BR>
exten =&gt; *20,n(NOUSER),Playback(cfmc/bad-agent)<BR>
exten =&gt; *20,n,Playback(vm-goodbye)<BR>
exten =&gt; *20,n,Hangup()<BR>
exten =&gt; *20,n(VERIFY),VMAuthenticate(${AgentNumber}@ourvm)<BR>
exten =&gt; *20,n,GotoIf($[&quot;${AgentStatus}&quot;=&quot;2&quot;]?AGENTOFF)<BR>
exten =&gt; *20,n,Set(DB(users/${UserID}/AgentStatus)=2)<BR>
exten =&gt; *20,n,Set(DB(users/${UserID}/AgentDevice)=${CUT(CHANNEL,-,1)})<BR>
exten =&gt;<BR>
*20,n,AddQueueMember(support,Local/Queue${AgentNumber}@ansqueue,,,,${CUT(CHA<BR>
NNEL,-,1)})<BR>
;   AQMSTATUS can be  ADDED | MEMBERALREADY | NOSUCHQUEUE<BR>
exten =&gt; *20,n,Playback(agent-loginok)<BR>
exten =&gt; *20,n,Verbose(2,Agent ${AgentNumber} added<BR>
${DB(users/${UserID}/AgentDevice)})<BR>
exten =&gt; *20,n,HangUp()<BR>
exten =&gt; *20,n(AGENTOFF),Set(DB(users/${UserID}/AgentStatus)=1)<BR>
exten =&gt; *20,n,Set(OldVal=${DB_DELETE(users/${UserID}/AgentDevice)})<BR>
exten =&gt; *20,n,RemoveQueueMember(support,Local/Queue${AgentNumber}@ansqueue)<BR>
exten =&gt; *20,n,Playback(agent-loggedoff)<BR>
exten =&gt; *20,n,Verbose(2,Agent ${AgentNumber} removed)<BR>
exten =&gt; *20,n,Hangup()&quot;<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>