<p></p>
<h3>Description</h3>
 Kamailio (UAC) ---> Asterisk 
<p>Call comes from DID Trunk and UAC module is used as per some fixed mapping in DB so we use that user to make call Asterisk through UAC as shown below.</p>
<pre><code>$var(original_ru) = $rU;
if (uac_reg_request_to("$avp(auser)", 1)) {

                        $var(status) = uac_reg_status("$rU"); 
                        $rU = $var(original_ru) ;
t_on_failure("REMOTE_AUTH");
}


failure_route[REMOTE_AUTH] {
    if (t_check_status("401|407")) {
            xlogl("L_INFO", " Remote asked for authentication");
        t_drop_replies();
                # - remove preloaded route headers
                remove_hf("Route");           
                record_route();
                $avp(authed) = 1;
                
                # Drop replies so that they are not sent back to the UAC
                uac_auth();
                route(RELAY);
    }
}
</code></pre>
<p>in all this activity Contact Header also replaced by UAC_AUTH so Replies from Asterisk reaches to Kamailio but does not relay back to DID Trunk.<br>
--></p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>

<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<pre><code>(paste your log messages here)
</code></pre>
<h4>SIP Traffic</h4>

<pre><code>(paste your sip traffic here)
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>(paste your output here)
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>(paste your output here)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2504">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJUFFBKV6PH6TVEA7LSKHVY7ANCNFSM4SL5KRXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZINSZ6I7NBKW7ERKB3SKHVY7A5CNFSM4SL5KRXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KWZL4AQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2504",
"url": "https://github.com/kamailio/kamailio/issues/2504",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>