Hi All.
I'm using MediaProxy with ser-0.9.
Is there a way to test if a caller and callee are behind the same NAT (assuming both are registred with my sip proxy)?
I'd like to not use mediaproxy for calls where the caller can directly contact the callee.
Regards, Paul
Hi Paul,
You can do this test, totally independent of mediaproxy or nathelper. Use avpops to compare to equal the src_ip of the INVITE against the domain part of the RURI after lookup("location").
Best regards, Marian
Java Rockx wrote:
Hi All.
I'm using MediaProxy with ser-0.9.
Is there a way to test if a caller and callee are behind the same NAT (assuming both are registred with my sip proxy)?
I'd like to not use mediaproxy for calls where the caller can directly contact the callee.
Regards, Paul
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Great!
One more question. After my call to lookup("location"), how can I determine if the destination (ie, party being called) is NATed?
Regards, Paul
On Tue, 15 Feb 2005 20:57:07 +0100, Marian Dumitru marian.dumitru@voice-sistem.ro wrote:
Hi Paul,
You can do this test, totally independent of mediaproxy or nathelper. Use avpops to compare to equal the src_ip of the INVITE against the domain part of the RURI after lookup("location").
Best regards, Marian
Java Rockx wrote:
Hi All.
I'm using MediaProxy with ser-0.9.
Is there a way to test if a caller and callee are behind the same NAT (assuming both are registred with my sip proxy)?
I'd like to not use mediaproxy for calls where the caller can directly contact the callee.
Regards, Paul
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Voice System http://www.voice-system.ro
Paul,
you just have to check the NAT flag if it's set. it's the flag you set when a request is detected as NATed. The same flag is set by lookup() if the returned location is NATed. Default is flag 6, but you can configure it via usrloc module param "nat_flag".
Best regards, Marian
Java Rockx wrote:
Great!
One more question. After my call to lookup("location"), how can I determine if the destination (ie, party being called) is NATed?
Regards, Paul
On Tue, 15 Feb 2005 20:57:07 +0100, Marian Dumitru marian.dumitru@voice-sistem.ro wrote:
Hi Paul,
You can do this test, totally independent of mediaproxy or nathelper. Use avpops to compare to equal the src_ip of the INVITE against the domain part of the RURI after lookup("location").
Best regards, Marian
Java Rockx wrote:
Hi All.
I'm using MediaProxy with ser-0.9.
Is there a way to test if a caller and callee are behind the same NAT (assuming both are registred with my sip proxy)?
I'd like to not use mediaproxy for calls where the caller can directly contact the callee.
Regards, Paul
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Voice System http://www.voice-system.ro
Hi,
Simply use following shellscript "requestBehindSameNAT.sh": ################################## #!/bin/bash # Prüft anhand der Request-URI und der Contact-Adresse, # ob Quelle und Ziel gleich sind -> NAT-Box
DESTIP=`echo $SIP_RURI | sed 's/[^0-9.:]//g' | cut -d":" -f2`
[ $DESTIP = $SIP_SRCIP ] && exit 0 exit 1 ################################## ... and call it in ser.cfg: if (!exec_msg("/usr/local/share/requestBehindSameNAT.sh")) { use_media_proxy(); t_on_reply("1"); }
regards, Philipp
Hi Philipp,
As time as there are other solution, IMHO the exec feature should be avoided as much as possible - it introduce a big overhead by dynamically creating/waitting processes for each INVITE. Just an opinion :-)
Best regards, Marian
Alexander Philipp Lintenhofer wrote:
Hi,
Simply use following shellscript "requestBehindSameNAT.sh": ################################## #!/bin/bash # Prüft anhand der Request-URI und der Contact-Adresse, # ob Quelle und Ziel gleich sind -> NAT-Box
DESTIP=`echo $SIP_RURI | sed 's/[^0-9.:]//g' | cut -d":" -f2`
[ $DESTIP = $SIP_SRCIP ] && exit 0 exit 1 ################################## ... and call it in ser.cfg: if (!exec_msg("/usr/local/share/requestBehindSameNAT.sh")) { use_media_proxy(); t_on_reply("1"); }
regards, Philipp
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/seruser s