<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 25, 2020 at 4:39 AM Alex Hermann <<a href="mailto:alex-lists@wenlex.nl">alex-lists@wenlex.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On woensdag 3 juni 2020 22:17:52 CEST George Joseph wrote:<br>
> Now let's talk about format preference order.<br>
<br>
I haven't seen my use case pass by yet, so I'll throw it in...<br>
<br>
My use case is where Asterisk is functioning as a sort of SBC and needs <br>
to respect both party's codec preference, disallow unwanted codecs and <br>
reduce transcoding when possible.<br>
<br>
So, Alice should get to talk in her preferred codec, and Bob in his. The <br>
"allow" list of Asterisk is only used to filter out unwanted codecs. The <br>
ordering of codecs in the "allow" list is mostly ignored.<br>
<br>
To reduce transcoding The offer to Bob should contain the codecs in the <br>
order Alice offered them.<br>
<br></blockquote><div><br></div><div>That will certainly be supported.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Asterisk (13) forces the order of the "allow" list on each leg, so I <br>
have patched my Asterisk 13 with PJSIP to do approximately the above. <br>
This behaviour is best put under a config option like <br>
"prefer_remote_codec_order" on the endpoint.<br>
<br>
<br>
My Asterisk uses the following steps:<br>
<br>
1) Retain the codec order from the offer received from Alice.<br>
2) Filter out all codecs from the offer that are not in the allow list <br>
for Alice<br>
3) Merge the list from step 2 with the allow list from Bob, but keep the <br>
ordering from the offer from Alice (prepend Alice's received list to <br>
Bob's and remove duplicates).<br>
4) Filter list from step 3 with the allow list from Bob.<br>
<br>
The offer to Bob now contains all the codecs in his allow list, with the <br>
common codecs between Alice and Bob at the top of the list in the order <br>
Alice sent them.<br></blockquote><div><br></div><div>So far, so good.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
5) On receiving the answer from Bob, retain his codec ordering<br>
6) Answer Bob with the received codec ordering from himself<br>
7) Use Bob's most preferred codec in his call leg<br>
8) Answer Alice with the received codec ordering from herself<br>
9) Use Alice's most preferred codec in her call leg<br>
<br>
10) When Alice or Bob decides to switch the actual codec in the RTP to <br>
another codec from the negotioted list, adjust the codec on that leg <br>
only (to keep codecs symmetric), but don't change anything on the <br>
bridged leg.<br></blockquote><div><br></div><div>I have to think through this one.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Alex Hermann<br>
<br>
<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><div dir="ltr" style="font-size:12.8px"><div style="font-family:tahoma,sans-serif;font-size:small"><span style="color:rgb(7,55,99)">George Joseph</span><br></div></div><div dir="ltr" style="font-size:small"></div><div style="font-family:tahoma,sans-serif;font-size:small"><span style="color:rgb(7,55,99)">Asterisk Software Developer</span><br></div><span style="color:rgb(7,55,99);font-family:tahoma,sans-serif;font-size:small">direct/fax +1 256 428 6012</span><br><div style="font-family:tahoma,sans-serif;font-size:small"><font color="#073763" style="--darkreader-inline-color:#97cdf8;">Check us out at</font> <a href="http://www.sangoma.com/" style="color:rgb(17,85,204)" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a><br></div><div style="font-family:tahoma,sans-serif;font-size:small"><img src="cid:ii_k3abte590" alt="image.png" width="184" height="32" style="margin-right: 0px;"></div></div></div></div></div></div></div></div></div>