[asterisk-dev] Asterisk 18 Planning: Codec Negotiation

Kevin Harwell kharwell at digium.com
Thu Jan 30 09:49:52 CST 2020


On Thu, Jan 30, 2020 at 4:55 AM Michael Maier <m1278468 at mailbox.org> wrote:

> ....
>
> Could the planned codec handling globally described like this:
>
>
Overall I think you have the gist of it. See below, though, for a couple of
clarifications.


>
> The codec handling is based on 4 lists.
>
> 1. incoming_sdp_receive_prefs
>    This list is created based on the allow line
>    of the callers extension and the SDP offer of
>    the phone (local ...).
>
>    Or:
>
>    This list is created based on the SDP offer of
>    the caller and the allow line of the extension
>    (remote).
>
>    Codecs not given in the callers allow line are
>    dropped. Both list variants may have a
>    different codec order.
>
>
> 2. outgoing_sdp_send_prefs
>    The list can be created on base of the callees
>    allow line and list 1 (option local ...).
>
>    Or:
>
>    The list can be created on base of list 1
>    (option remote ...) and the callees allow line.
>
>    Both lists may have a different codec order or
>    different codecs (if *_single is provided).
>
>    Codecs not given in the callees allow line or
>    list 1 are dropped (*_limit).
>
>
This is mostly correct, but for clarification selecting the "remote" or
"local" value will always only contain those codecs from the endpoint
configuration allow line. Or another way to say it is the resulting list is
the intersection of the two lists (list 1 and allow=) plus the codecs in
the allow line that are not in list 1. The order will change depending on
which value is used.

This means that if list 1 contains a codec not found in the endpoints
allow= line then that codec will not be included in the resulting list. For
example;

list 1 = opus,ulaw,alaw
allow= ulaw, alaw, g722

Then if "remote" or "local" is chosen then the resulting list will never
have opus in it. Unless for some reason folks think it would make sense to
make an offer to a device containing codec(s) that were not part of its
Asterisk endpoint configuration definition.


>
> 3. outgoing_sdp_receive_prefs
>    The list is created based on the received SDP
>    and list 2 (remote ...).
>
>    Or:
>
>    The list is based on list 2 and the received
>    SDP.
>
>    These list variants may provide different codec
>    orders or different codecs (if *_single is
>    provided).
>
>    This list only contains codecs which can be
>    found in the received SDP and in list 2 at the
>    same time.
>
>
> 4. incoming_sdp_send_prefs
>    This list is created based on list 3 and 1
>    (remote ...)
>
>    Or
>
>    the list is based on 1 and 3 (local ...).
>
>    The Codec order may differ between those
>    variants.
>
>    This list only contains codecs which can be
>    found in list 3 and 1 at the same time
>    (*_limit).
>
>
Again this is mostly the case, but pretty much the same description from
above applies here too, i.e. the resulting list will never have codecs in
it that were not part of list 1.

-- 
Kevin Harwell
Senior Software Developer
Sangoma Technologies
Check us out at: https://sangoma.com & https://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20200130/f42f919f/attachment-0001.html>


More information about the asterisk-dev mailing list