nickw444 / zmonvif-events

A JS CLI tool that attempts to bridge the gap between your ONVIF camera's motion detection and Zoneminder.
8 stars 13 forks source link

change on onvif library #1

Open RogerHardiman opened 4 years ago

RogerHardiman commented 4 years ago

Hi there Just a bit of feedback on the project. I noticed you had to fork the agsh/onvif project to make a code change so you could receive events from a HikVision camera. Your commit was titled Dodgy fix to get ONVIF events to work with HikVision Cameras

Actually the fix is not dodgy at all. It was a geniune bug in the agsh/onvif library that came about through a bit of vagueness in the ONVIF Core Specification. The test of the subscriptionReference you removed is needed in the case where the Camera sends an Event to the Client. But the agsh/onvif library uses the PullMessage method of getting events so it should not be expecting a subscriptionReference in the XML.

So I'll commit your fix to the base agsh/onvif library.

Roger

nickw444 commented 4 years ago

Hi Roger, glad to hear this was helpful for you. Thanks for raising it upstream. Do you have a link to the PR in adsh/onvif?

RogerHardiman commented 4 years ago

Hi Nick The commit is https://github.com/agsh/onvif/commit/7f33aa2337d2aaa66d4c1407f724be2d032e5580

In another branch (called 'roger') I've been making more ONVIF Events changes.

I've fixed events from Axis Cameras. They used a slightly different PullPoint method that uses a SessionID in the XML. I've also fixed the NAT re-write code so it handles the PullPointSubscription for cameras behind NAT.

I'll be merging the 'roger' branch into master once I'm happy with it and @agsh has checked my code.

RogerHardiman commented 4 years ago

The ONVIF events changes have now been merged into the main agsh/onvif project. So would be good if you could test your project with the upstream library.

https://github.com/agsh/onvif/pull/127