Onvif
Onvif copied to clipboard
The action requested requires authorization and the sender is not authorized
Hello, I try to use inside Laravel project and always return this message. The camera is a PTZ Hikvision and works fine with PYTHON ONVIF R resource
$o = new \Rockyjvec\Onvif\Onvif("http://".$session->camera->host.":".$session->camera->port."/onvif/device_service", $session->camera->onvif_user, $session->camera->onvif_pass);
print_r($o->media->GetProfiles());
Output
{
"status": "error",
"code": 500,
"time": 1642591673,
"data": {
"line": 61,
"file": "...../vendor/rockyjvec/onvif/src/Rockyjvec/Onvif/Soap/SoapClient.php",
"message": "The action requested requires authorization and the sender is not authorized",
"type": "Exception"
}
}
Thanks!
The same thing happens to me, but when I try to get the recordings from the camera, with this code:
$onvif->recording->GetRecordings()