[sr-dev] git:master: msilo: check if the register has contacts with positive expires value

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 21 10:12:12 CEST 2014


Module: sip-router
Branch: master
Commit: 6559c4383858d472637807c6ec4dd1e0616507fa
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6559c4383858d472637807c6ec4dd1e0616507fa

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Jul 21 10:10:45 2014 +0200

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

---

 modules/msilo/msilo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/msilo/msilo.c b/modules/msilo/msilo.c
index d04ee1a..fe63fbd 100644
--- a/modules/msilo/msilo.c
+++ b/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;




More information about the sr-dev mailing list