I answer to myself (it may help others) as I could test successfully the configuration below. Also there is a typo (isbflagset instead of isflagset):

so when I detect a UA is behind NAT, I do:

        if (nat_uac_test("19")) {
                if (method=="REGISTER") {
                        setbflag(7);
                        fix_nated_register();
        ...


Then when my B2BUA sends invite to this UA I do (after lookup("location") ):

        lookup("location");
        ...
        if (is_method("INVITE")) {
                if (isbflagset(7)) {
                        setflag(5);


Regards,
Pascal

On Mon, Jul 13, 2009 at 2:43 PM, Pascal Maugeri <pascal.maugeri@gmail.com> wrote:
I'm not that familiar with flag management.

so when I detect a UA is behind NAT, I do:

        if (nat_uac_test("19")) {
                if (method=="REGISTER") {
                        setbflag(7);
                        fix_nated_register();
        ...

Then when my B2BUA sends invite to this UA I do (after lookup("location") ):

        if (is_method("INVITE")) {
                if (isflagset(7)) {
                        setflag(5);

Is that correct ?

BTW, regarding the flag number, is there a table of reserved numbers ? Can I use "7" in this case ?

-pascal




On Mon, Jul 13, 2009 at 12:00 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,


On 07/13/2009 11:54 AM, Pascal Maugeri wrote:
Hi

A quick question, when I apply a fix_nated_register() to a remote user when he/she registers, how can I know later on if this user is behind NAT ?
set a branch flag for REGISTER before save location. After lookup location that flag is recovered and you can test it in the config file.

Cheers,
Daniel


All my calls go through a B2BUA:

Caller ------> kamailio/rtpproxy ------> B2BUA ------> kamailio/rtpproxy ------> Callee

When my B2BUA calls a user, I want to know if this user is behind NAT or not. For now all the calls go through rtpproxy but I would like to apply this path only when user is behind NAT.

Regards,
Pascal

------------------------------------------------------------------------

_______________________________________________
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

--
Daniel-Constantin Mierla
http://www.asipto.com/