<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thanks Henning!<o:p></o:p></p>
<p class="MsoNormal">In this instance the uac_replace_from method is not working either.  I attempted to use KSR.uac.uac_replace_from("batman", "") inside the redirect_transaction() method and it was not successful.  However, If I perform this BEFORE calling
 KSR.tm.t_newtran() then the From header uses the “batman” value for the response.  The problem is that I still cannot use the asynchronous lookup response to modify the From header once the transaction has been created.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Michael<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> <b>
On Behalf Of </b>Henning Westerholt<br>
<b>Sent:</b> Friday, November 19, 2021 12:07 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Cc:</b> Mike Tihonchik <mtihonchik@firstorion.com>; Julie Fowler <jfowler@firstorion.com><br>
<b>Subject:</b> Re: [SR-Users] Help with Async transaction responses<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE">Hello, <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Not sure if it works in this scenarios, but did you already tried to use:
<a href="https://us-west-2.protection.sophos.com?d=kamailio.org&u=aHR0cHM6Ly9rYW1haWxpby5vcmcvZG9jcy9tb2R1bGVzL3N0YWJsZS9tb2R1bGVzL3VhYy5odG1sI3VhYy5mLnVhY19yZXBsYWNlX2Zyb20=&i=NWQ3MTY5NGVhZjFkZjgxN2NhMWRiNmIx&t=QUFrZ3RTWUx1WVdDWDFWbzBNUlBUaTd3MTdqeHZkY0Qrc3NPVWRwQWl4QT0=&h=932613dd668d4e0ea6f768041a0bd41e">
https://kamailio.org/docs/modules/stable/modules/uac.html#uac.f.uac_replace_from</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers, <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB">-- <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt – </span><span lang="DE"><a href="https://us-west-2.protection.sophos.com?d=skalatan.de&u=aHR0cHM6Ly9za2FsYXRhbi5kZS9ibG9nLw==&i=NWQ3MTY5NGVhZjFkZjgxN2NhMWRiNmIx&t=WStDbk50SzBLNjVwR01sTHRvYlVwbzA0dzdhQlBnNUF2WnErNFp6SEhYaz0=&h=932613dd668d4e0ea6f768041a0bd41e"><span lang="EN-GB">https://skalatan.de/blog/</span></a></span><span lang="DE">
</span><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services – </span><span lang="DE"><a href="https://us-west-2.protection.sophos.com?d=gilawa.com&u=aHR0cHM6Ly9naWxhd2EuY29tLw==&i=NWQ3MTY5NGVhZjFkZjgxN2NhMWRiNmIx&t=TFQrN1EwNWwwV2thVlBjeGpoNS9jMlRBNk5JREczWmVORHV2QlNpR21YTT0=&h=932613dd668d4e0ea6f768041a0bd41e"><span lang="EN-GB">https://gilawa.com</span></a></span><span lang="DE">
</span><span lang="EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="DE">From:</span></b><span lang="DE"> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Michael Friesen<br>
<b>Sent:</b> Friday, November 19, 2021 6:57 PM<br>
<b>To:</b> <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Cc:</b> Julie Fowler <<a href="mailto:jfowler@firstorion.com">jfowler@firstorion.com</a>>; Mike Tihonchik <<a href="mailto:mtihonchik@firstorion.com">mtihonchik@firstorion.com</a>><br>
<b>Subject:</b> [SR-Users] Help with Async transaction responses <o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt">Hello, <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">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?
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">function ksr_request_route()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    if KSR.is_INVITE() then
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">      if KSR.tm.t_newtran() then
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">            cache_transaction_info()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">            KSR.tmx.t_suspend()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">            --perform async loookup
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">        end
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    end
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    return 1
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">end
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">--This function called on response from async lookup. Equivalent of ONREPLY_ROUTE
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">function ksr_reply_route()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    --Finds the transaction_index and transaction_label from a cache
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    KSR.tmx.t_continue(transaction_index, transaction_label, "redirect_transaction");
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    KSR.x.drop()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    return 1
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">end
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">function redirect_transaction()
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    KSR.pv.sets("$fU", "Jenny") --Doesn't actually modify the from username for 302 response!
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    KSR.tm.t_reply(302, "Redirecting")
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    return 1
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">end
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt">Thank you much! <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">-Michael <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
</body>
</html>