Hi, guys!
I hope, that spent time for creating this PHP code will help someone else here:
This works with iDS-TCM-403 cameras, you need to check the correct ISAPI syntax for your camera, to put to work this code.
------------------------------------------------------------------
<?php
require_once "HTTP/Request2.php";
/Camera URL&Uri settings
$urlmain = 'http://someIP:someport';
/Get ITC Capabilities
/$urimain = '/ISAPI/ITC/capabilities';
/Get the camera traffic detection mode/true/false
/$urimain = '/ISAPI/ITC/TrafficParam';
/restart camera
$urimain = '/ISAPI/System/reboot';
/ Explicitly set request method and use_brackets
$request = new HTTP_Request2($urlmain.$urimain,
HTTP_Request2::METHOD_PUT, array('use_brackets' => true));
/Digest authentication to the camera
$request->setAuth('someuser', 'somepassowrd', HTTP_Request2::AUTH_DIGEST);
/Request for getting info
$url = $request->getUrl();
$url->setQueryVariables(array(
'package_name' => array('HTTP_Request2', 'Net_URL2'),
'status' => 'Open'
));
$url->setQueryVariable('cmd', 'display');
/ This will output the camera response in the console
echo $request->send()->getBody();
?>
----------------------------------------------------------------------
Please, note, when want to use some of the other commands, you need only one $urimain to be uncommented and for every command, correct method have to be set (the method is METHOD_GET for the $urimain = '/ISAPI/ITC/capabilities'; , for example). someIP, someport, someuser and somepassword have to be set in the code.
P.S. If someone knows there a PUT command to soft reset a camera, will be grateful,thanks!
I hope, that spent time for creating this PHP code will help someone else here:
This works with iDS-TCM-403 cameras, you need to check the correct ISAPI syntax for your camera, to put to work this code.
------------------------------------------------------------------
<?php
require_once "HTTP/Request2.php";
/Camera URL&Uri settings
$urlmain = 'http://someIP:someport';
/Get ITC Capabilities
/$urimain = '/ISAPI/ITC/capabilities';
/Get the camera traffic detection mode/true/false
/$urimain = '/ISAPI/ITC/TrafficParam';
/restart camera
$urimain = '/ISAPI/System/reboot';
/ Explicitly set request method and use_brackets
$request = new HTTP_Request2($urlmain.$urimain,
HTTP_Request2::METHOD_PUT, array('use_brackets' => true));
/Digest authentication to the camera
$request->setAuth('someuser', 'somepassowrd', HTTP_Request2::AUTH_DIGEST);
/Request for getting info
$url = $request->getUrl();
$url->setQueryVariables(array(
'package_name' => array('HTTP_Request2', 'Net_URL2'),
'status' => 'Open'
));
$url->setQueryVariable('cmd', 'display');
/ This will output the camera response in the console
echo $request->send()->getBody();
?>
----------------------------------------------------------------------
Please, note, when want to use some of the other commands, you need only one $urimain to be uncommented and for every command, correct method have to be set (the method is METHOD_GET for the $urimain = '/ISAPI/ITC/capabilities'; , for example). someIP, someport, someuser and somepassword have to be set in the code.
P.S. If someone knows there a PUT command to soft reset a camera, will be grateful,thanks!