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

Joshua C. Colp jcolp at digium.com
Wed Aug 28 04:58:16 CDT 2019


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



More information about the asterisk-dev mailing list