[OpenSIPS-Users] Nested reply_routes
Richard Robson
richard at rikrobson.co.uk
Thu Apr 9 23:03:57 UTC 2026
No. Once in the reply_route you can call routes as a function. I think
that is what you are after.
onreply_route{route_a]
{stuff()..
if x route(route_z)
else route(_x)
..}
route[route_z]
{stuff()..
..}
route[route_z]
{stuff()..
..}
Richard
On 09/04/2026 10:13, spce at lard.at wrote:
>
> Hi,:
>
> thanks. In my case theres a quite big onreply route, which totally
> works, but is a hassle to read. Therefore I would like to segment some
> stuff into custom "functions", so I can have an easy to understand
> main onreply route and the more complicated logic in special blocks.
>
> A possibility for that would be to call secondary onreply routes from
> the parent route. Is that possible or not?
>
> Liebe Grüße / Kind regards,
> Malte
> On 08/04/2026 17.23, Richard Robson wrote:
>> you call a reply route to handle the relpy. i.e. a positive outcome
>> 200OK or a 183 etc. This reply should be relayed back to the
>> originator and there should be no need to call another reply route.
>> it won't expect a reply just an ack and that should be handled as an
>> ACK and relayed or an error sent back. (see the default script)
>> if you want the reply route to do something else then add a route to
>> do that or a branch route if needed. and call that from the reply
>> route (not nested)
>>
>> Richard
>>
>>
>> On Wed, 2026-04-08 at 15:38 +0200, spce at lard.at wrote:
>>> Hi,
>>>
>>> is it possible to use nested reply routes in opensips?
>>>
>>> I want to clean up my script and thinking of something like this:
>>>
>>> > onreply_route[MAIN] {
>>> > [...]
>>> > is_from_gw(1) = t_on_reply("ADD_ISUP");> }
>>> > [...] }
>>> > onreply_route[ADD_ISUP] {
>>> > add_isup_part() }
>>>
>>> The nested onreply route then should return to the parent onreply
>>> route. In my tests I specifically had issues with the rtpengine
>>> module: when using rtpengine_answer in the parent onreply route and
>>> then calling another onreply route from parent route, opensips
>>> wasn't able to see the SDP body in the reply and the
>>> rtpengine_answer thus failed.
>>>
>>>
>>> --
>>> Liebe Grüße / Kind regards,
>>> Malte
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20260410/0a3602fe/attachment.html>
More information about the Users
mailing list