[asterisk-dev] Advanced Codec Negotiation: Need info and uses cases

Joshua C. Colp jcolp at sangoma.com
Thu Jun 25 11:14:17 CDT 2020


On Thu, Jun 25, 2020 at 7:39 AM Alex Hermann <alex-lists at wenlex.nl> wrote:

> On woensdag 3 juni 2020 22:17:52 CEST George Joseph wrote:
> > Now let's talk about format preference order.
>
> I haven't seen my use case pass by yet, so I'll throw it in...
>
> My use case is where Asterisk is functioning as a sort of SBC and needs
> to respect both party's codec preference, disallow unwanted codecs and
> reduce transcoding when possible.
>
> So, Alice should get to talk in her preferred codec, and Bob in his. The
> "allow" list of Asterisk is only used to filter out unwanted codecs. The
> ordering of codecs in the "allow" list is mostly ignored.
>
> To reduce transcoding The offer to Bob should contain the codecs in the
> order Alice offered them.
>
>
> Asterisk (13) forces the order of the "allow" list on each leg, so I
> have patched my Asterisk 13 with PJSIP to do approximately the above.
> This behaviour is best put under a config option like
> "prefer_remote_codec_order" on the endpoint.
>
>
> My Asterisk uses the following steps:
>
> 1) Retain the codec order from the offer received from Alice.
> 2) Filter out all codecs from the offer that are not in the allow list
> for Alice
> 3) Merge the list from step 2 with the allow list from Bob, but keep the
> ordering from the offer from Alice (prepend Alice's received list to
> Bob's and remove duplicates).
> 4) Filter list from step 3 with the allow list from Bob.
>
> The offer to Bob now contains all the codecs in his allow list, with the
> common codecs between Alice and Bob at the top of the list in the order
> Alice sent them.
>
> 5) On receiving the answer from Bob, retain his codec ordering
> 6) Answer Bob with the received codec ordering from himself
> 7) Use Bob's most preferred codec in his call leg
> 8) Answer Alice with the received codec ordering from herself
> 9) Use Alice's most preferred codec in her call leg
>
> 10) When Alice or Bob decides to switch the actual codec in the RTP to
> another codec from the negotioted list, adjust the codec on that leg
> only (to keep codecs symmetric), but don't change anything on the
> bridged leg.
>

I just want to chime in from a general sense on this. I don't expect all
functionality and every case someone thinks up will exist out of the gate,
but I want to say that at least providing such things helps ensure that the
fundamental design and implementation don't prohibit it from occurring in
the future. Like many things in Asterisk in recent times it starts with a
base, and then cool things get added and grow from it.

-- 
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20200625/13c494e8/attachment.html>


More information about the asterisk-dev mailing list