<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Vic,<br>
    <br>
    I just did a quick test with<br>
    <br>
    loadmodule "db_mysql.so"<br>
    loadmodule "permissions.so"<br>
    modparam("permissions", "db_url",
    "mysql://opensips:opensipsrw@localhost/opensips")<br>
    <br>
    ####### Routing Logic ########<br>
    <br>
    startup_route {<br>
        check_address( 1, "1.2.3.4" , 5060, "ANY", $avp(groupid));<br>
        xlog("Call coming from trunk with $avp(groupid)\n");<br>
    }<br>
    <br>
    mysql> select * from address \G<br>
    *************************** 1. row ***************************<br>
              id: 1<br>
             grp: 1<br>
              ip: 1.2.3.4<br>
            mask: 1<br>
            port: 5060<br>
           proto: any<br>
         pattern: NULL<br>
    context_info: 10<br>
    1 row in set (0.00 sec)<br>
    <br>
    And I got "Call coming from trunk with 10"<br>
    <br>
    Regards,<br>
    <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>

</pre>
    <div class="moz-cite-prefix">On 6/17/20 9:15 PM, Vic Jolin wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAA+eT4nMZwpFntXYh1sHm952216k-K_Q_nB1GzjUE55oDpg5Tg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr"><br>
        <div class="gmail_quote">
          <div dir="ltr">Hi all, I have IP addresses setup in my mysql
            table address
            <div><br>
            </div>
            <div>+----+-----+----------------+------+------+-------+---------+--------------+<br>
              | id | grp | ip             | mask | port | proto |
              pattern | context_info |<br>
+----+-----+----------------+------+------+-------+---------+--------------+<br>
              |  9 |   1 | x.x.x.x   |    1 | 5060 | any   |         |
              10           |<br>
+----+-----+----------------+------+------+-------+---------+--------------+<br>
            </div>
            <div><br>
            </div>
            <div>But when I check source address in opensips.cfg</div>
            <div><br>
            </div>
            <div>check_source_address( 1, $avp(groupid))<br>
            </div>
            <div>xlog("Call coming from trunk with $avp(groupid)\n");<br>
            </div>
            <div><br>
            </div>
            <div>The output thou is:</div>
            <div><b>Call coming from trunk with 1</b><br>
            </div>
            <div><b><br>
              </b></div>
            <div>Can anyone shed some light on this?</div>
          </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>