[SR-Users] flags documentation
Daniel-Constantin Mierla
miconda at gmail.com
Tue Nov 22 14:51:03 CET 2016
Hello,
On 22/11/2016 06:03, Alex Balashov wrote:
> Hi,
>
> I have this set up in my configuration boilerplate:
>
> --
> flags
> DUMMY : 1,
> PDD_DAMPEN : 2,
> PROXY_MEDIA_SET : 3,
> #!ifdef WITH_NAT_TRAVERSAL
> SIPPING : 4,
> #!endif
> DUMMY2 : 12
> --
>
> I then use these aliases in transaction flags, e.g. setflag(PDD_DAMPEN).
>
> But I can honestly say I don't remember how I arrived at this
> approach. I wrote it somewhere in early 3.x days. However, when I look
> at the core documentation for the 'flags' declaration, all I find is:
>
> http://www.kamailio.org/wiki/cookbooks/4.4.x/core#flags
>
> Or namely:
>
> --
> flags
>
> Alias name: bool
> --
>
> And there is no entry for "bool". So, I couldn't have possibly arrived
> at this usage from the documentation.
>
> Can anyone help me reverse-engineer this historical phenomenon? And,
> given that the documentation doesn't support it particularly, is it
> still an encouraged practice? Or should one use #!defined constants
> instead, as in the stock config?
Aliasing names to flags is inherited from SER project via the merge of
core done back in 2008. I am not familiar with the code to be able to
comment more specific, but setflag/isflagset/resetflag should work fine,
not sure if they work to be set to modparams, probably yes.
As I got used to the Kamailio way of using defines, I stayed with this
approach.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
More information about the sr-users
mailing list