<div dir="ltr"><br><div>Thanks - I've done some progress - I've hard coded temporarily the user, pass & realm, and authentication goes out now.</div><div><br></div><div>However, the provider is answering with a 401 & a new nonce.</div><div><br></div><div>here is what I have </div><div><br></div><div>INVITE ---></div><div><---- 401 (with nonce)</div><div>ACK ---></div><div>INVITE ---> with correct nonce & response, I've recalculated the response, it is ok</div><div><--- 401 (with new nonce)</div><div>ACK --></div><div><br></div><div>When I configure another box with a plain asterisk and same credentials, the call goes through fine - so it is not because my ip is wrong or not whitelisted. </div><div><br></div><div>Why would the remote send me a 401 ??? I've tried to contact them but no answer</div><div><br></div><div>J.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 26, 2017 at 10:03 AM, Daniel Tryba <span dir="ltr"><<a href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Sep 26, 2017 at 09:36:19AM -0400, Jean Cérien wrote:<br>
> I've inserted the following block on the failure route:<br>
>         if (t_check_status("401|407")) {<br>
>                 xlog("L_INFO","failure_route(<wbr>ROUTEFAIL) @@ call to<br>
> uac_auth()\n");<br>
>                 uac_auth();<br>
>                 t_relay();<br>
>                 exit;<br>
>         }<br>
<br>
</span>Unlike when calling uac_reg_request_to, you'll have to fill the<br>
auth_*_avp pvs yourself. So in the example you have to fill $avp(auser)<br>
and $avp(apass).<br>
<br>
modparam("uac","auth_username_<wbr>avp","$avp(auser)")<br>
modparam("uac","auth_password_<wbr>avp","$avp(apass)")<br>
modparam("uac","auth_realm_<wbr>avp","$avp(arealm)")<br>
<br>
...<br>
<br>
if(t_check_status("401|407")) {<br>
        $avp(auser) = "test";<br>
        $avp(apass) = "test";<br>
        uac_auth();<br>
        t_relay();<br>
        exit;<br>
}<br>
<br>
So next problem is how to get those credentials. You already know the<br>
user making the call. So either have a custom query to a custom table<br>
(sqlops/avpops) to retrieve the external user/pass for current user, or<br>
try to store that information with the subscriber data (saw some<br>
suggestions for this a while back on the list).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">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/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</div></div></blockquote></div><br></div>