Module: sip-router
Branch: master
Commit: 2b30581ac359047d3c350c432a391a7e4e4a47cc
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2b30581…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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
---
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 2c90640..da4ea8d 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]) {