From 70c5910af73648c2297eac91ceebab2b73a0f706 Mon Sep 17 00:00:00 2001 From: Darren Schreiber Date: Fri, 22 May 2015 19:55:08 -0700 Subject: [PATCH 1/4] KAZOO-3773: Adding loose_route check before sending NOTIFY to remove Route: headers and other such routing information and process it properly. --- kamailio/default.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index b942694..f7955fa 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -351,6 +351,10 @@ route[HANDLE_NOTIFY] { if (is_method("NOTIFY")) { if (isflagset(FLAG_INTERNALLY_SOURCED)) { + if (loose_route()) { + xlog("L_INFO", "$ci|log|Able to loose-route. Cool beans!"); + } + if (registered("location")) { lookup("location"); xlog("L_INFO", "$ci|log|routing to $ruid"); From 5a28242ca583e491249ffbcd1ba1e72e9080c399 Mon Sep 17 00:00:00 2001 From: lazedo Date: Sun, 24 May 2015 23:17:38 +0100 Subject: [PATCH 2/4] missing ' --- kamailio/message-role.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kamailio/message-role.cfg b/kamailio/message-role.cfg index afa8f6a..ddf5ae5 100644 --- a/kamailio/message-role.cfg +++ b/kamailio/message-role.cfg @@ -39,8 +39,8 @@ onreply_route[MESSAGE_REPLY] $var(Result) = "Success"; } - $var(Payload) = '{ "Event-Category" : "message", "Event-Name" : "delivery", "Call-ID" : "' + $(sht(msg=>$ci){kz.json,Call-ID}) + '", "Message-ID" : "' + $(sht(msg=>$ci){kz.json,Message-ID}) +'" , "Delivery-Result-Code" : "sip:" + $T_reply_code + '" , "Msg-ID" : "' + $(sht(msg=>$ci){kz.json,Msg-ID}) + '" , "Status" : "' + $var(Result) + '"}'; - + $var(Payload) = '{ "Event-Category" : "message", "Event-Name" : "delivery", "Call-ID" : "$(sht(msg=>$ci){kz.json,Call-ID})", "Message-ID" : "$(sht(msg=>$ci){kz.json,Message-ID})" , "Delivery-Result-Code" : "sip:$T_reply_code", "Msg-ID" : "$(sht(msg=>$ci){kz.json,Msg-ID})" , "Status" : "$var(Result)"}'; + $var(RoutingKey) = $(sht(msg=>$ci){kz.json,Server-ID}); $var(exchange) = "targeted"; if($var(RoutingKey) == "") { From 526f912683400664344be8f0c2d8cd4de055f72f Mon Sep 17 00:00:00 2001 From: lazedo Date: Thu, 4 Jun 2015 20:46:34 +0100 Subject: [PATCH 3/4] KAZOO-3840 allow pre-loaded routes for grandstream --- kamailio/default.cfg | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index f7955fa..5a15993 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -517,9 +517,15 @@ route[PREPARE_INITIAL_REQUESTS] } if (loose_route()) { - xlog("L_WARN", "$ci|end|denying initial request with route-set"); - sl_send_reply("403", "No pre-loaded routes"); - exit(); + $xavp(regcfg=>match_received) = $su; + $xavp(regcfg[0]=>match_contact) = $(ct{nameaddr.uri}); + if(registered("location", "$rz:$Au", 6) == 1 && ($ua =~ "Grandstream") ) { + xlog("L_INFO", "$ci|chk|allowing initial route-set for $Au"); + } else { + xlog("L_WARN", "$ci|end|denying initial request with route-set"); + sl_send_reply("403", "No pre-loaded routes"); + exit(); + } } if (!is_method("MESSAGE")) { From 3bb7c6e92773e82d5065237d124512cef3bcca5a Mon Sep 17 00:00:00 2001 From: karl anderson Date: Fri, 5 Jun 2015 11:32:57 -0700 Subject: [PATCH 4/4] KAZOO-3840: remove ua check and updated log line --- kamailio/default.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 5a15993..9c07d60 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -519,10 +519,10 @@ route[PREPARE_INITIAL_REQUESTS] if (loose_route()) { $xavp(regcfg=>match_received) = $su; $xavp(regcfg[0]=>match_contact) = $(ct{nameaddr.uri}); - if(registered("location", "$rz:$Au", 6) == 1 && ($ua =~ "Grandstream") ) { - xlog("L_INFO", "$ci|chk|allowing initial route-set for $Au"); + if(registered("location", "$rz:$Au", 6) == 1) { + xlog("L_INFO", "$ci|log|allowing initial route-set for $Au"); } else { - xlog("L_WARN", "$ci|end|denying initial request with route-set"); + xlog("L_WARN", "$ci|end|dropping initial request with route-set"); sl_send_reply("403", "No pre-loaded routes"); exit(); }