agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
681 stars 231 forks source link

Event subscription fails due to malformed camera response #231

Open brendann993 opened 2 years ago

brendann993 commented 2 years ago

Not sure anyone else had this issue but sharing just in case. I have a camera that shows events in ODM but no events are ever captured by this library. While troubleshooting I identified that the camera is responding to the pullpoint subscription with <wsa5:To SOAP-ENV:mustUnderstand="true">http:///onvif/events_service?session=392</wsa5:To> The host is missing from the address and so when the library is attempting to connect to pull events its unable to connect. I tried using preserveAddress which allows the library to connect to the right endpoint e.g http://ipaddress/onvif/events_service?session=392 but the library then also sends the full url back to the camera in the payload and the camera rejects saying not subscription.

As a temporary work around I add the host bask into the urlAddress after the payload has been generated.

RogerHardiman commented 2 years ago

I wrote all the recent changes for the event handling and use it on another project so am interested in fixing this.

Out of interest, what is the make/model of camera you use.

I can work in your fix of populating the camera hostname/post with the hostname we first connected to, so a bit like what preserveAddress does for general ONVIF commands

But interested to know what camera this is.

Thanks Roger

brendann993 commented 2 years ago

Its a rebranded raysharp camera. Commonly sold in Australia rebranded as Swann and Concord. Very little details available but model is RS-CM-228A (concords model number is (CNC5IBP-A)

RogerHardiman commented 2 years ago

Hi Thanks for the info. In the UK there is lots of Swann CCTV kit. I've never tried any. Most of the projects I use the ONVIF library for have Axis, Bosch, Sony, Hik or Hanwha cameras.

agsh commented 2 years ago

It seems that we should have module with some dirty hacks supporting all cams with strange response :smile: But this work will take more than one day