<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <tt>Hi Alexey,<br>
      <br>
      As per docs, the is_registered() function accepts as the AOR param
      a valid SIP URI, not a username. So push $fu and not $fU.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2020 online
  <a class="moz-txt-link-freetext" href="https://opensips.org/training/OpenSIPS_eBootcamp_2020/">https://opensips.org/training/OpenSIPS_eBootcamp_2020/</a></pre>
    <div class="moz-cite-prefix">On 10/26/20 3:49 PM, Alexey Kazantsev
      via Users wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1603720172.227234944@f543.i.mail.ru">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>Hi list,</div>
      <div> </div>
      <div>OpenSIPS 2.4.8</div>
      <div> </div>
      <div>is it possible to use is_registered() finction</div>
      <div>if the registered users are saved by mid_registrar module,</div>
      <div>and forwarded further to the main registrar server?</div>
      <div> </div>
      <div>mid_registrar saves users’ location well, to the «location»
        table,</div>
      <div>‘opensipsctl fifo ul_dump’ shows the list of registered
        users.</div>
      <div> </div>
      <div>I’m trying to drop (ignore) all INVITEs to the external
        OpenSIPS interface</div>
      <div>except 1) from registered users, 2) from VoIP providers SIP
        trunks.</div>
      <div> </div>
      <div>Here’s the construction:</div>
      <div> </div>
      <div>
        <ol class="text" style="-webkit-text-stroke-width:0px;
          background:#ffffff; box-sizing:border-box; color:#333333;
          font-family:Consolas,Menlo,Monaco,"Lucida
          Console","Liberation Mono","DejaVu Sans
          Mono","Bitstream Vera Sans
          Mono",monospace,serif; font-size:12px; font-style:normal;
          font-variant-caps:normal; font-variant-ligatures:normal;
          font-weight:400; letter-spacing:normal; margin-bottom:0px;
          margin-left:0px; margin-right:0px; margin-top:0px; orphans:2;
          padding:0px 10px; text-align:start;
          text-decoration-color:initial; text-decoration-style:initial;
          text-indent:0px; text-transform:none; vertical-align:baseline;
          white-space:normal; widows:2; word-spacing:0px">
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap"># initial INVITE</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">if(is_method("INVITE"))</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">{</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap"># invite neither from VoIP ISP, nor from registered user -> drop</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">if(!is_myself("$si") && $Rp == 5060) {</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">if(!is_registered("location", "$fU") || !check_source_address("1")) exit;</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">}</div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap"> </div>
          </li>
          <li class="li1" style="box-sizing: border-box; margin: 0px 0px
            0px -6px; padding: 0px; font-size: 12px; vertical-align:
            baseline; list-style-type: decimal; user-select: none;
            display: list-item; background: rgb(255, 255, 255); color:
            rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco,
            "Lucida Console", "Liberation Mono",
            "DejaVu Sans Mono", "Bitstream Vera Sans
            Mono", monospace, serif;">
            <div class="de1" style="background:#ffffff; border-left:1px solid #dddddd; box-sizing:border-box; color:#000000; font-size:12px; margin-bottom:0px; margin-left:-7px; margin-right:0px; margin-top:0px; padding:0px 8px; user-select:text; vertical-align:top; white-space:pre-wrap">...</div>
          </li>
        </ol>
      </div>
      <div> </div>
      <div>But the result is that _all_ invites are dropped, even from
        providers’ IP addresses</div>
      <div>and from registered users.</div>
      <div> </div>
      <div>I also checked logs and found there such an ERROR:</div>
      <div> </div>
      <div>    ERROR:core:parse_uri: bad uri, state 0 parsed:
        <grz1> (4) / <grz106> (6)<br>
            ERROR:registrar:extract_aor: failed to parse Address of
        Record<br>
            ERROR:registrar:msg_aor_parse: failed to extract address of
        record!<br>
            ERROR:registrar:is_registered: failed to parse!<br>
         </div>
      <div>So, what is the reason of unsuccessful call passing from
        registered users and white listed IPs,</div>
      <div>and why the ERROR occurs? (users have sip accounts like
        grz1XX, it’s also strange that grz1</div>
      <div>is in logs).</div>
      <div data-signature-widget="container">
        <div data-signature-widget="content">
          <div>-----------------------------------------------<br>
            <span style="font-size: 15px;">BR, Alexey</span><br
              style="font-size: 15px;">
            <span style="font-size: 15px;"><a class="moz-txt-link-freetext" href="http://alexeyka.zantsev.com/">http://alexeyka.zantsev.com/</a></span></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
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>
    <br>
  </body>
</html>