I’m using external media and trying to send back the audio with ffmpeg, but I don’t hear anything.
Everything is running on localhost (ARI application, ffmpeg).
I hear the audio coming from asterisk, but when I try to send the audio back to the RTP port of asterisk, I don’t get a sound. I get the port from the UNICASTRTP_LOCAL_PORT and UNICASTRTP_LOCAL_ADDRESS’: '127.0.0.1
Using this ffmpeg command:
ffmpeg -re -i gtts_output.wav -acodec pcm_alaw -ac 1 -ar 8000 -f rtp rtp://127.0.0.1:14836
← depending on the unicast rtp port
Output from ffmpeg:
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'gtts_output.wav':
Duration: 00:00:10.08, bitrate: 352 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_alaw (native))
Press [q] to stop, [?] for help
Output #0, rtp, to 'rtp://127.0.0.1:14478':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Metadata:
encoder : Lavc59.37.100 pcm_alaw
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=audio 14478 RTP/AVP 8
b=AS:64
size= 80kB time=00:00:10.07 bitrate= 65.1kbits/s speed= 1x
video:0kB audio:79kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.741763%
The external media channel was also created with the alaw format.
Enabled rtp debug on the asterisk cli.
The packets are coming:
Sent RTP packet to 127.0.0.1:45000 (type 08, seq 014597, ts 3932647640, len 000160) -> ARI application
Got RTP packet from 127.0.0.1:38566 (type 08, seq 002822, ts 1049953894, len 000743) -> ffmpeg back to asterisk
What is wrong here?