[SR-Users] tsilo usage more generally

Federico Cabiddu federico.cabiddu at gmail.com
Fri Oct 14 07:39:22 CEST 2022


Hi Alex,

On Thu, Oct 13, 2022 at 3:48 PM Alex Balashov <abalashov at evaristesys.com>
wrote:

> Since on the topic of tsilo:
>
> 1. I watched Federico’s presentation on it from 2015, and his examples
> insinuate that it is necessary to store the index and label of a suspended
> transaction in some external vehicle, e.g. htable, for use with
> ts_append_to(). Why would one do this when it is possible to call
> ts_append() based on R-URI alone?
>
I don't remember why exactly I used t_append_to in the presentation's
example, probably because at the time the http_async_client module didn't
exist and tsilo was used in conjunction with t_suspend/t_resume (which
needs the transaction's index and label). Definitely ts_append() could have
been used.


> 2. The appropriate pattern of interaction between tsilo and
> http_async_client — which I imagine to be a rather common use-case — is
> rather unclear.
>
> If I use http_async_query() to call out to a PN service, with
> $http_req(suspend) = 1, what should happen to the current instance of SIP
> request processing?
>
> That is to say:
>
> request_route {
>    . . .
>
>    t_check_trans();
>
>    if(is_method(“REGISTER”)) {
>       . . .
>
>       save(“location”, “0x06”);
>
>       if(ts_append(“location”, “$tu”)) {
>          xlog(“success”);
>       }
>       return;
>    }
>
>    else if(is_method(“INVITE”)) {
>       # PN stuff.
>
>       ts_store(“$var(uri)”);
>
>       http_async_query(“http://url”, “PUSH_REPLY”);
>
>       return; # <— ???
>    }
> }
>
> route[HTTP_PUSH_REPLY] {
>    . . .
>
>     if(!t_relay())
>        sl_reply_error();
> }


I'm not sure I understand the question here :)
The transaction will be suspended (so the return won't be hit) and would be
resumed in the http reply route.

>
>
I should add that this proxy front-ends a registrar, but is not in itself a
> registrar. It contains a shadow registrar - hence the save() calls - in
> order to be able to take advantage of the ’tsilo’ module, given its
> dependency on registrar/usrloc.
>
> This leads to the difference that the gateway receives requests with RURIs
> that have already been resolved to a contact binding elsewhere, so there
> are no lookup() calls. How should this play into the http_async_client
> workflow?
>
>
Again, I'm not sure to fully understand the scenario here but wouldn't
calling ts_store("$tu") and then ts_append("location", "$tu") work for you?

Cheers,

Federico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20221014/7db914f2/attachment.htm>


More information about the sr-users mailing list