forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
2 years ago
|
phpAMI 1.0
|
||
|
|
||
|
command
|
||
|
Envia "ManagerAction_Command"
|
||
|
|
||
|
Ejecuta un Comando CLI de Astersk
|
||
|
|
||
|
return: ver responceInfo()
|
||
|
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Command
|
||
|
array command (string $command)
|
||
|
string $command: Comando CLI
|
||
|
|
||
|
-------------Interface AMI-------------
|
||
|
Action: Command
|
||
|
Command: core show channels
|
||
|
|
||
|
Response: Follows
|
||
|
Privilege: Command
|
||
|
Channel Location State Application(Data)
|
||
|
0 active channels
|
||
|
0 active calls
|
||
|
34 calls processed
|
||
|
--END COMMAND--
|
||
|
---------------------------------------
|
||
|
|
||
|
----------------Ejemplo----------------
|
||
|
include "phpAMI.php";
|
||
|
$ami=new phpAMI("admin","admin");
|
||
|
$login=$ami->login();
|
||
|
if($login["Response"]=="Success"){
|
||
|
print_r($ami->command ("core show channels"));
|
||
|
$ami->logoff();
|
||
|
}
|
||
|
?>
|
||
|
---------------------------------------
|
||
|
|
||
|
----------Respuesta de phpAMI----------
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Follows
|
||
|
[Info] => Array
|
||
|
(
|
||
|
[Privilege] => Command
|
||
|
[0] => Channel Location State Application(Data)
|
||
|
[1] => 0 active channels
|
||
|
[2] => 0 active calls
|
||
|
[3] => 34 calls processed
|
||
|
[4] => --END COMMAND--
|
||
|
)
|
||
|
|
||
|
)
|
||
|
---------------------------------------
|