[OpenSER-Users] isflagset from other peer ?

Klaus Darilion klaus.mailinglists at pernau.at
Mon Mar 3 20:16:39 CET 2008


David Loh wrote:
> Hi All,
> 
> I'm facing a situation for P2P call where it need to determine both 
> caller and callee network type,
> except for both parties having direct (internet) connection (on Public 
> IP), the rest of combinations will implement force_rtp_proxy.
> (the 4 combinations are: NAT-> NAT, NAT -> Public IP, Public IP -> NAT, 
> Public IP -> Public IP).
> 
> Wondering if I can use isflagset or fetch flag from remote peer (callee) 
> ? or is there any function that allow this to be happen ?


Usually you do it this way (pseudo code):
- configure NAT flag (e.g. flag 5).
http://www.openser.org/docs/modules/1.3.x/usrloc.html#AEN76


if (REGISTER) {
   if (behind NAT)
     setbflag(5)
   save();
   exit;
}

...call routing...
   if (behind NAT)
     setflag(6)
..
activate branch route
....
t_relay();
exit;



branch_route[1] {
   if isflagset(6) || isbflagset(5)
     force_rtpproxy();
   ...
   do other NAT traversal stuff
   ...
}


regards
klaus
}











More information about the sr-users mailing list