Module: kamailio
Branch: master
Commit: 951df23f8ab9f4428e143949f1e580f76b4d8fc9
URL:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-07-14T09:20:29+02:00
topoh: try to use sip uri parameters for decoding
- when UA adds user=phone, turns the uri type in tel mapped over sip
uri, default params pointing to tel params
- reported by GH #1541
---
Modified: src/modules/topoh/th_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
Patch:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
---
diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c
index 8f46382c8e..2ba5688395 100644
--- a/src/modules/topoh/th_msg.c
+++ b/src/modules/topoh/th_msg.c
@@ -108,17 +108,25 @@ int th_get_param_value(str *in, str *name, str *value)
int th_get_uri_param_value(str *uri, str *name, str *value)
{
- struct sip_uri puri;
+ sip_uri_t puri;
memset(value, 0, sizeof(str));
if(parse_uri(uri->s, uri->len, &puri)<0)
return -1;
+
+ LM_DBG("uri params: [%.*s] - sip uri params: [%.*s]\n",
+ puri.params.len, (puri.params.s)?puri.params.s:"",
+ puri.sip_params.len, (puri.sip_params.s)?puri.sip_params.s:"");
+
+ if(puri.sip_params.len>0)
+ return th_get_param_value(&puri.sip_params, name, value);
+
return th_get_param_value(&puri.params, name, value);
}
int th_get_uri_type(str *uri, int *mode, str *value)
{
- struct sip_uri puri;
+ sip_uri_t puri;
int ret;
str r2 = {"r2", 2};