Skip to content

Commit

Permalink
Remove subscriptionReference check in PullMessageResponse
Browse files Browse the repository at this point in the history
The ONVIF Core Spec is a bit vague but from what I can understand an Event message
that comes back from a PullMessage command does
not need to include a subscriptionReference (and HikVision don't send it)

If the library used the other events mechanism, where
the NVT sends a Notity message to this llibrary then we would check the subscriptionReference.
But this library does not support that method of events.

Thanks to
Michiel Mooring @Gielert who reported the issue
Nick Whyte @nickw444 - who has used this in his fork
  • Loading branch information
RogerHardiman committed Nov 2, 2019
1 parent abcf530 commit 7f33aa2
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,12 @@ module.exports = function(Cam) {
data.notificationMessage = [data.notificationMessage];
}
data.notificationMessage.forEach(function(message) {
// pull-point address check
if (message.subscriptionReference.address === this.events.subscription.subscriptionReference.address.href) {
/**
* Indicates message from device.
* @event Cam#event
* @type {Cam~NotificationMessage}
*/
this.emit('event', message);
}
/**
* Indicates message from device.
* @event Cam#event
* @type {Cam~NotificationMessage}
*/
this.emit('event', message);
}.bind(this));
}
this.events.terminationTime = _terminationTime(data);
Expand Down

0 comments on commit 7f33aa2

Please sign in to comment.