alert stream

Joined
Jun 2, 2024
Messages
1
Reaction score
0
Location
medan
how can i detect this endpoint /ISAPI/Event/notification/alertStream stop suddenly?
when the device die, there isnt null response get from the deivce i cant recognize the end of stream then my app wont terminate
anyone can help???
 

trempa92

Getting comfortable
Joined
Mar 26, 2020
Messages
902
Reaction score
290
Location
Croatia,Zagreb
You need to do heartbeat every x seconds. Hikvision default is 30s for their devices web interface.

1717396613595.png

If you get anything other than 200 , something is wrong.

So lets say you run 2 services together, 1 for checking device status. other for fetching data.

Once device status is offline, make a cancellation token with request timed out.
Once the status has been restored, restart the alrtstream service.

Other option is to run HTTP Listener instead of alertStream http transmission.
You can set up your server ip at camera settings where event push will be and on what port.
This way your server side needs to have TCP server listener on certain port. And there you can track incoming data with connect/disconnect
 

trempa92

Getting comfortable
Joined
Mar 26, 2020
Messages
902
Reaction score
290
Location
Croatia,Zagreb
You might aswell use any GET endpoint, if device is offline you wont get anything anyway. Could be capabilities or any other GET information
 

AmyColeman

n3wb
Joined
May 27, 2024
Messages
2
Reaction score
0
Location
US
Yes, it happened to me, but everything started working when it went online.
 
Top