> On Thu, May 10, 2018 at 11:44:14AM -0700, Steve Edwards wrote:>> I receive an INVITE/SDP containing: >> >> m=audio 11310 RTP/AVP 3 0 101 >> >> which I interpret as gsm, ulaw, rfc2833. >> >> and I reply with an OK/SDP containing: >> >> m=audio 15884 RTP/AVP 0 3 101 >> >> which I interpret as ulaw, gsm, rfc2833. >> >> How can I tell which codec was actually used for the call?On Fri, 11 May 2018, Daniel Tryba wrote:> AFAIK this is undetermined. The callee can send either ulaw or gsm, > unless the caller wants to narrow it down to 1 codec, see > https://tools.ietf.org/html/rfc4317#section-2.2 > > Most of the time the callee will pick the first (so in this case ulaw). > But there are media gateways out there that choose g711[au] above "more > complex" codecs regardless order in SDP. My prefer PSTN provider will > always prefer alaw if offered since that will prevent transcoding on > their side if the call goes to ISDN/POTS, but AMR if the call goes to > VoLTE.So, without examining the RTP, you cannot tell which codec was actually used? In the above example, even though the INVITE/SDP says they prefer gsm over ulaw and the OK/SDP says I prefer ulaw over gsm, they can choose to use gsm or ulaw? Can it be asymmetrical? They send gsm and I send ulaw? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281
On Fri, May 11, 2018, at 10:07 AM, Steve Edwards wrote: <snip>> > So, without examining the RTP, you cannot tell which codec was actually > used?>From an Asterisk perspective "core show channel" will also show you what is currently flowing.> In the above example, even though the INVITE/SDP says they prefer gsm over > ulaw and the OK/SDP says I prefer ulaw over gsm, they can choose to use > gsm or ulaw?Yes.> Can it be asymmetrical? They send gsm and I send ulaw?Technically, yes. In practice it's a bit iffy - specifically because some DSPs in devices won't allow it - they require a single codec be in use for each direction. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org
On Fri, 11 May 2018, Joshua Colp wrote:>> In the above example, even though the INVITE/SDP says they prefer gsm >> over ulaw and the OK/SDP says I prefer ulaw over gsm, they can choose >> to use gsm or ulaw? > > Yes. > >> Can it be asymmetrical? They send gsm and I send ulaw? > > Technically, yes. In practice it's a bit iffy - specifically because > some DSPs in devices won't allow it - they require a single codec be in > use for each direction.So, Asterisk will defer it's choice of codec to match the codec it detects in the incoming stream? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281
The unwritten rule of SDP is that if possible you use the first codec of a type listed, but you don?t have to. If the sender says he can do something, he had better be prepared to handle media of that type no matter in what order it was listed. So when you send OK with ulaw as first priority and get ACK most probably it will be ulaw ?????? ??? ??, 11 ???? 2018, 16:08, ??? Steve Edwards ?< asterisk.org at sedwards.com>:> > On Thu, May 10, 2018 at 11:44:14AM -0700, Steve Edwards wrote: > > >> I receive an INVITE/SDP containing: > >> > >> m=audio 11310 RTP/AVP 3 0 101 > >> > >> which I interpret as gsm, ulaw, rfc2833. > >> > >> and I reply with an OK/SDP containing: > >> > >> m=audio 15884 RTP/AVP 0 3 101 > >> > >> which I interpret as ulaw, gsm, rfc2833. > >> > >> How can I tell which codec was actually used for the call? > > On Fri, 11 May 2018, Daniel Tryba wrote: > > > AFAIK this is undetermined. The callee can send either ulaw or gsm, > > unless the caller wants to narrow it down to 1 codec, see > > https://tools.ietf.org/html/rfc4317#section-2.2 > > > > Most of the time the callee will pick the first (so in this case ulaw). > > But there are media gateways out there that choose g711[au] above "more > > complex" codecs regardless order in SDP. My prefer PSTN provider will > > always prefer alaw if offered since that will prevent transcoding on > > their side if the call goes to ISDN/POTS, but AMR if the call goes to > > VoLTE. > > So, without examining the RTP, you cannot tell which codec was actually > used? > > In the above example, even though the INVITE/SDP says they prefer gsm over > ulaw and the OK/SDP says I prefer ulaw over gsm, they can choose to use > gsm or ulaw? > > Can it be asymmetrical? They send gsm and I send ulaw? > > -- > Thanks in advance, > ------------------------------------------------------------------------- > Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST > https://www.linkedin.com/in/steve-edwards-4244281 > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180511/04300ac1/attachment.html>