Browse Source

flag AOR usage and move route to registrar-role

update-rsyslog-config
lazedo 7 years ago
parent
commit
70a3a6fa95
2 changed files with 29 additions and 20 deletions
  1. +1
    -20
      kamailio/default.cfg
  2. +28
    -0
      kamailio/registrar-role.cfg

+ 1
- 20
kamailio/default.cfg View File

@ -683,26 +683,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 ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") {
if(lookup("location", "$hdr(X-KAZOO-AOR)") > 0){
xlog("L_INFO", "$ci|end|routing to contact $ru\n");
} else {
xlog("L_INFO", "$ci|end|lookup for AOR $hdr(X-KAZOO-AOR) failed\n");
sl_send_reply("410", "Not registered");
exit;
}
} else if (reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) {
$du = $(ulc(callee=>received));
$fs = $(ulc(callee=>socket));
xlog("L_INFO", "$ci|log|routing $hdr(X-KAZOO-AOR) to $du via $fs\n");
} else {
xlog("L_INFO", "$ci|end|user is not registered\n");
sl_send_reply("410", "Not registered");
exit;
}
}
route(REGISTRAR_ROUTE_TO_AOR);
#!endif
remove_hf_re("^X-.*");


+ 28
- 0
kamailio/registrar-role.cfg View File

@ -480,4 +480,32 @@ event_route[usrloc:contact-expired]
#!include_file "registrar-sync-role.cfg"
#!endif
route[REGISTRAR_ROUTE_TO_AOR]
{
if ($hdr(X-KAZOO-AOR) == $null) {
return();
}
xlog("L_INFO", "$ci|log|using AOR $hdr(X-KAZOO-AOR)\n");
setflag(FLAG_AOR);
if ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") {
if(lookup("location", "$hdr(X-KAZOO-AOR)") > 0){
xlog("L_INFO", "$ci|end|routing to contact $ru\n");
handle_ruri_alias();
} else {
xlog("L_INFO", "$ci|end|lookup for AOR $hdr(X-KAZOO-AOR) failed\n");
sl_send_reply("410", "Not registered");
exit;
}
} else if (reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) {
$du = $(ulc(callee=>received));
$fs = $(ulc(callee=>socket));
xlog("L_INFO", "$ci|log|routing $hdr(X-KAZOO-AOR) to $du via $fs\n");
} else {
xlog("L_INFO", "$ci|end|user is not registered\n");
sl_send_reply("410", "Not registered");
exit;
}
}
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

Loading…
Cancel
Save