<div dir="ltr">Ok. <br>could it be related to the order in which modules get loaded in asterisk?<br>also can you please suggest some way to pass this information somehow from <font face="monospace">codec_xyz.c</font> to<font face="monospace"> ref_format_attr_xyz.c?</font><div><div>because I believe <font face="monospace">codec_opus.so</font> does this sort of thing.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 28 Aug 2019 at 15:28, Joshua C. Colp <<a href="mailto:jcolp@digium.com">jcolp@digium.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Aug 27, 2019, at 7:41 AM, Mohit Dhiman wrote:<br>
> Hi,<br>
> I am trying to pass default data from codec_xyz.c to res_format_attr_xyz.c<br>
> <br>
> what I did:<br>
>  * main/codec_builtin.c: ast_codec_builtin_init: made a call to <br>
> CODEC_REGISTER_AND_CACHE(xyz)<br>
>  * codecs/codec_xyz.c: load_module: get the codec. xyz_codec = <br>
> ast_codec_get()<br>
>  * codecs/codec_xyz.c: load_module: format = <br>
> ast_format_create_named("xyz", xyz_codec)<br>
>  * codecs/codec_xyz.c: load_module: initialized struct xyz_attr in <br>
> variable attr<br>
>  * codecs/codec_xyz.c: load_module: <br>
> ast_format_set_attribute_data(format, attr);<br>
>  * codecs/codec_xyz.c: load_module: ast_format_cache_set(format);<br>
> <br>
> problem is that attribute_data in callback format_generate_sdp_fmtp of <br>
> res_format_attr_xyz.c is NULL<br>
> and not what was initialized in codec/codec_xyz.c<br>
<br>
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).<br>
<br>
-- <br>
Joshua C. Colp<br>
Digium - A Sangoma Company | Senior Software Developer<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br>
Check us out at: <a href="http://www.digium.com" rel="noreferrer" target="_blank">www.digium.com</a> & <a href="http://www.asterisk.org" rel="noreferrer" target="_blank">www.asterisk.org</a><br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div>