[asterisk-dev] Media Formats: ast_best_codec and cached formats questions

Matthew Jordan mjordan at digium.com
Sun Jun 22 09:42:38 CDT 2014


A few questions for those working on the media format improvements:

1) ast_best_codec: This function is supposed to pick the best format
from a capabilities structure and return it, best being decided by a
hard coded list within Asterisk. Luckily, chan_sip/chan_pjsip no
longer use this.

I don't think we really want to enforce a prioritization of formats -
doing so has historically been bad for Asterisk (plenty of e-mails and
bug reports on this subject). Rather, if you've configured a device to
support a particular list of formats, then that is the list we use in
the order you've specified.

Since this was historically called by lots of channel drivers, I'm
recommending we keep it but make it return the first format in the
capability structure (the highest priority format). For most users of
this function - who typically take the format and insert it into the
capabilities structure at position 0 - that's a NoOp.

For the rest of the core, I say we remove usage of this function.

2) Cached formats: who is supposed to define these things? Thanks to
Corey's patches compilation succeeds, but linking fails big time. I'm
not sure where/who the creator of these structures is supposed to be.

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-dev mailing list