Browse Source

Adding logic around functions that require REGISTRAR_ROLE or NAT_TRAVERSAL_ROLE (#148)

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

+ 16
- 1
kamailio/default.cfg View File

@ -413,10 +413,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
@ -503,9 +506,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
@ -559,14 +564,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();
@ -592,6 +601,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")) {
@ -604,6 +614,7 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
exit;
}
}
#!endif
remove_hf_re("^X-.*");
@ -643,8 +654,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");
@ -820,6 +833,7 @@ onsend_route {
xlog("L_INFO", "$ci|pass|$sndfrom(ip):$sndfrom(port) -> $sndto(ip):$sndto(port)\n");
}
#!ifdef REGISTRAR_ROLE
route[ADD_AUTHORIZATION_HEADERS]
{
if (!is_method("INVITE|MESSAGE|REFER")) {
@ -856,6 +870,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