[sr-dev] git:3.1: presence: check for transport parameter in contact URI for NOTIFY

Daniel-Constantin Mierla miconda at gmail.com
Tue Mar 29 12:43:32 CEST 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Mar 27 00:09:53 2011 +0100

presence: check for transport parameter in contact URI for NOTIFY

- avoid adding second time the transport parameter if it is present in
  the local contact field of subscription structure
- discovered by Juha Heinanen and Peter Dunkley
(cherry picked from commit 2b30581ac359047d3c350c432a391a7e4e4a47cc)

---

 modules_k/presence/notify.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c
index f57eea1..7e9ce5e 100644
--- a/modules_k/presence/notify.c
+++ b/modules_k/presence/notify.c
@@ -128,6 +128,7 @@ int build_str_hdr(subs_t* subs, int is_body, str* hdr)
 	str expires = {0, 0};
 	str status = {0, 0};
 	str tmp = {0, 0};
+	str trans = {";transport=", 11};
 
 	if(hdr == NULL)
 	{
@@ -184,7 +185,8 @@ int build_str_hdr(subs_t* subs, int is_body, str* hdr)
 	tmp.s += 10;
 	strncpy(tmp.s, subs->local_contact.s, subs->local_contact.len);
 	tmp.s +=  subs->local_contact.len;
-	if(subs->sockinfo_str.s!=NULL)
+	if(subs->sockinfo_str.s!=NULL
+			&& str_search(&subs->local_contact, &trans)==0)
 	{
 		/* fix me */
 		switch(subs->sockinfo_str.s[0]) {




More information about the sr-dev mailing list