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