<div dir="auto"><div><span style="color:rgb(53,53,53);font-family:merriweather,"times new roman",times,serif;font-size:medium;background-color:rgb(255,255,255)">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.</span><br><br><div data-smartmail="gmail_signature">So when you send OK with ulaw as first priority and get ACK most probably it will be ulaw</div><br><div class="gmail_quote"><div dir="ltr">בתאריך יום ו׳, 11 במאי 2018, 16:08, מאת Steve Edwards ‏<<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On Thu, May 10, 2018 at 11:44:14AM -0700, Steve Edwards wrote:<br>
<br>
>> I receive an INVITE/SDP containing:<br>
>><br>
>>      m=audio 11310 RTP/AVP 3 0 101<br>
>><br>
>> which I interpret as gsm, ulaw, rfc2833.<br>
>><br>
>> and I reply with an OK/SDP containing:<br>
>><br>
>>      m=audio 15884 RTP/AVP 0 3 101<br>
>><br>
>> which I interpret as ulaw, gsm, rfc2833.<br>
>><br>
>> How can I tell which codec was actually used for the call?<br>
<br>
On Fri, 11 May 2018, Daniel Tryba wrote:<br>
<br>
> AFAIK this is undetermined. The callee can send either ulaw or gsm,<br>
> unless the caller wants to narrow it down to 1 codec, see<br>
> <a href="https://tools.ietf.org/html/rfc4317#section-2.2" rel="noreferrer noreferrer" target="_blank">https://tools.ietf.org/html/rfc4317#section-2.2</a><br>
><br>
> Most of the time the callee will pick the first (so in this case ulaw).<br>
> But there are media gateways out there that choose g711[au] above "more<br>
> complex" codecs regardless order in SDP. My prefer PSTN provider will<br>
> always prefer alaw if offered since that will prevent transcoding on<br>
> their side if the call goes to ISDN/POTS, but AMR if the call goes to<br>
> VoLTE.<br>
<br>
So, without examining the RTP, you cannot tell which codec was actually <br>
used?<br>
<br>
In the above example, even though the INVITE/SDP says they prefer gsm over <br>
ulaw and the OK/SDP says I prefer ulaw over gsm, they can choose to use <br>
gsm or ulaw?<br>
<br>
Can it be asymmetrical? They send gsm and I send ulaw?<br>
<br>
-- <br>
Thanks in advance,<br>
-------------------------------------------------------------------------<br>
Steve Edwards       <a href="mailto:sedwards@sedwards.com" target="_blank" rel="noreferrer">sedwards@sedwards.com</a>      Voice: +1-760-468-3867 PST<br>
             <a href="https://www.linkedin.com/in/steve-edwards-4244281" rel="noreferrer noreferrer" target="_blank">https://www.linkedin.com/in/steve-edwards-4244281</a><br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div></div></div>