I am using an opensource PHP library to communicate to a Onvif capable IP camera.
There was one function missing in the library, GetSnapshotUri which returns an URL where one can get a snapshot of the main stream.
Here is the source: http://pastebin.com/ekJa4D2h
Here is main page:
<?php
require 'class.ponvif.php';
$onvif = new Ponvif();
$onvif->setUsername('admin');
$onvif->setPassword('admin');
$onvif->setIPAddress('192.168.1.100');
try
{
$onvif->initialize();
$sources = $onvif->getSources();
$profileToken = $sources[0][0]['profiletoken'];
$uri = $onvif->media_GetSnapshotUri($profileToken);
}
catch(Exception $e)
{
print $e;
}
?>
For some reason, the isFault function is true and i have no clue why.
The XML is valid, i checked it with Wireshark.
Does anybody have another camera to this if this works?
I have tried with 2 different camera's, Grandstream and Hikvision.
Also with ONVIF Device Manager v2.2.250 everything works as it should.
I know this is a long shot, but i have absolutely no clue.