From an offsite Milestone I’m pushing a Webhook back to our Headend Milestone to ideally trigger a rule. I can see the webhook via Wireshark and can capture using node.js but not sure how to get it into the Milestone Events API. I also can’t do a Generic Event because its JSON HTTP but not TCP to capture it. (all on our own VPN not connected to the internet)
Looking for some help or even a developer to help me build this out.
Webhooks use HTTP(S), so they should be able to trigger the Events API as long as you have a valid auth token. However, you mentioned TCP, which makes me think you might be referring to a WebSocket instead of a webhook.
If your communication is over raw TCP, I would suggest creating a middleware/controller in Node.js to:
Capture and read the incoming TCP stream.
Convert the TCP message into JSON.
Trigger the Events API with the formatted JSON data.
Since you’re using Node.js, try capturing and parsing the TCP stream, then make an API call to the Events API to see if it works as expected.
The Webhook is being pushed from another milestone server via a rule triggered by camera action.
I would like to capture this at our headend and that is what I’m having trouble with. Should I just see the entries come into the Event server (if so how) or should they be a generic event but that needs to be TCP I imagine.
If it can’t work low code perhaps you could point me in the direction of a Milestone Dev happy to scope out this work.
Your camera is triggering a rule within Milestone, and you want to capture this event. Once captured, you intend to send the event to your headend, which expects communication over TCP.
Alternatively, based on my previous experience, you could create a background plugin that runs on the event server. This plugin would listen for all events and, when triggered, send the event to your headend via TCP or HTTP(S).
Milestone XProtect Webhook functionality allows you to configure that upon event the XProtect sends a webhook.
Milestone XProtect does not have to functionality receive and use incoming webhooks.
I guess that this means webhooks cannot be used to push information from one XProtect site to another.
But looking at it differently: If you as a developer would like to develop an integration that makes events in a XProtect site it is possible. The source or trigger for those events could be anything, even webhooks originating from a Milestone XProtect or somewhere else.
I recommend one of these methods if you want to raise events…