[SR-Users] Forward reply in onreply_route

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 28 16:21:31 CEST 2022


I think that what Olle suggested is a good solution.

Otherwise, for tm onreply_route, using t_reply() can make tm generate
its own reply and you can use it to overwrite the incoming reply, but I
am not sure it works for 200ok -- for 300 or greater should be ok-ish
all the time, unless you want to propagate all headers coming in the
received reply.

For core (stateless processing) reply_route, there is:

  -
https://www.kamailio.org/docs/modules/stable/modules/sl.html#sl.f.sl_forward_reply

But then be sure you also use drop not to send the incoming reply as well.

Maybe for tm onreply_route, a variant of t_reply() without parameters
can be added, and in such case the incoming reply is forward without any
change in code and reason text. But could be a little bit tricky/risky,
because the state of transaction is updated when the reply is sent out,
setting it in terminated state, and the timer ticks till it is going to
be destroyed in about 5 secs (with default params).

Cheers,
Daniel

On 28.06.22 16:06, Olle E. Johansson wrote:
>
>
>> On 28 Jun 2022, at 15:54, Carsten Bock <carsten at ng-voice.com> wrote:
>>
>> Hi,
>>
>> Question:
>> Is there a way to forward a reply from the reply route and do other
>> stuff afterward? We are currently doing operations on a 183 reply and
>> it would be useful if we could forward the reply before continuing to
>> process other stuff.
>>
>> High-Level example:
>>
>> /route {
>>   t_on_reply("REPLY");
>>   t_relay();
>> }
>>
>> onreply_route[REPLY] {
>>   // Forward the reply to the Caller
>>   t_relay(); // Does not work, as t_relay is only allowed in request
>> and failure-routes
>>  
>>   // Do other fancy stuff, e.g. a DB Update or anything else
>> }/
>>
>> Any ideas?
> I don’t know how to do it that way, but I would add stuff to mqueue
> and process it asynchronously in the background.
>
> /O
>>
>> Thanks,
>> Carsten
>>
>>
>>
>>
>> --
>> Carsten Bock I CTO & Founder
>>
>> ng-voice GmbH
>>
>> Trostbrücke 1 I 20457 Hamburg I Germany
>> T +49 179 2021244 I www.ng-voice.com <http://www.ng-voice.com/>
>>
>> Registry Office at Local Court Hamburg, HRB 120189
>> Managing Directors: Dr. David Bachmann, Carsten Bock
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>  * sr-users at lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only
>> to the sender!
>> Edit mailing list options or unsubscribe:
>>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online: June 20-23, 2022
  * https://www.asipto.com/sw/kamailio-advanced-training-online/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220628/88cb891e/attachment.htm>


More information about the sr-users mailing list