[Asterisk-Users] Confused on Agents and Queues

Alan Ferrency alan at pair.com
Mon Apr 3 08:15:02 MST 2006


On Sat, 1 Apr 2006, Matt wrote:

> > > However, anyone have a good way to log the agent out without having
> > > them enter their agent ID and then have to hit # for the new
> > > extension?
> > >
> >
> >  There are a couple of ways listed here in the Wiki:
> >
> >  http://www.voip-info.org/tiki-index.php?page=Asterisk%20cmd%20AgentCallbackLogin
>
> Already viewed that.  And there aren't any good wasy to log an agent
> out if the agent is using a unique agent id (not extension number) to
> login.


Our solution to the "agent log out" problem is admittedly imperfect in
the general case, but it works well enough if you can do without agent
passwords.

- This only works if agents don't have passwords. You could probably
  modify it to look up passwords in real time, but it wasn't important
  enough for us.
- Use ${AGENT_BY_CALLERID_${CALLERID}} to get the agent logged into the
  dialling extension.
- Dial a local extension and send # after dial, to log out and press #
  without agent intervention.


The extension agents dial to log out looks like this. It calculates the
logged in agent and calls the logout macro (below), or if there's no
agent logged in, just plays back a message.

[macro-agent_logout_ext]
exten => s, 1, set(agent=${AGENTBYCALLERID_${ARG1}})
exten => s, 2, gotoif(${agent}?3:101)
exten => s, 3, macro(agent_logout,${agent})
exten => s, 101, macro(answer_wait)
exten => s, 102, playback(agent-loggedoff)
exten => s, 103, hangup()


The agent logout macro has a bit of a hack to send # to
agentcallbacklogin after the agent ID is entered. In retrospect I'm not
sure the global var needs to be global, here.

Note that the agent hears agentcallbacklogin's "the agent is logged off"
message, except the initial portion is cut off briefly.

[macro-agent_logout]

exten => s, 1, setglobalvar(agent=${ARG1})
exten => s, 2, noop(agent ${agent})
exten => s, 3, dial(local/logout at macro-agent_logout/n,,D(w#)o)

exten => logout, 1, noop(agent logout ${agent})
exten => logout, 2, wait(1)
exten => logout, 3, agentcallbacklogin(${agent},, at shared_phones)


I hope this helps.

Alan Ferrency
pair Networks, Inc.
alan at pair.com





More information about the asterisk-users mailing list