Playing an audio file to multicast

Here’s the issue, I have a video phone at the front door. It calls a queue group (working). After 15 seconds, it is to play a sound file to a multicast address and hang up.

Here is the dial plan

exten => 4001,1,Answer()
same => n,Set(TIMEOUT(absolute)=10)
same => n,Set(MUTEAUDIO(in)=on)
same => n,Dial(MulticastRTP/basic/239.255.0.1:4001,gA(/var/lib/asterisk/sounds/en/custom/ding-dong))
same => n,Hangup()

It works when I call from a normal phone, but when I call from the video phone, it complains about not being able to convert ding-dong to h264. Even though the “A” option to Dial is supposed to only play the sound to the called party, correct?

[2018-11-27 14:55:44] WARNING[11278][C-000017ab]: channel.c:5600 set_format: Unable to find a codec translation path: (alaw|ulaw|slin) -> (h264)
[2018-11-27 14:55:44] WARNING[11278][C-000017ab]: file.c:1245 ast_streamfile: Unable to open /var/lib/asterisk/sounds/en/custom/ding-dong (format (h264)): Function not implemented
[2018-11-27 14:55:44] ERROR[11278][C-000017ab]: app_dial.c:2857 dial_exec_full: error streaming file '/var/lib/asterisk/sounds/en/custom/ding-dong' to callee

Thoughts?

Seems some kind of transcoding issue.

Agreed, but firstly, why is Asterisk even trying to transcode it, when the “A” option should make it so that the caller (the video phone) doesn’t receive the audio from the sound file, only the callee–in this case the multicast address.

Is it possible that the door phone is also listening to that address?

Just double checked, no it isn’t.

Edit the audio file and save it as ulaw. It can be easily done with Audacity.

The file already is ulaw, there is a ulaw, alaw, and wav version of the file in the sounds directory. There is not an h264 version. When calling the ring group from a normal audio-only sip phone, asterisk properly sends the ulaw file to the multicast address. However, when calling from the video enabled phone, asterisks looks for an h.264 file to send.

I found a workaround, rather than Dialing the multicast address, I make a system call to ffmpeg

same => n,System(/usr/bin/ffmpeg -re -i /var/lib/asterisk/sounds/en/custom/dingdong.wav -filter_complex 'aresample=8000,asetnsamples=n=160' -ac 1 -vn -f rtp rtp://239.255.0.1:4001)

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.