<div dir="ltr"><div><div>Hi George,<br><br></div>I misread your email, sorry.<br><br></div><div>In your case scenario is when somebody from outside tries to call user registered in kamailio, by default it is allowed. We do not need to challenge such request, because it is user from outside, not our subscriber and by default kamailio allows such calls and in this case such call will finish in location route and eventually will reach user.<br><br>I hope I understood you and I didn't messed anything again. :)<br><br></div><div>With kind regards,<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Jurijs<br></div></div></div>
<br><div class="gmail_quote">On Wed, Aug 2, 2017 at 4:01 PM, George Diamantopoulos <span dir="ltr"><<a href="mailto:georgediam@gmail.com" target="_blank">georgediam@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"><div><div><div><div><div><div><div>Hello again,<br><br>Still getting familiar with kamailio, and I'm wondering about the AUTH route in the example configuration file. Here's a reducted-simplified version of it for reference (from git master, without IP AUTH and comments):<br><br>______________________________<wbr>________________<br>route[AUTH] {<br>    if (is_method("REGISTER") || from_uri==myself) {<br>        if (!auth_check("$fd", "subscriber", "1")) {<br>            auth_challenge("$fd", "0");<br>            exit;<br>        }<br>        if(!is_method("REGISTER|<wbr>PUBLISH"))<br>            consume_credentials();<br>    }<br>    if (from_uri!=myself && uri!=myself) {<br>        sl_send_reply("403","Not relaying");<br>        exit;<br>    }<br>    return;<br>}<br>______________________________<wbr>________________<br><br>So the way I see it, what happens is the following:<br><br>* All REGISTERs will be challenged<br>* All SIP messages with kamailio's aliases in the "From" header URI will be challenged<br>* All SIP messages with no reference to kamailio's aliases in both R-URI and "From" header URI will be dropped<br><br>The question is, what about messages that do not enter either of the two conditionals? For example, I expect the following to be very common:<br><br>* Method: INVITE<br>* R-URI: myself<br>* From: username@"UAC's local IP address" (not myself)<br>* To: myself<br><br></div>So in the example above, the auth route will return without either having challenged or dropped the request, am I correct? This is because:<br><br></div>* For the challenge: Method is not REGISTER and "From URI" is not one of kamailio host's aliases (c<span id="m_3029870086656655110gmail-result_box" class="m_3029870086656655110gmail-short_text" lang="en"><span class="m_3029870086656655110gmail-">umulatively)</span></span></div></div>* For dropping after sending 403: "From URI" is not one of kamailio's host's aliases (which calculates to true) but R-URI is "myself"<br><br></div>So I'm guessing we're expecting the challenge to come from elsewhere in cases like the example above? Or is there something else I'm missing here? Thanks!<br><br></div>BR,<br></div>George<br></div>
<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>
<br></blockquote></div><br></div>