<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=utf-8">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">WE had an issue like with while using rtjson module. The solution for us, was to ensure that the auc_replace was being done in new branches (t_on_branch). If it wasn’t, uac_auth didn’t preserve any
 to/from changes between INVITE without and with auth.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><a href="https://www.mail-archive.com/sr-users@lists.kamailio.org/msg10808.html">https://www.mail-archive.com/sr-users@lists.kamailio.org/msg10808.html</a><span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Kind Regards,<b><o:p></o:p></b></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b>Ben</b><span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>Joel Serrano<br>
<b>Sent:</b> 20 January 2020 03:27<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Subject:</b> Re: [SR-Users] uac_replace_from and uac_auth fails to authenticate.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Have you tried setting $fU/$fd directly in failure_route before uac_auth()?<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sun, Jan 19, 2020 at 14:35 Kjeld Flarup <<a href="mailto:kjeld.flarup@liberalismen.dk">kjeld.flarup@liberalismen.dk</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Thanks for confirming.<br>
<br>
As there seems to be no way to correct the From header in <br>
failure_dialog, then the From header has to be modified before I receive <br>
the call then. Which could be done by cascading with a Cascading <br>
Kamailio instance.<br>
<br>
<br>
-------------------- Med Liberalistiske Hilsner ----------------------<br>
    Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog<br>
    <a href="https://www.google.com/maps/search/Sofienlundvej+6B,+7560+Hjerm?entry=gmail&source=g">
Sofienlundvej 6B, 7560 Hjerm</a>, Tlf: 40 29 41 49<br>
    Den ikke akademiske hjemmeside for liberalismen - <a href="http://www.liberalismen.dk" target="_blank">
www.liberalismen.dk</a><br>
<br>
On 1/19/20 11:22 PM, Alex Balashov wrote:<br>
> In non-REGISTER requests, the From URI is the identity being asserted,<br>
> and supported by the authentication credentials.<br>
><br>
> If you have control over the upstream Kamailio server, you can tinker<br>
> with authentication options which enforce equivalence between the<br>
> authentication username/realm and the From URI user/domain --<br>
> specifically, by turning off this enforcement.<br>
><br>
> If you don't, then a modified From value will indeed be a problem<br>
> insofar as it may deviate from the authentication credentials.<br>
><br>
> -- Alex<br>
><br>
> On Sun, Jan 19, 2020 at 11:19:26PM +0100, Kjeld Flarup wrote:<br>
><br>
>> I have a setup where I have a fallback to a GSM number<br>
>><br>
>> I look up the GSM number and provider information in a database and sets the<br>
>> headers.<br>
>><br>
>>                    dlg_manage();<br>
>>                    $du = "sip:" + $dbr(ra=>[0,0]);<br>
>>                    $tu = "sip:"+$rU+"@"+$dbr(ra=>[0,0]);<br>
>>                    $ru = "sip:"+$rU+"@"+$dbr(ra=>[0,0]);<br>
>> uac_replace_from("sip:"+$dbr(ra=>[0,1])+"@EXTERNALIP");<br>
>><br>
>> After this the call goes to a failure_route to do uac_auth()<br>
>><br>
>> Now my problem is that this works with the providers Asterisk server.<br>
>> But if the call is send to the providers Kamailio server, authentication is<br>
>> rejected.<br>
>><br>
>> Removing uac_replace_from makes the call accepted on the Kamailio server<br>
>><br>
>> The only possible problem I can see is that the first INVITE without<br>
>> authentication, has correct From header.<br>
>> But the second with the nonce and auth, uses the wrong From header. Thus two<br>
>> different From headers in the same SIP dialog.<br>
>><br>
>> Unfortunately uac_replace_from is not allowed in failure_route, so I could<br>
>> test if this is the problem.<br>
>><br>
>> Is the two different From headers a problem, and how could that be fixed.<br>
>><br>
>><br>
>> -- <br>
>> -------------------- Med Liberalistiske Hilsner ----------------------<br>
>>     Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog<br>
>>     Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49<br>
>>     Den ikke akademiske hjemmeside for liberalismen - <a href="http://www.liberalismen.dk" target="_blank">
www.liberalismen.dk</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Kamailio (SER) - Users Mailing List<br>
>> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>