<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <tt>Hello Stian,<br>
      <br>
      AOR&nbsp; <a class="moz-txt-link-abbreviated" href="mailto:nnnn0790@y.y.y.y">nnnn0790@y.y.y.y</a>&nbsp; and <a moz-do-not-send="true"
        href="mailto:nnnn0790@domain.no">nnnn0790@domain.no</a> are
      completly different - according to SIP, they do not match or so.
      So you have to use the same AOR when registering the user (AOR
      will be in To hdr) and when calling the user (AOR will be in
      RURI).<br>
      <br>
      Maybe the doc can be misleading a bit when using the terminology
      of "username" - but this has to be interpreted in the context of
      "use_domain" parameter from usrloc:<br>
      &nbsp;&nbsp;&nbsp;
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.9.x/usrloc.html#id292895">http://www.opensips.org/html/docs/modules/1.9.x/usrloc.html#id292895</a><br>
      <br>
      So, docs are not clear, we will take care of that!<br>
    </tt><tt><br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 04/29/2013 01:28 PM, Stian &Oslash;vrev&aring;ge wrote:
    <blockquote
cite="mid:CAGvr99+N69mci7fAeiSggkpGiBV2wLTDv9pc-RYCw_+YLvfScw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi list,
        <div><br>
        </div>
        <div style="">I have in my config:</div>
        <div style=""><br>
        </div>
        <div style="">
          <div>if (!lookup("location","m")) {</div>
          <div><span class="" style="white-space: pre;"> </span>switch
            ($retcode) {</div>
          <div><span class="" style="white-space: pre;"> </span>case
            -1: # Not used</div>
          <div><span class="" style="white-space: pre;"> </span>case
            -3: # User not found, forward</div>
          <div><span class="" style="white-space: pre;"> </span>xlog("DESCISION:
            &lt;$proto&gt;&lt;CallID:$ci&gt;&lt;CSeq:$cs&gt;&lt;Method:$rm&gt;&lt;$si:$sp&gt;to&lt;$Ri:$Rp&gt;
            To: $tu not found. Route upstream");</div>
          <div><span class="" style="white-space: pre;"> </span>route(upstream);</div>
          <div><span class="" style="white-space: pre;"> </span>exit;</div>
          <div><span class="" style="white-space: pre;"> </span>case
            -2: # Not used</div>
          <div>
            <span class="" style="white-space: pre;"> </span>sl_send_reply("405",
            "Method Not Allowed");</div>
          <div><span class="" style="white-space: pre;"> </span>exit;</div>
          <div><span class="" style="white-space: pre;"> </span>}</div>
          <div>}</div>
          <div><br>
          </div>
          <div style="">When I'm getting an incomming call, I see in my
            log:</div>
          <div style=""><br>
          </div>
          <div style="">/usr/sbin/opensips[11393]: DESCISION:
            &lt;udp&gt;<a class="moz-txt-link-rfc2396E" href="mailto:CallID:x@x.x.x.x">&lt;CallID:x@x.x.x.x&gt;</a>&lt;CSeq:11061&gt;&lt;Method:INVITE&gt;&lt;x.x.x.x:5060&gt;to&lt;y.y.y.y:5060&gt;
            To: <a class="moz-txt-link-freetext" href="sip:nnnn0790@y.y.y.y:5060">sip:nnnn0790@y.y.y.y:5060</a> not found. Route upstream<br>
          </div>
        </div>
        <div><br>
          <div style="">Ergo, OpenSIPS fails to lookup the subscriber.
            However, when using opensipsctl the subscriber is clearly
            registered on the server:</div>
          <div style=""><br>
          </div>
          <div style="">AOR:: <a moz-do-not-send="true"
              href="mailto:nnnn0790@domain.no">nnnn0790@domain.no</a><br>
          </div>
          <div style=""><br>
          </div>
          <div style="">The only difference is that the AOR is
            registered with the domain and the INVITE is referencing the
            server IP. According to the documentation [1], this should
            not be a problem because "<span style="color: rgb(0, 0, 0);
              font-family: Helvetica,Arial; font-size: 12px; text-align:
              justify;">The functions extracts username from Request-URI
              and tries to find all contacts for the username in
              usrloc.".</span></div>
          <div style=""><span style="color: rgb(0, 0, 0); font-family:
              Helvetica,Arial; font-size: 12px; text-align: justify;"><br>
            </span></div>
          <div style=""><span style="color: rgb(0, 0, 0); font-family:
              Helvetica,Arial; font-size: 12px; text-align: justify;">As
              I'm no SIP expert I thought that I might have
              misunderstood what actually was meant by the "username"
              part of the R-URI, I assumed it was just the actual phone
              number, exclusive of host-name. Section 19.1.1 of RFC 3261
              (SIP) confirms this "</span><span style="color: rgb(0, 0,
              0); font-size: 1em;"><a class="moz-txt-link-freetext" href="sip:user:password@host:port;uri-parameters?headers">sip:user:password@host:port;uri-parameters?headers</a>".</span></div>
          <div><br>
          </div>
          <div>[1].&nbsp;<a moz-do-not-send="true"
href="http://www.opensips.org/html/docs/modules/devel/registrar.html#id293055">http://www.opensips.org/html/docs/modules/devel/registrar.html#id293055</a><br>
          </div>
          <div><br>
          </div>
          <div>version: opensips 1.9.0-notls (x86_64/linux)<br>
          </div>
          <div><br>
          </div>
          <div style="">So I can only conclude that either code is
            broken or documentation is broken, or both.&nbsp;</div>
          <div><br>
          </div>
          <div>Brgds,<br clear="all">
            <div>Stian &Oslash;vrev&aring;ge</div>
          </div>
        </div>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>