Hey,
I am having some issues with NAT and I think the issue is with Bflags. So I have some clarifications :
1. What does the flags column in location contain? 2. What does the cflags column in location contain ?
I am guessing that cflags represents the bflags? So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Do the bflags appear magically in the routing scripts or is there a command that I have to execute for the script to have the bflags?
Thanks!
David
El Viernes, 11 de Diciembre de 2009, David escribió:
I am guessing that cflags represents the bflags?
Yes. In the table cflags mean "contact flags" while in the script bflag means "branch flags". Whe doing lookup for a registered user both mean the same :)
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
Do the bflags appear magically in the routing scripts or is there a command that I have to execute for the script to have the bflags?
You can set a bflag for a branch with "setbflag(N)". Also when detecting NAT you set a nat flag, so you see the bflag again with "setbflag(NATTED_CONTACT)" and it stores the same flag into "location" table "cflags" column.
On 12/11/09 8:50 PM, Iñaki Baz Castillo wrote:
El Viernes, 11 de Diciembre de 2009, David escribió:
I am guessing that cflags represents the bflags?
Yes. In the table cflags mean "contact flags" while in the script bflag means "branch flags". Whe doing lookup for a registered user both mean the same :)
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
The index for flags starts from 0 going up to 31
http://www.kamailio.org/dokuwiki/doku.php/tutorials:openser-flag-operations
Cheers, Daniel
Do the bflags appear magically in the routing scripts or is there a command that I have to execute for the script to have the bflags?
You can set a bflag for a branch with "setbflag(N)". Also when detecting NAT you set a nat flag, so you see the bflag again with "setbflag(NATTED_CONTACT)" and it stores the same flag into "location" table "cflags" column.
On 2009-12-11 15:00, Daniel-Constantin Mierla wrote:
On 12/11/09 8:50 PM, Iñaki Baz Castillo wrote:
El Viernes, 11 de Diciembre de 2009, David escribió:
I am guessing that cflags represents the bflags?
Yes. In the table cflags mean "contact flags" while in the script bflag means "branch flags". Whe doing lookup for a registered user both mean the same :)
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
Wow, I just publicly made an ass of my self. Oh well, at least I admit it.
The index for flags starts from 0 going up to 31
http://www.kamailio.org/dokuwiki/doku.php/tutorials:openser-flag-operations
Cheers, Daniel
Thanks for the clarifications!
David
Do the bflags appear magically in the routing scripts or is there a command that I have to execute for the script to have the bflags?
You can set a bflag for a branch with "setbflag(N)". Also when detecting NAT you set a nat flag, so you see the bflag again with "setbflag(NATTED_CONTACT)" and it stores the same flag into "location" table "cflags" column.
On 2009-12-11 15:00, Daniel-Constantin Mierla wrote:
On 12/11/09 8:50 PM, Iñaki Baz Castillo wrote:
El Viernes, 11 de Diciembre de 2009, David escribió:
I am guessing that cflags represents the bflags?
Yes. In the table cflags mean "contact flags" while in the script bflag means "branch flags". Whe doing lookup for a registered user both mean the same :)
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
Wow, I just publicly made an ass of my self. Oh well, at least I admit it.
The index for flags starts from 0 going up to 31
http://www.kamailio.org/dokuwiki/doku.php/tutorials:openser-flag-operations
Cheers, Daniel
Thanks for the clarifications!
David
Do the bflags appear magically in the routing scripts or is there a command that I have to execute for the script to have the bflags?
You can set a bflag for a branch with "setbflag(N)". Also when detecting NAT you set a nat flag, so you see the bflag again with "setbflag(NATTED_CONTACT)" and it stores the same flag into "location" table "cflags" column.
El Viernes, 11 de Diciembre de 2009, Daniel-Constantin Mierla escribió:
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
The index for flags starts from 0 going up to 31
Thanks for clarification. In fact my comment was a question because I didn't remember it :)
On 12/11/09 10:09 PM, Iñaki Baz Castillo wrote:
El Viernes, 11 de Diciembre de 2009, Daniel-Constantin Mierla escribió:
So if I have a value of 192, does that mean flags 7 and 8 are set ? This confuses me cause I set flags 6 and 7.
Is 2^7 + 2^8 == 192 ?
The index for flags starts from 0 going up to 31
Thanks for clarification. In fact my comment was a question because I didn't remember it :)
I got it so and 2^6 + 2^7 = 192
But I wanted to clarify that position of the flag in bitmask starts with 0 -- so if you count from 0, setflag(6) sets the 6th flag, if you count from 1, it sets the 7th flag.
Cheers, Daniel
Daniel-Constantin Mierla wrote:
Thanks for clarification. In fact my comment was a question because I didn't remember it :)
I got it so and 2^6 + 2^7 = 192
But I wanted to clarify that position of the flag in bitmask starts with 0 -- so if you count from 0, setflag(6) sets the 6th flag, if you count from 1, it sets the 7th flag.
So, setflag(0) should work too? (Never tried it yet)
klaus
On 12/12/09 12:05 PM, Klaus Darilion wrote:
Daniel-Constantin Mierla wrote:
Thanks for clarification. In fact my comment was a question because I didn't remember it :)
I got it so and 2^6 + 2^7 = 192
But I wanted to clarify that position of the flag in bitmask starts with 0 -- so if you count from 0, setflag(6) sets the 6th flag, if you count from 1, it sets the 7th flag.
So, setflag(0) should work too? (Never tried it yet)
yes,
Cheers, Daniel