Hello,
On 27.03.23 14:24, Alex Balashov wrote:
Hi,
I’ve got a situation where I catch a 302 redirect in a failure_route (branch #1), and use
the Contact to set a custom header (append_hf()).
This custom header is utilised on the subsequent branch (branch #2), but if that branch
fails (e.g. due to 4xx-5xx response), the custom header is not preserved on subsequent
branches (branch #3+).
What’s the best way to preserve it across subsequent branches? The documentation for
msg_apply_changes() says it cannot be used once the transaction is already created, and in
any case, I have other branch-level changes in branch #2 that I _would_ like to revert on
subsequent branch attempts (i.e. branch #3).
I can certainly devise a transaction-persistent vehicle for this value which can be
checked on every branch, but I wondered if there’s an easier and more best-practical way.
I think leveraging avp/xavp(or variants) would be the choice here. Maybe
even htable, if you prefer it.
Cheers,
Daniel
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio World Conference - June 5-7, 2023 -
www.kamailioworld.com