Browse Source

handle NAT during registration challenge

3.12
karl anderson 13 years ago
parent
commit
de4916443a
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      kamailio/kamailio.cfg

+ 11
- 11
kamailio/kamailio.cfg View File

@ -354,6 +354,16 @@ route[PREPARE_INITIAL_REQUESTS]
}
if (is_method("REGISTER")) {
if (nat_uac_test("3")) {
xlog("L_INFO", "$ci|log|Correcting NATed contact in registration\n");
force_rport();
setbflag(FLB_NATB);
setbflag(FLB_NATSIPPING);
fix_nated_register();
}
if (is_present_hf("Authorization")) {
if ($sht(auth_cache=>$Au) != $null && pv_auth_check("$fd", "$sht(auth_cache=>$Au)", "0", "0")) {
xlog("L_INFO", "$ci|log|Authenticated $Au via cached SIP creds\n");
@ -364,7 +374,7 @@ route[PREPARE_INITIAL_REQUESTS]
xlog("L_INFO", "$ci|log|Issued new auth challenge to failed registration attempt\n");
exit;
} else {
xlog("$ci|log|Caching SIP credentials for $Au\n");
xlog("L_INFO", "$ci|log|Caching SIP credentials for $Au\n");
$sht(auth_cache=>$Au) = $avp(password);
}
}
@ -377,16 +387,6 @@ route[PREPARE_INITIAL_REQUESTS]
# user authenticated - remove auth header
consume_credentials();
if (nat_uac_test("3")) {
xlog("L_INFO", "$ci|log|Correcting NATed contact in registration\n");
force_rport();
setbflag(FLB_NATB);
setbflag(FLB_NATSIPPING);
fix_nated_register();
}
save("location");
exit;
} else if (!is_method("MESSAGE")) {


Loading…
Cancel
Save