agsh / onvif

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

No message.subscriptionReference in Cam.prototype._eventPull #157

Closed AdyRock closed 4 years ago

AdyRock commented 4 years ago

I have two different cameras, one an H.View EV-8000 and the other is an unbranded bird box camera. Neither of these cameras return .subscriptionReference in the message obtained by Cam.prototype._eventPull and therefore crash the module on line 201: if (message.subscriptionReference.address === this.events.subscription.subscriptionReference.address.href) {

To work around this I have added a check and emit the event if subscriptionReference does not exist: if (!message.subscriptionReference || message.subscriptionReference.address === this.events.subscription.subscriptionReference.address.href) {

Both cameras can then process events perfectly. So is this a valid fix or am I doing something else wrong?

I am using the latest version downloaded from here.

AdyRock commented 4 years ago

Ignore this. I didn't have the latest version in the correct location so I was still using an old version. It looks fine in the new version

RogerHardiman commented 4 years ago

Hi Glad you got it working. I have not had time to investigate so I am glad you got it all working.

Thanks for the update.

Roger