diff --git a/kamailio/default.cfg b/kamailio/default.cfg index f7955fa..9c07d60 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) { + xlog("L_INFO", "$ci|log|allowing initial route-set for $Au"); + } else { + xlog("L_WARN", "$ci|end|dropping initial request with route-set"); + sl_send_reply("403", "No pre-loaded routes"); + exit(); + } } if (!is_method("MESSAGE")) { 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) == "") {