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?
Thanks,
-- Alex
Ah, I think I know where I got it from. :-)
http://blog.miconda.eu/2009/12/best-of-new-in-kamailio-300-3-route.html
So the question is, is this a "sanctioned" approach, or just something eccentric that happens to be supported? And if the former, perhaps a documentation update is in order?
I would happily contribute, I just don't know how to update the core cookbook.
On 22/11/2016 06:08, Alex Balashov wrote:
If you don't have one, you just need to create an account on wiki and then you are able to edit it -- anounymous editing was disabled several years ago due to spam.
Cheers, Daniel
Hello,
On 22/11/2016 06:03, Alex Balashov wrote:
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