[SR-Users] t_suspend / t_continue & insert_hf

Fuad Trle trle.fuad at gmail.com
Mon Mar 28 13:17:16 CEST 2022


Hi Henning,

I have tried this, but without success. *This function can be used from
REQUEST_ROUTE or core REPLY_ROUTE.* t_newtrans & http_async_query force me
to enter a new routing block and call fail with "500 I'm terribly sorry,
server error occurred (1/TM)". There is no explicit exit at the end of
route(HTTP) but for some reason execution stopped and did not continue in
request_route.

I don't think I can fulfil those requirements (call function in request
route and before record_route). Suspend is the last option (after location
lookup and parallel forking).

On Sun, Mar 27, 2022 at 10:51 PM Henning Westerholt <hw at gilawa.com> wrote:

> Hello,
>
>
>
> if you are not seeing them in the configuration later on directly, this is
> expected:
> https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-users <sr-users-bounces at lists.kamailio.org> *On Behalf Of *Fuad
> Trle
> *Sent:* Friday, March 25, 2022 4:08 PM
> *To:* sr-users at lists.kamailio.org
> *Subject:* [SR-Users] t_suspend / t_continue & insert_hf
>
>
>
> Hello,
>
>
>
> I'm inserting some headers after getting value from http_async_query. If a
> call is relayed, I see them. But If I t_suspend and t_continue call (before
> time out), I do not see added headers. Here is flow:
>
>
>
> route(START)
>
> t_newtran();
>
> #.. prep for query
>
> http_async_query("url","HTTP");
>
>
>
> route(HTTP)
>
> #.. collect and using data from query
>
> insert_hf("$var(key): $var(value)\r\n");
>
> t_store();
>
>
>
> if (registered("location") {
>
>     route(RELAY);
>
> } else {
>
>     t_suspend();
>
>     exit;
>
> }
>
>
>
> route(AWAKE)
>
> t_continue();
>
>
>
> I see that the branch index ($T_branch_idx) is 0 at start. 1 after http
> query, +1 if there is forking or location. +1 after t_suspend. It looks
> like t_continue uses a branch with index after t_suspend. I tried with
> t_save_lumps() to carry over changes.
>
>
>
> Any idea how to do this?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220328/d6e3bf24/attachment.htm>


More information about the sr-users mailing list