<div dir="ltr">God morgen Kjeld,<div><br></div><div>You can use uac_replace_from/_to in a branch route, e.g.:</div><div><br></div><div>[...]<br></div><div>$avp(from_uri) = "sip:"+$dbr(ra=>[0,1])+"@EXTERNALIP";</div><div>t_on_branch("UPDATE_FROM");</div><div>[...]</div><div><br></div><div>branch_route(UPDATE_FROM) {</div><div>  uac_replace_from("$avp(from_uri)");</div><div>}</div><div><br></div><div>This should solve your issue.</div><div><br></div><div>Med venlig hilsen,</div><div>Carsten Bock (lidt Vendelbo)</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">--</div><div dir="ltr">Carsten Bock I CTO & Founder</div><div dir="ltr"><br><p style="margin:0cm 0cm 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">ng-voice GmbH</span><span lang="EN-US" style="color:rgb(0,112,192)"><u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">Trostbrücke 1 I 20457 Hamburg I Germany<br>T +49 40 524 75 93-40 | M +49 179 2021244 I <a href="http://www.ng-voice.com/" style="color:rgb(17,85,204)" target="_blank"><span style="color:black">www.ng-voice.com</span></a><u></u><u></u></span></p><p style="margin:0cm 0cm 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">Registry Office at Local Court Hamburg, HRB 120189<br>Managing Directors: Dr. David Bachmann, Carsten Bock</span></p></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am So., 19. Jan. 2020 um 23:20 Uhr schrieb Kjeld Flarup <<a href="mailto:kjeld.flarup@liberalismen.dk">kjeld.flarup@liberalismen.dk</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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 <br>
the 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 <br>
is 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 <br>
two different From headers in the same SIP dialog.<br>
<br>
Unfortunately uac_replace_from is not allowed in failure_route, so I <br>
could 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>