[asterisk-bugs] [JIRA] (ASTERISK-28751) Difficulty sending 16k slin16 back to Asterisk via External Media
Dan Jenkins (JIRA)
noreply at issues.asterisk.org
Thu Feb 20 11:26:25 CST 2020
[ https://issues.asterisk.org/jira/browse/ASTERISK-28751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Jenkins updated ASTERISK-28751:
-----------------------------------
Attachment: 16k.pcap
8k.pcap
> Difficulty sending 16k slin16 back to Asterisk via External Media
> -----------------------------------------------------------------
>
> Key: ASTERISK-28751
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-28751
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_ari_channels, Resources/res_rtp_asterisk
> Affects Versions: 16.2.0
> Reporter: Dan Jenkins
> Attachments: 16k.pcap, 8k.pcap
>
>
> Using External Media in ARI I can get slin16 16k out of Asterisk fine. I chop off the RTP header, swap endians and send it off to Google in this case.
> Google then sends me back 16k "Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header." So I remove the wav header and swap the endians and then send it back to Asterisk as RTP - 640 bytes at a time (plus the RTP header with a type of 118 which is hard coded into rtp engine in Asterisk as 16k slin16), every 20ms. Asterisk gets the media but I hear nothing.
> So instead I told Google to give me back 8k slin16 instead, i change the rtp type to 11 (which is supposedly for 44100 but you know...) and send back 320 bytes at a time and it works! I get great audio.
> This is all very difficult to reproduce easily using Dialogflow so I've created a branch of my project to just use two files from Asterisk's audio library - zombies! I took the slin16 and the wav version. The wav version is 8k, the slin16 is 16k (I think.... pretty sure)
> So now, my test app on a new call, immediately starts playing back the media file in question. And I can reproduce the results entirely.
> Now - before you look at the pcaps of the audio, I know im not 100% forming my RTP header properly - but from what I understand, enough of it should be "correct" to make things work.
> So you need the ARI bridge project and you need the rtp audio server project (with the jared branch)
> Oh another thing.... if you look at the code and the module I'm using to create an RTP Packet you'll see it thinks the largest RTP packet is 512 bytes... which is obviously wrong. So I change that locally to 652 trying with 16k audio.....
> https://github.com/nimbleape/asterisk-dialogflow-ari-bridge
> https://github.com/nimbleape/asterisk-dialogflow-rtp-audioserver/tree/jared
> I'm pretty perplexed as to why this doesnt work.
> (I have another issue where if i send audio back using my mac..... it works for 8k, if i send audio back using the same app on linux it doesnt work)
> I'd love some help figuring out who's doing something wrong here. It's probably me... but it feels like I'm doing everything "right"
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list