Asterisk 16 manager command queue show

Dear friends,

Before the upgrade to version 16.5 On “ealastix”

$result = $asm->Command(“queue show 3000”); was always returning good information as

request array:Privilege: Command 3000 has 0 calls (max unlimited) in ‘rrordered’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s Members: 2001 (Local/2001@from-queue/n from hint:2001@ext-local) (ringinuse enabled) (Unavailable) has taken no calls yet No Callers

above is exactly as command response appearing on CLI

but after upgrading to version 16.5 response is like following

$result = $asm->Command(“queue show 3000”); is returning something like following.

request result:Array
request array:Success
request array:Command output follows
request array:

please guide.

ADDY

Dont know what class are you using, but if is returning information as array try to use print_r() to output the array value. And please dont send me private messages unless you will pay for personal consultancy, I can reply for free but only on the public boardm if I have the time and knowldege about the issue posted

ok,

require_once(’/var/lib/asterisk/agi-bin/phpagi-asmanager.php’);
$asm = new AGI_AsteriskManager();
$asm->connect($AMSServer,$AMSUser,"$AMSPassword")
$result = $asm->Command(“queue show 3000”);

echo “request result:” . print_r( $result) . “
”;

output= “Array ( [Response] => Success [Message] => Command output follows [Output] => ) 1”

note the same is working fine with old version response as following.

Array ( [data] => Privilege: Command 3000 has 0 calls (max unlimited) in ‘rrordered’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s Members: 2001 (Local/2001@from-queue/n from hint:2001@ext-local) (ringinuse enabled) (Unavailable) has taken no calls yet No Callers [Response] => Follows ) print_r:1

I see now you have queue information using print_r()

this is from old version which is okay… issue i am facing on version 16

The format of the response to the CLI command action was changed:

AMI:
 - The Command action now sends the output from the CLI command as a series
   of Output headers for each line instead of as a block of text with the
   --END COMMAND-- delimiter to match the output from other actions.

   Commands that fail to execute (no such command, invalid syntax etc.) now
   return an Error response instead of Success.

If this is unsupported by the code, then it will fail.

what other way do i have to read the required information?

Don’t use that PHPP class because it was written for a previous version of Asterisk

sure we can change, please suggest the alternate and would be great if we can view sample also.

Thanks

<?php


$socket = fsockopen("127.0.0.1","5038", $errno, $errstr,10);
      if (!$socket){
        echo "$errstr ($errno)\n";
        }else{
            fputs($socket, "Action: Login\r\n");
            fputs($socket, "UserName: admin\r\n");
            fputs($socket, "Secret: 12349\r\n\r\n");
            fputs($socket, "Action: Command\r\n");
              fputs($socket, "Command: $argv[1]\r\n");

            fputs($socket, "Action: Logoff\r\n\r\n");

 while(!feof($socket)){

  $result=fgets($socket);



echo $result."<br>";

    if(stristr($result, 'Output:') == TRUE) {

exit();

}



}

}
fclose($socket);
?>

Message: Command output follows
Output: 3000 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

worked well (y), Thanks

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.