Browse code

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)

Daniel-Constantin Mierla authored on 21/07/2014 08:10:45
Showing 1 changed files
... ...
@@ -1534,6 +1534,7 @@ int check_message_support(struct sip_msg* msg)
1534 1534
 	str *methods_body;
1535 1535
 	unsigned int methods;
1536 1536
 	int expires;
1537
+	int posexp = 0;
1537 1538
 
1538 1539
 	/* Parse all headers in order to see all Allow headers */
1539 1540
 	if (parse_headers(msg, HDR_EOH_F, 0) == -1)
... ...
@@ -1587,6 +1588,7 @@ int check_message_support(struct sip_msg* msg)
1587 1588
 		/* skip contacts with zero expires */
1588 1589
 		if (expires > 0)
1589 1590
 		{
1591
+			posexp = 1;
1590 1592
 			if (c->methods)
1591 1593
 			{
1592 1594
 				methods_body = &(c->methods->body);
... ...
@@ -1614,6 +1616,11 @@ int check_message_support(struct sip_msg* msg)
1614 1616
 			return -1;
1615 1617
 		}
1616 1618
 	}
1619
+
1620
+	/* no positivie expires header */
1621
+	if(posexp==0)
1622
+		return -1;
1623
+
1617 1624
 	/* no Allow header and no methods in Contact => dump MESSAGEs */
1618 1625
 	if(allow_hdr==0)
1619 1626
 		return 0;