Posting Audio Using HTTP API to a VTO Doorbell

Dec 23, 2021
3
1
AU
I am having issues using the HTTP API from Dahua to post an audio file to DHI-VTO2202F-P. Whatever I do, I always get 400 Bad Request from the doorbell.

Based on the outdated API specifications for Amcrest/Dahua, a POST request like that should do the trick:

POST /cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/1.1 Content-Type: Audio/G.711A
Content-Length: 9999999

I am not able to make a POST request with that Content-Length since it has to match the actual file size so I do a request like that:

curl --digest -verbose --request POST --url '' --header 'content-type: Audio/G.711A' --data-binary @DoorBell.wav

The "Content-Length" header is automatically added by curl and I always get 400 Bad Request from my doorbell.

I have attached the file I am trying to post. Can anyone try the same file with a Dahua doorbell (could be a different model) and share some ideas?
 

Attachments