Request for help with control scripts
Posted: Fri Dec 09, 2016 4:42 pm
I have looked all over for some details about the interface with camera PTZ control scripts and I cannot seem to find anything which describes the variables being passed between ZM and a specific control script. I am not a competent perl programmer, so I may simply be struggling with the syntax. For example, there appears to be an object in the control script $req which is the http string to be sent to the camera. It has components ($req->uri() for example) and I cannot seem to figure out how to reference the full http command string. I also dont know how to list all of the components of the class $req, so I may be using the totally wrong variable. It appears to be a hash, but I dont seem to understand how to enumerate the hash values. Q: How do I expose the whole string being sent to the camera?
Below is the line of code I'm using to post the response from the camera $res->status_line() and my attempt to show the command string $req in the log stream, but all I get for the $req value is "HASH(0x2d0cf88)" The camera responds "200 OK" every time.
Also, some fiddling with these scripts has led me to the conclusion that if I make a change to the script file, the changed script file is not reread by the system. Apparently, I hafta close the camera monitor display, then disable the monitor (in the console) which uses it, and save that, and then re-enable the monitor and save that, then re-open the specific camera in order for the system to "see" the change made to the script file. Q: Is there an easier way to force a re-read of the control script, instead of this complex process? With my limited knowledge of perl, Im having to trial-and-error this, and its a pain to go through all that for every change to the script file.
Any help from the experts would be appreciated.
Below is the line of code I'm using to post the response from the camera $res->status_line() and my attempt to show the command string $req in the log stream, but all I get for the $req value is "HASH(0x2d0cf88)" The camera responds "200 OK" every time.
Code: Select all
Error( "Control command result: '".$res->status_line()."' for URL ".$req );
Any help from the experts would be appreciated.