Skip to content

Commit 8bc3d01

Browse files
committed
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.
1 parent 1898621 commit 8bc3d01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

modules/registrar/reply.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static inline unsigned int calc_buf_len(ucontact_t* c,int build_gruu,
163163
/* sip.instance */
164164
len += SIP_INSTANCE_SIZE
165165
+ 1 /* quote */
166-
+ (c->instance.len - 2)
166+
+ c->instance.len
167167
+ 1 /* quote */
168168
;
169169
}
@@ -341,8 +341,8 @@ int build_contact(ucontact_t* c,struct sip_msg *_m)
341341
memcpy(p,SIP_INSTANCE,SIP_INSTANCE_SIZE);
342342
p += SIP_INSTANCE_SIZE;
343343
*p++ = '\"';
344-
memcpy(p,c->instance.s+1,c->instance.len-2);
345-
p += c->instance.len-2;
344+
memcpy(p,c->instance.s,c->instance.len);
345+
p += c->instance.len;
346346
*p++ = '\"';
347347
}
348348
}

0 commit comments

Comments
 (0)