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.
54 lines
1.3 KiB
54 lines
1.3 KiB
2 years ago
|
phpAMI 1.0
|
||
|
|
||
|
absoluteTimeout
|
||
|
Envia "ManagerAction_AbsoluteTimeout"
|
||
|
|
||
|
Cuelga el canal despues de cierto tiempo
|
||
|
|
||
|
return: ver eventSimple()
|
||
|
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_AbsoluteTimeout
|
||
|
array absoluteTimeout (string $channel, int $timeOut)
|
||
|
string $channel: Canal activo
|
||
|
int $timeOut: Tiempo de espera en segundos
|
||
|
|
||
|
-------------Interface AMI-------------
|
||
|
Action: AbsoluteTimeout
|
||
|
Channel: sip/iphone-xxxxxxxxxxxxx
|
||
|
Timeout: 10
|
||
|
|
||
|
Response: Success
|
||
|
Message: Timeout Set
|
||
|
---------------------------------------
|
||
|
|
||
|
----------------Ejemplo----------------
|
||
|
include "phpAMI.php";
|
||
|
$ami=new phpAMI("admin","admin");
|
||
|
$login=$ami->login();
|
||
|
if($login["Response"]=="Success"){
|
||
|
$status=$ami->status("ipphone");
|
||
|
if($status["ListInfo"]["Items"]>0){
|
||
|
print_r($ami->absoluteTimeout($status["List"][key($status["List"])]["Channel"],"10"));
|
||
|
}else{
|
||
|
echo "El Dispositivo ipphone no tiene Llamadas en este momento";
|
||
|
}
|
||
|
$ami->logoff();
|
||
|
}
|
||
|
---------------------------------------
|
||
|
|
||
|
----------Respuesta de phpAMI----------
|
||
|
Si el Canal existe y esta activo responde:
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Success
|
||
|
[Message] => Timeout Set
|
||
|
)
|
||
|
en este caso el canal se colgara en 10 segundos
|
||
|
|
||
|
Si en Canal no existe responde:
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Error
|
||
|
[Message] => No such channel
|
||
|
)
|
||
|
---------------------------------------
|