[SR-Users] Help with Async transaction responses

Henning Westerholt hw at gilawa.com
Fri Nov 19 19:06:58 CET 2021


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_from

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Michael Friesen
Sent: Friday, November 19, 2021 6:57 PM
To: sr-users at lists.kamailio.org
Cc: Julie Fowler <jfowler at firstorion.com>; Mike Tihonchik <mtihonchik at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211119/8236f0cc/attachment.htm>


More information about the sr-users mailing list