Module: kamailio
Branch: master
Commit: 8801cf72c77e9233c789a9a0a1536ac524d5abf6
URL: 
https://github.com/kamailio/kamailio/commit/8801cf72c77e9233c789a9a0a1536ac524d5abf6

Author: Alexander Bakker <a...@alexbakker.me>
Committer: Henning Westerholt <h...@gilawa.com>
Date: 2025-01-10T17:00:23+01:00

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``.

---

Modified: src/core/parser/parse_uri.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/8801cf72c77e9233c789a9a0a1536ac524d5abf6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/8801cf72c77e9233c789a9a0a1536ac524d5abf6.patch

---

diff --git a/src/core/parser/parse_uri.c b/src/core/parser/parse_uri.c
index 9c16fffd1c1..718f6735422 100644
--- a/src/core/parser/parse_uri.c
+++ b/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);

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to