Remote host sends the audio data through HTTP session to the device to play out.
In two-way audio enabled device, it could accept the audio data from the remote host and play the audio data through its audio out interface. There is only one host could play the audio on the device at any time. The audio token in the device controls is used for this criterion. That means the host have to get the audio token first.
If audio token is not available, the error message, 503 Service Unavailable, will be returned.
Currently, the device just only accepts the PCM with 8KHz sample rate, 16bits/sample format.
In the multiple channel video server, the HTTP port of this command should be the HTTP port of the channel not the router.
The POST method is used in this URL command to send to the device. If there is no error code was replied from the device, the host could upload its audio data to the device. The multipart/x-mixed-replace in the content type is used during the upload. The length of every multipart boundary is 1024 bytes.
Important Note:
The type2 URL command is only avaliable command format for SEND_AUDIO. The URL command URI has to be /cgi-bin/cmd/encoder?SEND_AUDIO.Here is the network trace from host to the device as an example.POST /cgi-bin/cmd/encoder?SEND_AUDIO HTTP/1.1
Content-Type: multipart/x-mixed-replace;boundary=----------AoutBoundary
Connection: Keep-Alive
Cache-Control: no-cache
Authorization: Basic YWRtaW46MTIzNDU2----------AoutBoundary
Content-Type: audio/pcm
Content-Length: 1024....Audio raw data....
----------AoutBoundary
Content-Type: audio/pcm
Content-Length: 1024....Audio raw data....
....
None
None
None if everything is OK,
401 Unauthorized if fails of authentication,
503 Service Unavailable if it is not two-way audio device or audio token is not available,
404 Not Found if there is something wrong in the POST header.
Valid
None
http://ip:port/cgi-bin/cmd/encoder?SEND_AUDIO