You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 lines
967 B

######## NAT Traversal module - signaling functions ########
#!ifndef NATHELPER-LOADED
loadmodule "nathelper.so"
#!endif
modparam("nathelper", "received_avp", "$avp(AVP_RECV_PARAM)")
####### NAT Traversal Logic ########
route[NAT_TEST_AND_CORRECT]
{
if (is_present_hf("Record-Route")) {
$var(i) = $rr_count;
while($var(i) > 0) {
$var(i) = $var(i) - 1;
$var(rr) = $(hdr(Record-Route)[$var(i)]);
if (!is_myself("$(var(rr){nameaddr.uri})")) {
setflag(FLAG_SKIP_NAT_CORRECTION);
}
}
} else if ($Rp == "5080") {
setflag(FLAG_SKIP_NAT_CORRECTION);
}
if (isflagset(FLAG_SKIP_NAT_CORRECTION)) {
return();
}
if (nat_uac_test("3")) {
force_rport();
fix_nated_contact();
}
if (has_body("application/sdp") && nat_uac_test("8")) {
fix_nated_sdp("10");
}
}
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab