Browse Source

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
Daniel-Constantin Mierla 11 years ago
parent
commit
6559c43838
1 changed files with 7 additions and 0 deletions
  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;