[asterisk-dev] unable to pass default attribute_data from codec_xyz.c to res_format_attr_xyz.c

Mohit Dhiman mohitdhiman736 at gmail.com
Wed Aug 28 06:10:06 CDT 2019


Ok.
could it be related to the order in which modules get loaded in asterisk?
also can you please suggest some way to pass this information somehow from
codec_xyz.c to ref_format_attr_xyz.c?
because I believe codec_opus.so does this sort of thing.

On Wed, 28 Aug 2019 at 15:28, Joshua C. Colp <jcolp at digium.com> wrote:

> On Tue, Aug 27, 2019, at 7:41 AM, Mohit Dhiman wrote:
> > Hi,
> > I am trying to pass default data from codec_xyz.c to
> res_format_attr_xyz.c
> >
> > what I did:
> >  * main/codec_builtin.c: ast_codec_builtin_init: made a call to
> > CODEC_REGISTER_AND_CACHE(xyz)
> >  * codecs/codec_xyz.c: load_module: get the codec. xyz_codec =
> > ast_codec_get()
> >  * codecs/codec_xyz.c: load_module: format =
> > ast_format_create_named("xyz", xyz_codec)
> >  * codecs/codec_xyz.c: load_module: initialized struct xyz_attr in
> > variable attr
> >  * codecs/codec_xyz.c: load_module:
> > ast_format_set_attribute_data(format, attr);
> >  * codecs/codec_xyz.c: load_module: ast_format_cache_set(format);
> >
> > problem is that attribute_data in callback format_generate_sdp_fmtp of
> > res_format_attr_xyz.c is NULL
> > and not what was initialized in codec/codec_xyz.c
>
> You'd need to follow the complete path to determine where it gets lost. As
> it is, that's not a use case I think any have used (that is initializing
> and setting attributes on the cached format).
>
> --
> Joshua C. Colp
> Digium - A Sangoma Company | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20190828/0f72b408/attachment.html>


More information about the asterisk-dev mailing list