From 8bc3d0108d696e9f53819c32f44f232829b456a3 Mon Sep 17 00:00:00 2001 From: Damien Sandras Date: Tue, 5 May 2026 10:27:43 +0200 Subject: [PATCH] opensips: Fix SIP Instance according to RFC 5626 It should be surrounded by angle brackets following section 4.1 from RFC 5626: [RFC3840] defines equality rules for callee capabilities parameters, and according to that specification, the "sip.instance" media feature tag will be compared by case- sensitive string comparison. This means that the URN will be encapsulated by angle brackets ("<" and ">") when it is placed within the quoted string value of the "+sip.instance" Contact header field parameter. --- modules/registrar/reply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c index fc726afdadd..042076ea6d6 100644 --- a/modules/registrar/reply.c +++ b/modules/registrar/reply.c @@ -163,7 +163,7 @@ static inline unsigned int calc_buf_len(ucontact_t* c,int build_gruu, /* sip.instance */ len += SIP_INSTANCE_SIZE + 1 /* quote */ - + (c->instance.len - 2) + + c->instance.len + 1 /* quote */ ; } @@ -341,8 +341,8 @@ int build_contact(ucontact_t* c,struct sip_msg *_m) memcpy(p,SIP_INSTANCE,SIP_INSTANCE_SIZE); p += SIP_INSTANCE_SIZE; *p++ = '\"'; - memcpy(p,c->instance.s+1,c->instance.len-2); - p += c->instance.len-2; + memcpy(p,c->instance.s,c->instance.len); + p += c->instance.len; *p++ = '\"'; } }