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.
56 lines
1.1 KiB
56 lines
1.1 KiB
2 years ago
|
phpAMI 1.0
|
||
|
|
||
|
getVar
|
||
|
Envia "ManagerAction_Getvar"
|
||
|
|
||
|
Obtiene el valor de una variable Global o de canal
|
||
|
|
||
|
return: ver responceInfo()
|
||
|
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Getvar
|
||
|
array getVar (string $var, [string $channel = null])
|
||
|
string $var: Nombre de la variable
|
||
|
string $channel: canal (Default: null)
|
||
|
|
||
|
-------------Interface AMI-------------
|
||
|
Action: Getvar
|
||
|
Variable: hola
|
||
|
|
||
|
Response: Success
|
||
|
Variable: hola
|
||
|
Value: quetal
|
||
|
---------------------------------------
|
||
|
|
||
|
----------------Ejemplo----------------
|
||
|
include "phpAMI.php";
|
||
|
$ami=new phpAMI("admin","admin");
|
||
|
$login=$ami->login();
|
||
|
if($login["Response"]=="Success"){
|
||
|
print_r($ami->getVar("hola"));
|
||
|
$ami->logoff();
|
||
|
}
|
||
|
---------------------------------------
|
||
|
|
||
|
----------Respuesta de phpAMI----------
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Success
|
||
|
[Info] => Array
|
||
|
(
|
||
|
[Variable] => hola
|
||
|
[Value] => quetal
|
||
|
)
|
||
|
|
||
|
)
|
||
|
Si la variable no esxite responde con el valor ""
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Success
|
||
|
[Info] => Array
|
||
|
(
|
||
|
[Variable] => hola
|
||
|
[Value] =>
|
||
|
)
|
||
|
|
||
|
)
|
||
|
---------------------------------------
|