|
|
|
@ -14,12 +14,14 @@ modparam("nathelper", "sipping_from", "sip:registrar@MY_HOSTNAME") |
|
|
|
|
|
|
|
#!trydef KZ_NAT_FIX_SDP_REQUEST 1 |
|
|
|
#!trydef KZ_NAT_FIX_SDP_REPLY 1 |
|
|
|
#!trydef KZ_NAT_FIX_INTERNAL_SDP_REPLY 0 |
|
|
|
#!trydef KZ_NAT_SDP_TEST 8 |
|
|
|
#!trydef KZ_NAT_SDP_FIX 10 |
|
|
|
|
|
|
|
|
|
|
|
kazoo.nat_fix_sdp_request = KZ_NAT_FIX_SDP_REQUEST descr "performs request sdp replacement of private addresses" |
|
|
|
kazoo.nat_fix_sdp_reply = KZ_NAT_FIX_SDP_REPLY descr "performs reply sdp replacement of private addresses" |
|
|
|
kazoo.nat_fix_internal_sdp_reply = KZ_NAT_FIX_INTERNAL_SDP_REPLY descr "performs reply sdp replacement of private addresses" |
|
|
|
|
|
|
|
####### NAT Traversal Logic ######## |
|
|
|
route[NAT_SDP] |
|
|
|
@ -39,7 +41,6 @@ route[NAT_SDP] |
|
|
|
|
|
|
|
route[NAT_DETECT] |
|
|
|
{ |
|
|
|
|
|
|
|
if($sel(cfg_get.kazoo.nat_fix_sdp_request) == 1) { |
|
|
|
route(NAT_SDP); |
|
|
|
} |
|
|
|
@ -78,17 +79,28 @@ route[NAT_DETECT] |
|
|
|
if(nat_uac_test(KZ_NAT_DETECT)) { |
|
|
|
xlog("L_DEBUG", "$ci|log|detected nat request\n"); |
|
|
|
setflag(FLT_NATS); |
|
|
|
if (!is_method("REGISTER")) { |
|
|
|
if(is_first_hop()) set_contact_alias(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!is_method("REGISTER")) { |
|
|
|
if(is_first_hop()) set_contact_alias(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
route[NAT_MANAGE] |
|
|
|
{ |
|
|
|
if( is_reply() && $sel(cfg_get.kazoo.nat_fix_sdp_reply) == 1) { |
|
|
|
route(NAT_SDP); |
|
|
|
if(!isflagset(FLAG_INTERNALLY_SOURCED)) { |
|
|
|
if(is_reply() && $sel(cfg_get.kazoo.nat_fix_internal_sdp_reply) == 1) { |
|
|
|
if(!sdp_with_ice()) { |
|
|
|
route(NAT_SDP); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if( is_reply() && $sel(cfg_get.kazoo.nat_fix_sdp_reply) == 1) { |
|
|
|
if(!sdp_with_ice()) { |
|
|
|
route(NAT_SDP); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( is_request() && isflagset(FLAG_INTERNALLY_SOURCED)) { |
|
|
|
|