<div dir="ltr"><br><div>Hi</div><div><br></div><div>Still searching on that one. My guess now is that I am receiving another 401 because the CSEQ does not get incremented.</div><div><br></div><div><div style="font-size:12.8px">INVITE cseq 102---></div><div style="font-size:12.8px"><---- 401 (with nonce) <span style="font-size:12.8px">cseq 102</span></div><div style="font-size:12.8px">ACK <span style="font-size:12.8px">cseq 102 </span><span style="font-size:12.8px">---></span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">INVITE ---> with correct nonce & response, I've recalculated the response, it is ok -- <span style="font-size:12.8px">cseq 102</span></div><div style="font-size:12.8px"><--- 401 (with new nonce) <span style="font-size:12.8px">cseq 102</span></div><div style="font-size:12.8px">ACK --><span style="font-size:12.8px">cseq 102</span></div></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">I think the 2nd exchange should have a cseq of 103 or higher. </span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">How can I increase it ?</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">J.</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">// Here is the section  generating the reply with the wrong cseq</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">if(t_check_status("401|407")) {</span><br style="font-size:12.8px"><span style="font-size:12.8px">        $avp(auser) = "test";</span><br style="font-size:12.8px"><span style="font-size:12.8px">        $avp(apass) = "test";</span><br style="font-size:12.8px"><span style="font-size:12.8px">        uac_auth();</span><br style="font-size:12.8px"><span style="font-size:12.8px">        t_relay();</span><br style="font-size:12.8px"><span style="font-size:12.8px">        exit;</span><br style="font-size:12.8px"><span style="font-size:12.8px">}</span><br style="font-size:12.8px"></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 26, 2017 at 11:02 AM, Jean Cérien <span dir="ltr"><<a href="mailto:cerien.jean@gmail.com" target="_blank">cerien.jean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><span class="HOEnZb"><font color="#888888"><div><br></div><div>J.</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><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>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_avp<wbr>","$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="m_-3404392377872361154HOEnZb"><div class="m_-3404392377872361154h5"><br>
<br>
<br>
______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>