Module: kamailio
Branch: master
Commit: 9c78d7da369dbce0b28d5ea54a55601b790fc9ca
URL: https://github.com/kamailio/kamailio/commit/9c78d7da369dbce0b28d5ea54a55601…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-22T16:33:40+02:00
tsilo: documented optional uri parameter for ts_append_to()
---
Modified: modules/tsilo/doc/tsilo_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/9c78d7da369dbce0b28d5ea54a55601…
Patch: https://github.com/kamailio/kamailio/commit/9c78d7da369dbce0b28d5ea54a55601…
---
diff --git a/modules/tsilo/doc/tsilo_admin.xml b/modules/tsilo/doc/tsilo_admin.xml
index c173043..43f4bac 100644
--- a/modules/tsilo/doc/tsilo_admin.xml
+++ b/modules/tsilo/doc/tsilo_admin.xml
@@ -168,7 +168,7 @@ if (is_method("REGISTER")) {
</example>
</section>
<section>
- <title><function moreinfo="none">ts_append_to(tindex, tlabel, domain)</function></title>
+ <title><function moreinfo="none">ts_append_to(tindex, tlabel, domain, [uri])</function></title>
<para>
The method add branches to the transaction identified by tindex and tlabel,
performing a contacts lookup on the table specified by the domain parameter.
@@ -182,7 +182,7 @@ if (is_method("REGISTER")) {
Can be an integer or a pseudo-variable.
</para>
</listitem>
- <listitem>
+ <listitem>
<para>
<emphasis>tlabel</emphasis> - internal label of transaction.
Can be an integer or a pseudo-variable.
@@ -194,6 +194,12 @@ if (is_method("REGISTER")) {
up new contacts for r-uri.
</para>
</listitem>
+ <listitem>
+ <para>
+ <emphasis>uri</emphasis> (optiona) - uri for which to do lookup for new
+ destinations.
+ </para>
+ </listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Hello,
tsilo is not using the uri parameter for looking up location for new
destinations. It passes the uas request from transaction module to
registrar lookup_to_dset() function, so the r-uri from that request is used.
However, there is at least one scenario that makes tsilo not working
properly:
- invite comes in
- lookup location finds a contact
- request is forwarded with a new r-uri (the contact of the location
record) -- t_relay() is used and trasaction created, r-uri stored for
uas is contact header
- a new registration comes and ts_append() is executed, failing to find
contacts for r-uri in uas because the r-uri there can be anything
pointing to the first device found in location
Some solutions can be found by creating transaction earlier, but not
easy to tackle always.
I think it would be better to just pass the uri parameter from
ts_append() to lookup_to_dset(). But I noticed that the uri can be just
username if use_domain is 0, which makes things a little more complex,
because registrar/usrloc expect full sip uri.
The solution would be to 'force' always that the uri parameters for
tsilo functions are full SIP uri, and let the code extract only username
when use_domain is 0. If someone has only the username in config, it can
simply put the uri parameter as "sip:username@localhost" -- domain will
be ignored anyhow.
Alternative, if the parameter is just username, built a temporary uri
for it before passing to lookup_to_dset().
I find first solution a bit better because the parameter for tsilo
functions is called uri and building an internal one can end up in some
limitations if it is going to be something that requires tel: or sips:
or parameters such as instance.
Any comments/suggestions?
Cheers,
Daniel
--
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