Browse Source

Adding logic around functions that require REGISTRAT_ROLE, or NAT_TRAVERSAL_ROLE (#149)

4.0 4.0.9
derek2600hz 9 years ago
committed by bitbashing
parent
commit
a976be5c85
1 changed files with 16 additions and 1 deletions
  1. +16
    -1
      kamailio/default.cfg

+ 16
- 1
kamailio/default.cfg View File

@ -406,10 +406,13 @@ route[HANDLE_NOTIFY]
xlog("L_INFO", "$ci|log|Able to loose-route. Cool beans!\n");
}
#!ifdef REGISTRAR_ROLE
if (registered("location")) {
lookup("location");
xlog("L_INFO", "$ci|log|routing to $ruid\n");
}
#!endif
route(INTERNAL_TO_EXTERNAL_RELAY);
} else {
#!ifdef TRAFFIC_FILTER_ROLE
@ -496,9 +499,11 @@ route[HANDLE_IN_DIALOG_REQUESTS]
}
#!endif
#!ifdef NAT_TRAVERSAL_ROLE
if(!isdsturiset()) {
handle_ruri_alias();
}
#!endif
xlog("L_INFO", "$ci|log|loose_route in-dialog message\n");
# Called on in-dialog requests
@ -552,14 +557,18 @@ route[PREPARE_INITIAL_REQUESTS]
}
if (loose_route()) {
#!ifdef REGISTRAR_ROLE
$xavp(regcfg=>match_received) = $su;
if(registered("location", "$rz:$Au", 2) == 1) {
xlog("L_INFO", "$ci|log|allowing initial route-set for $Au\n");
} else {
#!endif
xlog("L_WARN", "$ci|end|dropping initial request with route-set\n");
sl_send_reply("403", "No pre-loaded routes");
exit();
#!ifdef REGISTRAR_ROLE
}
#!endif
}
record_route();
@ -585,6 +594,7 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
}
#!endif
#!ifdef REGISTRAR_ROLE
if ($hdr(X-KAZOO-AOR) != $null) {
xlog("L_INFO", "$ci|log|using AOR $hdr(X-KAZOO-AOR)\n");
if (reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) {
@ -597,6 +607,7 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
exit;
}
}
#!endif
remove_hf_re("^X-.*");
@ -636,8 +647,10 @@ route[EXTERNAL_TO_INTERNAL_RELAY]
remove_hf_re("^X-.*");
append_hf("X-AUTH-IP: $si\r\n");
append_hf("X-AUTH-PORT: $sp\r\n");
#!ifdef REGISTRAR_ROLE
route(ADD_AUTHORIZATION_HEADERS);
#!endif
t_on_reply("INTERNAL_REPLY");
t_on_failure("INTERNAL_FAULT");
@ -893,6 +906,7 @@ event_route[kazoo:consumer-event-connection-closed]
xlog("L_INFO","connection to $(kzE{kz.json,host}) closed\n");
}
#!ifdef REGISTRAR_ROLE
route[ADD_AUTHORIZATION_HEADERS]
{
if (!is_method("INVITE|MESSAGE|REFER")) {
@ -929,6 +943,7 @@ route[ADD_AUTHORIZATION_HEADERS]
append_hf("X-ecallmgr_Owner-ID: $(xavp(ulattrs=>custom_channel_vars){kz.json,Owner-ID})\r\n");
}
}
#!endif
#!ifdef PRESENCE_NOTIFY_INIT
event_route[tm:local-request]


Loading…
Cancel
Save