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.
47 lines
1.8 KiB
47 lines
1.8 KiB
2 years ago
|
phpAMI 1.0
|
||
|
|
||
|
getConfigJSON
|
||
|
Envia "ManagerAction_GetConfigJSON"
|
||
|
|
||
|
Obtiene un archivo de configuracion en formato JSON
|
||
|
|
||
|
return: ver responceInfo()
|
||
|
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_GetConfigJSON
|
||
|
array getConfigJSON (string $file)
|
||
|
string $file: Archivo de configuracion
|
||
|
|
||
|
-------------Interface AMI-------------
|
||
|
Action: GetConfigJSON
|
||
|
Filename: sip.conf
|
||
|
|
||
|
Response: Success
|
||
|
JSON: {"general":["alwaysauthrejectyes","contextdefault","allowguestno","allowoverlapyes","autodomainyes","calleventsyes","udpbindaddrXXX.XXX.XXX.XXX:XXXX","languagees","dtmfmodeinfo","videosupportno","match_auth_usernameno","srvlookupyes","mohinterpretdefault","relaxdtmfyes","canreinviteyes"],"eltercera":["typefriend","contexthome","calleridTito Cell <12>","registertryingyes","secretXXXXXXXXX","hostdynamic","mailbox10@default"]}
|
||
|
---------------------------------------
|
||
|
|
||
|
----------------Ejemplo----------------
|
||
|
include "phpAMI.php";
|
||
|
$ami=new phpAMI("admin","admin");
|
||
|
$login=$ami->login();
|
||
|
if($login["Response"]=="Success"){
|
||
|
print_r($ami->getConfigJSON ("sip.con"));
|
||
|
$ami->logoff();
|
||
|
}
|
||
|
---------------------------------------
|
||
|
|
||
|
----------Respuesta de phpAMI----------
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Success
|
||
|
[Info] => Array
|
||
|
(
|
||
|
[JSON] => {"general":["alwaysauthrejectyes","contextdefault","allowguestno","allowoverlapyes","autodomainyes","calleventsyes","udpbindaddrXXX.XXX.XXX.XXX:XXXX","languagees","dtmfmodeinfo","videosupportno","match_auth_usernameno","srvlookupyes","mohinterpretdefault","relaxdtmfyes","canreinviteyes"],"eltercera":["typefriend","contexthome","calleridTito Cell <12>","registertryingyes","secretxxxxxxxxxxxxx","hostdynamic","mailbox10@default"]}
|
||
|
)
|
||
|
|
||
|
)
|
||
|
si el archivo no existe responde:
|
||
|
Array
|
||
|
(
|
||
|
[Response] => Error
|
||
|
)
|
||
|
---------------------------------------
|