Asterisk now has the ability to store attribute information about formats with the format itself. This allows more information to be exchanged but there still presents the problem of interpreting and generating this additional attribute information. Up to this point the SDP logic for doing so has been placed within chan_sip itself. This is not a very good solution for attributes because they should be interpreted by logic deeply familiar with the format itself. Placing this logic within chan_sip further fragments the code and does not allow additional codecs to be easily added.
I propose extending the ast_format_attr_interface interface to include SDP parsing and generation callbacks.
The SDP parsing callback function would take the format structure and the format specific SDP information, interpret the SDP information, and convert them into suitable Asterisk format attributes.
The SDP generation callback would take the format structure and the SDP buffer, convert the Asterisk format attributes into SDP, and add them to the SDP buffer.
This would place the interpretation and generation into the hands of the format module which is aware of the format and take it out of chan_sip.