[Serdev] rtpproxy patch for checking src and ruri has the same ip address

Richard mypop3mail at yahoo.com
Mon Aug 2 09:21:36 UTC 2004


Hi,

This is a patch of nathelper.c to check if src ip of a
message is the same of the destination uri. A new
function "same_nated_device" is used to check if two
IP phones are behind the same NAT and nated to the
same address. If they are, no need to use rtpproxy or
mediaproxy, they can see each other's media port. It
can be called everywhere, but for an normal INVITE, it
only makes sense to be called after
lookup("location"), i.e. the ruri is changed to the
callee phone's ip address.

There is a thread about the limitation of this test.
http://lists.iptel.org/pipermail/serusers/2004-July/009547.html

If it deems useful, it can extended to support more
complex setup. For example, a netmask can be used to
compare the src and ruri ip address. So it can support
if the phones are assigned a block of external ip
address, not just a single one. This mask can be saved
in the table "domain" in mysql. So each domain can
have its own netmask. A 32 bit mask checks the same ip
address. A mask of >=33 may indicate that two domains
can have same nated IP, so it always return false.

The implementation may not be the optimal way due to
my limited understanding of ser. It should support
ipv6 though.

Thanks,
Richard


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nathelper.patch
Type: application/octet-stream
Size: 1967 bytes
Desc: nathelper.patch
Url : http://lists.iptel.org/pipermail/serdev/attachments/20040802/9d564929/nathelper.obj


More information about the Serdev mailing list