From bd40ac64debd6bfc58e152c5471c0194d51a75e7 Mon Sep 17 00:00:00 2001 From: lazedo Date: Wed, 4 Apr 2018 11:41:41 +0100 Subject: [PATCH] pusher can send kazoo invite format --- kamailio/default.cfg | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 1d248a7..15a117f 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -652,18 +652,16 @@ 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 ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") { - if(lookup("location", "$hdr(X-KAZOO-AOR)") > 0){ + if (lookup("location", "$hdr(X-KAZOO-AOR)") > 0) { + if ($hdr(X-KAZOO-INVITE-FORMAT) == "contact") { 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"); + 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"); + } } else if ($hdr(X-KAZOO-PUSHER-Token-ID) != $null) { xlog("L_INFO", "$ci|log|ignoring missing registration while waiting for push notification response\n"); t_on_reply("EXTERNAL_REPLY");