[asterisk-dev] [PATCH] Silently drop non-conforming cirpack keep-alive packets

Samuel Tardieu sam at rfc1149.net
Wed May 31 07:50:48 MST 2006


The French operator Free Telecom uses an equipment from Cirpack as its
SIP server. It looks like Cirpack sends non-conforming keep-alive
packets. They are captured by tcpdump as:

16:52:41.423840 IP (tos 0x0, ttl  54, id 894, offset 0, flags [none], proto: UDP (17), length: 60) 212.27.52.5.5060 > willow.5060: [udp sum ok] SIP, length: 32
        Cirpack KeepAlive Packet\000\000\000\000\000\000\000\000
        0x0000:  4369 7270 6163 6b20 4b65 6570 416c 6976
        0x0010:  6520 5061 636b 6574 0000 0000 0000 0000

A packet is sent every 15s, causing Asterisk to write the same line in
the logs every 15s too. The following hack ignores those packets. I do
not know whether this should be included in the mainstream sources or
not. I will report this to Free Telecom, hoping that they can do
something about it (such as contacting Cirpack).


1 file changed, 6 insertions(+)
channels/chan_sip.c |    6 ++++++


diff -r 574e1faffbed -r fc55abbddee7 channels/chan_sip.c
--- a/channels/chan_sip.c	Wed May 31 15:41:11 2006 +0200
+++ b/channels/chan_sip.c	Wed May 31 16:47:21 2006 +0200
@@ -5145,6 +5145,12 @@ static int determine_firstline_parts(str
 		if (*e)
 			*e++ = '\0';
 		e = ast_skip_blanks(e);
+		if (!strcasecmp(req->rlPart1, "Cirpack") &&
+		    !strcasecmp(req->rlPart2, "KeepAlive") &&
+		    !strcasecmp(e, "Packet")) {
+			/* Silently drop bogus Cirpack keepalive packets */
+			return -1;
+		}
 		if (strcasecmp(e, "SIP/2.0") ) {
 			ast_log(LOG_WARNING, "Bad request protocol %s\n", e);
 			return -1;





More information about the asterisk-dev mailing list