Improve compatibility with Synology Surveillance Station's ONVIF implementation (Fix Motion Event Subscription) - #6
Open
erocm123 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve compatibility with Synology Surveillance Station's ONVIF implementation.
This PR fixes several interoperability issues that prevented Synology from successfully discovering motion event capabilities, creating event subscriptions, and receiving motion events from Thingino ONVIF devices. The changes are limited to the affected ONVIF Media and Events operations and preserve existing behavior for other clients.
Changes
1. Allow unauthenticated
GetEventPropertiesSynology requests
GetEventPropertiesbefore authenticating during camera discovery. Previously this request returned HTTP 401, preventing Surveillance Station from learning the supported event topics.This PR classifies
GetEventPropertiesthe same way as the other ONVIF Events subscription lifecycle operations that are already handled as pre-auth requests.Why this is safe
GetEventPropertieschanges.2. Return a synthetic
CreateProfileresponse for Synology modeDuring camera setup, Synology always issues a
CreateProfilerequest even though Thingino uses fixed profiles.Previously this request returned a
MaxNVTProfilesSOAP fault, causing Surveillance Station to abort camera setup.When
adv_synology_nvris enabled, the server now returns a temporary synthetic profile (SynoProfileToken) instead of a fault. The profile exists only to satisfy the setup workflow and does not modify any real camera configuration.Why this is safe
adv_synology_nvris enabled.3. Allow deletion of the synthetic profile
After setup, Synology deletes the temporary profile it created.
The existing implementation correctly rejects deletion of fixed camera profiles, but now recognizes the synthetic
SynoProfileTokenand returns a successfulDeleteProfileresponse only for that token.Why this is safe
DeletionOfFixedProfileexactly as before.4. Improve
GetEventPropertiestopic generationThe generated ONVIF TopicSet now preserves the namespace for nested topic elements (for example,
tns1:VideoSource/tns1:MotionAlarm) instead of only applying the namespace to the first level.This matches the structure expected by clients parsing the advertised topic hierarchy.
Why this is safe
5. Advertise the standard
VideoSource/MotionAlarmschemaFor the
VideoSource/MotionAlarmtopic,GetEventPropertiesnow advertises:Source(tt:ReferenceToken)State(xsd:boolean)The existing
CellMotionDetector/Motionschema remains unchanged (VideoSourceConfigurationToken/IsMotion).Why this is safe
VideoSource/MotionAlarmchanges.CellMotionDetector/Motionclients are unaffected.6. Match runtime event payloads to the advertised schema
Runtime
PullMessagesnotifications now emit:VideoSource/MotionAlarmSourceStateCellMotionDetector/MotionVideoSourceConfigurationTokenIsMotionThis keeps runtime notifications consistent with the metadata advertised by
GetEventProperties.Why this is safe
VideoSource/MotionAlarmpayloads change.CellMotionDetector/Motionnotifications remain unchanged.Compatibility
These changes are intentionally narrow in scope.
CellMotionDetector/Motionnotifications are preserved.adv_synology_nvris enabled.These changes were validated against Synology Surveillance Station and resolve camera discovery, event subscription, and motion event recognition while minimizing impact to other ONVIF clients.