<div dir="ltr"><div><div><div>Hi George,<br><br></div>If you are asking about this part:<br><br>if (from_uri!=myself && uri!=myself) {<br>        sl_send_reply("403","Not relaying");<br>        exit;<br>    }<br><br></div>Then this mean that we do not want to deal with sip requests which not send to us or not by us. So any request which is not related to us we will not serve.<br><br></div><div>Keep in mind that "to" header by sip RFC can contain anything and we don't care in most cases what is there.<br><br><a href="https://tools.ietf.org/html/rfc3261#page-36">https://tools.ietf.org/html/rfc3261#page-36</a><br></div><div><br></div>With kind regards,<br></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_-1527416637510506381gmail-result_box" class="m_-1527416637510506381gmail-short_text" lang="en"><span class="m_-1527416637510506381gmail-">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>