[asterisk-users] AgentCallbackLogin() deprecated in 1.4

Gavin Hamill gdh at laterooms.com
Wed Dec 20 07:09:50 MST 2006


On Wed, 20 Dec 2006 14:39:42 +0100
"Markus Bönke" <mbodbg at gmx.net> wrote:

> Hello all,

> The other thing is, that "show agents"
> doesn't show me which agents are logged in and if I use "show queue"
> I can see local channels attached to a queue but no agents. For my
> point of view there is some functionality lost with the new concept.

Snap! I've been designing an * system for our call centre and fallen
into exactly the same trap. I ended up coding my own agent login/logout
procedures using astdb functions to store the extension at which an
agent is sitting...

However what I'm missing most is a 'wallboard' for 'number of agents
on Do-Not-Disturb' / number of waiting calls / average wait time, so I'm
considering QueueMetrics, but E 2500 is a lot of cash for that one
feature. I'll probably get one of the codies here to knock something
together.

> If I want to program a realtime display to show agentstates in queues
> based on the output from "show queue", what's the concept to map
> agents to the local channels? How can I configure agents in future?

Well, you might want to make use of the 'pre-queue AGI' facility, and
use that to set that agent as 'on call' (Postgres/MySQL or just AstDB)
in that.. then after the Queue application exits, use ${UNIQUEID} to
change the state of the agent to 'free' via func_odbc or another AGI.

If you specify setinterfacevar=yes in queues.conf, then
you can do 'GET VARIABLE MEMBERINTERFACE' in the AGI to find the name
of the Local/xxxx channel that the caller is about to be connected to.
Then look that up in AstDB... here's what I do - it's heavily based on
the agi-test.agi that comes with Asterisk.

# Which queue member was this incoming caller about to speak to?
print "GET VARIABLE MEMBERINTERFACE\n";
my $result = <STDIN>;
&checkresult($result);

# Incoming string is "200 result=1 (Local/1737 at agents)" so we need to
# trim the fat
$aid=$result;
$aid =~ s/.*Local\///;
$aid =~ s/\@agents.*//;
chop $aid; # drop the end carriage return

# This /has/ to work because this is the same logic that the 'agents'
# context uses in the dialplan!
print "DATABASE GET LRCC $aid\n";
my $result = <STDIN>;
&checkresult($result);

# More trimmings.
$ext=$result;
$ext =~ s/.*\(//;
$ext =~ s/\).*//;
chop $ext;

You can then go on and do... 

$sql="UPDATE agent_status SET status = 'on call', uniqueid='".$AGI
{'uniqueid'}."', extension='".$AGI{'ext'}."' WHERE agentid='$aid'";

$dbh->do($sql);

.. then just view the contents of the agent_status table. I hope that
makes sense - it was a bit of a ramble :) 1.4 has been a lot of fun so
far - I'm using a lot of the new features and doing stuff that I
couldn't have thought of with 1.2 :)

Cheers,
Gavin.


More information about the asterisk-users mailing list