On Wed, Feb 08, 2017 at 01:12:05AM -0700, Arsen Semionov wrote:
good question from 2013 :)
Maybe someone has experience and can confirm this?
The answer to the 2013 question is: if you can depend on this (I have
never seen it) you can script kamailio to make use of it.
My main question: is it possible to determine when
it's required to use RTP
proxy ? In other words can we know that the client is behind symmetric NAT
device or we just use rtpproxy as a silver bullet?
The "default" config has rtpproxy on detected NAT as an example. But
personally I go for the always proxy option, it never failed so far
(except for misconfigured client side firewalls that wouldn't have
permitted p2p rtp anyway but now can easily fixed by permitting the
traffic from the rtp range of udp ports from the rtpengine/proxy
servers).
NAT detect example below (so take a look at nat_uac_test to see what
kind of tests there are):
route[NATDETECT] {
#!ifdef WITH_NAT
force_rport();
if (nat_uac_test("19")) {
if (is_method("REGISTER")) {
fix_nated_register();
} else {
if(is_first_hop())
set_contact_alias();
}
setflag(FLT_NATS);
}
#!endif
return;
}
route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
rtpproxy_manage("co");