From c3db7e530cdbb0564e9ba2dd730cce22de2cd642 Mon Sep 17 00:00:00 2001 From: karl anderson Date: Tue, 10 Feb 2015 20:27:28 -0800 Subject: [PATCH] KAZOO-3320 reject subscribe requests if there is nothing to subscribe to (or from) --- kamailio/presence-role.cfg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kamailio/presence-role.cfg b/kamailio/presence-role.cfg index be4a015..01c0f79 100644 --- a/kamailio/presence-role.cfg +++ b/kamailio/presence-role.cfg @@ -48,6 +48,20 @@ route[HANDLE_SUBSCRIBE] exit; } + if ($tU == $null) { + xlog("L_INFO", "$ci|stop|ignoring subscribe with empty TO username from a $ua"); + sl_send_reply(400, "Missing TO username"); + t_release(); + exit; + } + + if ($fU == $null) { + xlog("L_INFO", "$ci|stop|ignoring subscribe with empty FROM username from a $ua"); + sl_send_reply(400, "Missing FROM username"); + t_release(); + exit; + } + handle_subscribe(); ##RabbitMQ