Update:
SIP sembra completamente disabilitato... Se chiamo "GetSIPAccountSettings" a mezzo API mi da "method not found"
Script:
(Ho notato che con GetUsageSettings si può vedere il traffico usato ... forse utile per qualcuno, ma devo ancora controllare se i dati ritornati del api sono corretto).
<?php
$headers = [ '_TclRequestVerificationKey: XXX', '_TclRequestVerificationToken: XXX'];
$payload = array(
"id"=>"0",
"jsonrpc"=>"2.0",
// "method"=>"GetUsageSettings", // traffico
"method"=>"GetSIPAccountSettings",
"params"=>"{}"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_URL, "http://192.168.1.1/jrd/webapi");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$result = curl_exec($ch);
$result = json_decode($result, true);
if (isset($result["error"]["message"])) {
echo("ERROR: " .$result["error"]["message"]);
} else {
var_dump($result);
// $result["result"]["UsedData"] / pow(1024, 3) . "\n"; // traffico
}
?>
```