PABX da Simples IP
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.
 
 
 
 
 
 

100 lines
3.0 KiB

phpAMI 1.0
getConfig
Envia "ManagerAction_GetConfig"
Obtiene un archivo de configuracion
return: Array ( [Response] => Success [list] => Array ( [category] => Array ( [Variable] => Value [Variable] => Value )
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_GetConfig
array getConfig (string $file, [string $category = null])
string $file: Archivo de configuracion (ver astersik.conf)
string $category: Caregoria (default: null)
-------------Interface AMI-------------
Action: GetConfig
Filename: sip.conf
Response: Success
Category-000000: general
Line-000000-000000: alwaysauthreject=yes
Line-000000-000001: context=default
Line-000000-000002: allowguest=no
Line-000000-000003: allowoverlap=yes
Line-000000-000004: autodomain=yes
Line-000000-000005: callevents=yes
Line-000000-000006: udpbindaddr=XXX.XXX.XXX.XXX:XXX
Line-000000-000007: language=es
Line-000000-000008: dtmfmode=info
Line-000000-000009: videosupport=no
Line-000000-000012: match_auth_username=no
Line-000000-000013: srvlookup=yes
Line-000000-000014: mohinterpret=default
Line-000000-000015: relaxdtmf=yes
Line-000000-000016: canreinvite=yes
Category-000001: eltercera
Line-000001-000000: type=friend
Line-000001-000001: context=home
Line-000001-000002: callerid=Tito Cell <12>
Line-000001-000003: registertrying=yes
Line-000001-000004: secret=XXXXXXXXX
Line-000001-000005: host=dynamic
Line-000001-000006: mailbox=10@default
---------------------------------------
----------------Ejemplo----------------
include "phpAMI.php";
$ami=new phpAMI("admin","admin");
$login=$ami->login();
if($login["Response"]=="Success"){
print_r($ami->getConfig ("sip.conf"));
$ami->logoff();
}
---------------------------------------
----------Respuesta de phpAMI----------
Array
(
[Response] => Success
[list] => Array
(
[general] => Array
(
[alwaysauthreject] => yes
[context] => default
[allowguest] => no
[allowoverlap] => yes
[autodomain] => yes
[callevents] => yes
[udpbindaddr] => XXX.XXX.XXX.XXX:XXX
[language] => es
[dtmfmode] => info
[videosupport] => no
[match_auth_username] => no
[srvlookup] => yes
[mohinterpret] => default
[relaxdtmf] => yes
[canreinvite] => yes
)
[eltercera] => Array
(
[type] => friend
[context] => home
[callerid] => Tito Cell <12>
[registertrying] => yes
[secret] => XXXXXXXX
[host] => dynamic
[mailbox] => 10@default
)
)
)
Si el archivo no existe Responde:
Array
(
[Response] => Error
[Message] => Config file not found
)
---------------------------------------