Browse Source

core: parser - set URI type to TELS_URI_T for user=phone SIPS R-URI

Fixes an issue where setting the ``$rU`` for a SIPS R-URI containing
``user=phone`` would overwrite the scheme to ``sip``.
Alexander Bakker 8 months ago
parent
commit
8801cf72c7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/core/parser/parse_uri.c

+ 1 - 1
src/core/parser/parse_uri.c

@@ -1277,7 +1277,7 @@ int parse_uri(char *buf, int len, struct sip_uri *uri)
 			uri->sip_params = uri->params;
 			if((phone2tel) && (uri->user_param_val.len == 5)
 					&& (strncmp(uri->user_param_val.s, "phone", 5) == 0)) {
-				uri->type = TEL_URI_T;
+				uri->type = uri->type == SIPS_URI_T ? TELS_URI_T : TEL_URI_T;
 				uri->flags |= URI_SIP_USER_PHONE;
 				/* move params from user into uri->params */
 				p = q_memchr(uri->user.s, ';', uri->user.len);