Browse Source

check X-KAZOO-INVITE-FORMAT before lookup

drop_requests
lazedo 8 years ago
committed by GitHub
parent
commit
88150db771
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      kamailio/default.cfg

+ 10
- 8
kamailio/default.cfg View File

@ -652,19 +652,21 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
#!ifdef REGISTRAR_ROLE
if ($hdr(X-KAZOO-AOR) != $null) {
xlog("L_INFO", "$ci|log|using AOR $hdr(X-KAZOO-AOR)\n");
if(lookup("location", "$hdr(X-KAZOO-AOR)") > 0) {
if ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") {
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 {
reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee");
$du = $(ulc(callee=>received));
$fs = $(ulc(callee=>socket));
reg_free_contacts("callee");
xlog("L_INFO", "$ci|log|routing $hdr(X-KAZOO-AOR) to $du via $fs\n");
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("404", "Not registered");
sl_send_reply("410", "Not registered");
exit;
}
}


Loading…
Cancel
Save