Преглед изворни кода

msilo: check if the register has contacts with positive expires value

- otherwise is un-registration and no new contact to dump messages
- reported by Anthony Messina

(cherry picked from commit 6559c4383858d472637807c6ec4dd1e0616507fa)
(cherry picked from commit 80ea39b93278e99b32e6d16f6bb76fefad3d691f)
Daniel-Constantin Mierla пре 11 година
родитељ
комит
2ca3d98c15
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      modules/msilo/msilo.c

+ 7 - 0
modules/msilo/msilo.c

@@ -1534,6 +1534,7 @@ int check_message_support(struct sip_msg* msg)
 	str *methods_body;
 	unsigned int methods;
 	int expires;
+	int posexp = 0;
 
 	/* Parse all headers in order to see all Allow headers */
 	if (parse_headers(msg, HDR_EOH_F, 0) == -1)
@@ -1587,6 +1588,7 @@ int check_message_support(struct sip_msg* msg)
 		/* skip contacts with zero expires */
 		if (expires > 0)
 		{
+			posexp = 1;
 			if (c->methods)
 			{
 				methods_body = &(c->methods->body);
@@ -1614,6 +1616,11 @@ int check_message_support(struct sip_msg* msg)
 			return -1;
 		}
 	}
+
+	/* no positivie expires header */
+	if(posexp==0)
+		return -1;
+
 	/* no Allow header and no methods in Contact => dump MESSAGEs */
 	if(allow_hdr==0)
 		return 0;