Module: kamailio
Branch: master
Commit: 1e5bad019c450a003e812ee051d84134aad6c5f0
URL:
https://github.com/kamailio/kamailio/commit/1e5bad019c450a003e812ee051d8413…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-18T13:36:03+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
---
Modified: modules/tsilo/ts_store.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1e5bad019c450a003e812ee051d8413…
Patch:
https://github.com/kamailio/kamailio/commit/1e5bad019c450a003e812ee051d8413…
---
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;