Hello,
I need to migrate an old version of Freepbx (2.8.01). It used a perl script to retrieve queue status via AMI command queues and create a web page to display the result.
the command output was as such
402020 has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 60s
Members:
Local/4039@from-queue/n (ringinuse enabled) (Not in use) has taken no calls yet
Local/4042@from-queue/n (ringinuse enabled) (Not in use) has taken no calls yet
Local/4077@from-queue/n (ringinuse enabled) (Not in use) has taken no calls yet
No Callers
and was interpreted in the perl script
Login and get our booty from Asterisk
$logres = send_cmd(“Action: Login${EOL}Username: $user${EOL}Secret: $secret$BLANK”);
#$qinfo = send_cmd(“Events: off”);
$qinfo = send_cmd(“Action: queues$BLANK$EOL”);
$logres = send_cmd(“Action: Logoff$BLANK”);
close $remote; # Close socket
Detection de queue sans membre
$qinfo =~ s/No Members/Members:\n Aucun membre ! \n/g;
my %qcalls = map { /(\S+)\s+has (\d+) calls.?\n/sg; } $qinfo;
my %qmax = map { /(\S+)\s+has \d+ calls (max (\S+)).?\n/sg; } $qinfo;
my %qstrat = map { /(\S+)\s+has \d+ calls (max \S+) in (\S+) strategy.?\n/sg; } $qinfo;
my %qmems = map { /(\S+)\s+has \d+ calls.?Members:.?\s{6}(.?)\s{3}\S*?\s*?Callers/sg; } $qinfo;
my %qcallers = map { /(\S+)\s+has \d+ calls.*?([No ]Callers.?)\n/sg; } $qinfo;
Now, the AMI command has changed (queuestatus) and the format is like this
Event: QueueParams
Queue: 278500
Max: 0
Strategy: ringall
Calls: 0
Holdtime: 3
TalkTime: 11
Completed: 24
Abandoned: 8
ServiceLevel: 60
ServicelevelPerf: 100.0
ServicelevelPerf2: 100.0
Weight: 0
Has anyone heard of an updated version of this perl script that would treat the received data correctly ?
I’m no perl developper so digging into this would mean lots of time and frustration on my side.
thanks and have a good day