[sr-dev] PARAM_STR vs STR_PARAM

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 17 20:58:17 CEST 2014


Hello,

On 09/07/14 11:00, Alekzander Spiridonov wrote:
> Hi list,
>
> While going through mod_init's and finding things like
> rtpp_table_name.len = strlen(rtpp_table_name.s);
>
> I became curious if using of deprecated STR_PARAM in new modules is 
> done on purpose. Why not using PARAM_STR for string module parameters?
>
> Quote from sr_module.h:
> #define PARAM_STRING     (1U<<0)  /**< String (char *) parameter type */
> #define PARAM_STR        (1U<<2)  /**< struct str parameter type */
> #define STR_PARAM PARAM_STRING
>
> P.S.: That's not only about curiosity but to avoid any bugs in my 
> kamailio extensions.
Indeed PARAM_STR should be used if the value of the parameter needs to 
be stored in a str structure.

PARAM_STR was introduced by SER developers before joining back with 
Kamailio source code, so many developers are not aware of it.

We should review and migrate in such cases.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-dev mailing list