Hello,
Not sure if it works in this scenarios, but did you already tried to use: https://kamailio.org/docs/modules/stable/modules/uac.html#uac.f.uac_replace_...
Cheers,
Henning
-- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://gilawa.comhttps://gilawa.com/
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Michael Friesen Sent: Friday, November 19, 2021 6:57 PM To: sr-users@lists.kamailio.org Cc: Julie Fowler jfowler@firstorion.com; Mike Tihonchik mtihonchik@firstorion.com Subject: [SR-Users] Help with Async transaction responses
Hello, I am attempting to perform some asynchronous lookup upon receiving an INVITE and then reply with a 3xx response with a modified From header. My workflow now is to create a transaction when receiving the INVITE, suspend the transaction, perform the asynchronous lookup, continue the transaction upon response, and then modify the From header and reply. The ONLY problem I am having is modifying the From header! How can I modify the From header in this scenario?
function ksr_request_route() if KSR.is_INVITE() then if KSR.tm.t_newtran() then cache_transaction_info() KSR.tmx.t_suspend() --perform async loookup end end return 1 end
--This function called on response from async lookup. Equivalent of ONREPLY_ROUTE function ksr_reply_route() --Finds the transaction_index and transaction_label from a cache KSR.tmx.t_continue(transaction_index, transaction_label, "redirect_transaction"); KSR.x.drop() return 1 end
function redirect_transaction() KSR.pv.sets("$fU", "Jenny") --Doesn't actually modify the from username for 302 response! KSR.tm.t_reply(302, "Redirecting") return 1 end
Thank you much! -Michael