Hi Federico,
I just pushed a patch to tsilo module to use the current r-uri instead
of the incoming one. As written in the commit message, using incoming
uri always makes it not work in quite common cases. I am considering to
backport as well if you find that the change is ok.
Cheers,
Daniel
--
On 18/09/15 13:40, Daniel-Constantin Mierla wrote:
> Module: kamailio
> Branch: master
> Commit: 1e5bad019c450a003e812ee051d84134aad6c5f0
> URL: https://github.com/kamailio/kamailio/commit/1e5bad019c450a003e812ee051d84134aad6c5f0
>
> Author: Daniel-Constantin Mierla <miconda@gmail.com>
> Committer: Daniel-Constantin Mierla <miconda@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/1e5bad019c450a003e812ee051d84134aad6c5f0.diff
> Patch: https://github.com/kamailio/kamailio/commit/1e5bad019c450a003e812ee051d84134aad6c5f0.patch
>
> ---
>
> 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;
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat