HTTP - How to trigger pre-recorded announcement message by HTTP command
With 2N® SIP Audio Converter or 2N® SIP Speaker, you are able to upload your own announcement messages. Message can be recorded directly via your microphone or you can upload previously recorded audio file into the device.
Info
Your audio file has to fulfill certain requirements, to be able to upload the audio file into the device. Parameters of the audio file are:
- WAV format
- PCM encoding with 8 kHz sampling frequency
- 8/16-bit sample resolution
- File size up to 256 kB (in case of 2N® SIP Audio Converter/SIP Speaker) or up to 2 MB (in case of 2N® SIP Horn Speaker)
- Maximum file playing time up to 16 seconds (for 8-bit resolution) or 8 seconds (16-bit resolution).
You can verify available licenses in the section System -> licence. Here you can see that the Enhanced Audio license is activated. This means that you don't need any additional licenses to be able to upload your own user sounds.
Figure 1: License verification
Info
By default you don't need any license to be able to use User sounds.
You can upload your user sounds in the section Services -> User Sounds. First tab that you will see is the Sound Mapping. In this section you are able to assign your uploaded user sounds to some specific actions such as ringing tone.
Figure 2: Sound mapping
The next tab is used for the uploading of the user sounds. You can upload the audio file by using (upload button) or you can record your own announcement directly from the web browser by using (record button).
Figure 3: User sound upload
The last step is to setup the automation commands which will allow you to trigger the announcement by the HTTP command.
Figure 4: Automation commands
First you have to use the command called Event.HttpTrigger. This is used for the detection of the incoming http command. Event.HttpTrigger has only 1 parameter which is the name and it is basically the keyword based on which the audio file will be played. I have used keyword "play" in this example. Second command is the Action.PlayUserSound. You have to specify the event based on which this action will be performed. In this example we have only 1 event which has ID=1. Second parameter is sound. You can select up to 10 user sounds. In this example the user sound has been uploaded into the first slot (see figure 3). Now once the device will receive HTTP command containing the keyword play, the user sound in position 1 will be played.
Info
For more details regarding to the automation commands, please take a look on the following website:
The HTTP command can be sent directly via web browser or via 3rd party systems or applications that are able to send HTTP commands. In this example the following HTTP command has been used http://192.168.50.251/enu/trigger/play
IMPORTANT
Info
Structure of the http command:
- http://<ip address>/enu/trigger/<name parameter>