Subscribe to event/snapshot via Dahua API

Jenny2552

n3wb
Jun 19, 2024
1
0
Czech Republic
Hi,
I have Dahua Access Controller (ASI6213S-PW) and I need to subscribe to its Face Recognition event from third party application in real time.
I don't need necessarilly the Face Recognition event, I just need to be notified which user got authenticated and by which method.

I found in their API docs endpoint for subscribing to the FaceRecognition: snapManager.cgi?action=attachFileProc&Flags[0]=Event&Events=[FaceRecognition] the request takes maybe 1 minute (sometimes timeouts) and does not return any content. And the endpoint for subscribing to the

There is also endpoint with eventManager.cgi, which does not work either.

I would like to avoid any http polling to Device cgi server, the ideal situation would be if the Dahua device could send a http request to my server with event after it happend.

I don't have available any documentation except for the DAHUA_HTTP_API_V3.26.
Also I found in Device setting "CGI actively registers" but have no idea what does it mean or what can I do with it. I put my server info there, but it seems to do nothing.
 
is snapmanager.cgi is not working in way that is blocking up to 60 seconds waiting for first matching event..
if it will happened - it will return it (or many)... if not, after 60 seconds will return nothing and You must repeat connection/request?

try use face to authorize after you run this request...

check is event name correct?

found same code using this cgi...


there is more on GitHub: