Module: kamailio
Branch: 4.3
Commit: 020693698e0ec43da1d652524e497f12d1263fe4
URL:
https://github.com/kamailio/kamailio/commit/020693698e0ec43da1d652524e497f1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-18T15:54:24+02:00
tsilo: use current r-uri for ts_store()
- msg->first_line.u.request.uri is always the incoming r-uri (never
updated inside the msg structure)
- if $ru was updated, msg->new_uri is set with the new value
- if incoming r-uri is wanted back after $ru was updated, revert_uri()
can be used
- if only incoming r-uri is allowed, then the function doesn't work when
dialing an alias or a short number
(cherry picked from commit 1e5bad019c450a003e812ee051d84134aad6c5f0)
---
Modified: modules/tsilo/ts_store.c
---
Diff:
https://github.com/kamailio/kamailio/commit/020693698e0ec43da1d652524e497f1…
Patch:
https://github.com/kamailio/kamailio/commit/020693698e0ec43da1d652524e497f1…
---
diff --git a/modules/tsilo/ts_store.c b/modules/tsilo/ts_store.c
index 67dc2d6..a05a4ef 100644
--- a/modules/tsilo/ts_store.c
+++ b/modules/tsilo/ts_store.c
@@ -43,21 +43,28 @@ int ts_store(struct sip_msg* msg) {
struct cell *t;
str aor;
struct sip_uri ruri;
+ str suri;
ts_urecord_t* r;
int res;
-
+ if (msg->new_uri.s!=NULL) {
+ /* incoming r-uri was chaged by cfg or other component */
+ suri = msg->new_uri;
+ } else {
+ /* no changes to incoming r-uri */
+ suri = msg->first_line.u.request.uri;
+ }
if (use_domain) {
- aor = msg->first_line.u.request.uri;
+ aor = suri;
}
else {
- if (parse_uri(msg->first_line.u.request.uri.s, msg->first_line.u.request.uri.len,
&ruri)!=0)
+ if (parse_uri(suri.s, suri.len, &ruri)!=0)
{
LM_ERR("bad uri [%.*s]\n",
- msg->first_line.u.request.uri.len,
- msg->first_line.u.request.uri.s);
+ suri.len,
+ suri.s);
return -1;
}
aor = ruri.user;