From e77ab6c8feb0187449ee52d6fcb8ec1c4f5a3a42 Mon Sep 17 00:00:00 2001 From: Mark Magnusson Date: Wed, 14 Jun 2017 14:52:56 -0400 Subject: [PATCH] changes based on discussion in standup --- kamailio/default.cfg | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index b753584..c6783f2 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -601,7 +601,15 @@ 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 (reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) { + if ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") { + if(lookup($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("404", "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"); @@ -614,14 +622,6 @@ route[INTERNAL_TO_EXTERNAL_RELAY] #!endif remove_hf_re("^X-.*"); - - if($hdr(X-KAZOO-INVITE-FORMAT) == "contact") { - $ru = $(ulc(callee=>addr)); - xlog("L_INFO", "$ci|end|routing to contact $ru\n"); - } else if( $avp(kazoo_aor) != $null) { - $du = $avp(kazoo_du); - xlog("L_INFO", "$ci|end|routing to $ruid : AOR : $avp(kazoo_aor)\n"); - } t_on_reply("EXTERNAL_REPLY");