[OpenSIPS-Users] Need help on flag in usrloc

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Jan 5 15:20:58 CET 2010


Hi Ha,

the NAT branch flag you use is 7 (nat_bflag) and in usrloc you find the 
branch flags in the cflags (contact flags) field. The cflags is a mask 
with all the branch flags: 192 = 128 (2^7) + 64 (2^6)

Regards,
Bogdan


ha do wrote:
> Hi all
>
> i am successfull to check the UA behind NAT but i dont know what value 
> of the flag will be stored in the usrloc
>
> Could someone please let me know the value of Nated UA flag, that is 
> stored in usrloc
>
>
> my config :
> modparam("nathelper", "natping_interval",180)
> modparam("nathelper", "ping_nated_only", 1)
> modparam("nathelper", "sipping_bflag", 7)
> modparam("nathelper", "sipping_from", "sip:cucku at kamailio.org")
> modparam("registrar|nathelper", "received_avp", "$avp(i:80)")
> modparam("usrloc", "nat_bflag", 7)
>
>
> route{
>
> ....
> route("4");
> if (method=="REGISTER")
>         {
>                 if (isflagset(5)) {
>                         setbflag(6);
>                         setbflag(7);
>                 }
>                 if (!save("location"))
>                         sl_reply_error();
>                 exit;
>         }
> }
> route[4]{
>         force_rport();
>         if (nat_uac_test("19")) {
>                 if (method=="REGISTER") {
>                         fix_nated_register();
>                 } else {
>                         fix_nated_contact();
>                 }
>                 setflag(5);
>         }
>         return;
> }
>
> mysql> select * from location\G
> *************************** 1. row ***************************
>            id: 12
>      username: 1000
>        domain: NULL
>       contact: sip:1000 at 192.168.1.2:12280;rinstance=a4752f45bdc3ddd3
>      received: sip:210.245.35.150:12280
>          path: NULL
>       expires: 2010-01-05 17:48:56
>             q: -1.00
>        callid: YjE1NWJmYWYyYWMzZDg2ZDc5MjY0NDQyMGE5NDEwM2E.
>          cseq: 2
> last_modified: 2010-01-05 16:48:56
>          flags: 0
>         cflags: 192
> user_agent: eyeBeam release 1004p stamp 31962
>       socket: udp:118.69.193.198:5060
>       methods: 5951
>
>
> Thank you
> Ha`
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list