<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 3/13/12 5:05 PM, Simpson Chua wrote:
    <blockquote
      cite="mid:1331654709.41676.YahooMailNeo@web46011.mail.sp1.yahoo.com"
      type="cite">
      <div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
        255); font-family: verdana,helvetica,sans-serif; font-size:
        10pt;">
        <div>
          <div><font size="2">Hi,</font></div>
          <div><font size="2"><br>
            </font></div>
          <div><font size="2">I'm trying to use avp_db_load to check for
              some IPs but I'm getting bad avp flags errors. As far as I
              understand, the syntax is correct.&nbsp;</font></div>
          <div><font size="2"><br>
            </font></div>
          <div><font size="2">TableName: labservers</font></div>
          <div><font size="2">uuid &nbsp; username &nbsp; &nbsp;domain &nbsp; &nbsp; &nbsp;attribute &nbsp;
              &nbsp; &nbsp; &nbsp; &nbsp;value &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type</font></div>
          <div><font size="2">"" &nbsp; &nbsp; &nbsp;"" &nbsp; &nbsp;<span class="Apple-tab-span"
                style="white-space:pre"> </span> &nbsp;<span
                class="Apple-tab-span" style="white-space:pre"> </span>&nbsp;"domain1"
              &nbsp; &nbsp;"lab1" &nbsp; &nbsp; &nbsp;"192.168.55.1" &nbsp; &nbsp; &nbsp; &nbsp;0&nbsp;</font></div>
          <div><font size="2">"" &nbsp; &nbsp; &nbsp;"" &nbsp; &nbsp; &nbsp;<span
                class="Apple-tab-span" style="white-space:pre"> </span>&nbsp;"domain1"
              &nbsp; &nbsp;"lab1" &nbsp; &nbsp; &nbsp;"192.168.55.2" &nbsp; &nbsp; &nbsp; &nbsp;0&nbsp;</font></div>
          <div><font size="2">"" &nbsp; &nbsp; &nbsp;"" &nbsp; <span class="Apple-tab-span"
                style="white-space:pre"> </span>&nbsp;"domain2" &nbsp; &nbsp;"lab2" &nbsp;
              &nbsp; &nbsp;"192.168.55.3" &nbsp; &nbsp; &nbsp; &nbsp;0&nbsp;</font></div>
          <div><font size="2">"" &nbsp; &nbsp; &nbsp;"" &nbsp; <span class="Apple-tab-span"
                style="white-space:pre"> </span>&nbsp;"domain2" &nbsp; &nbsp;"lab2" &nbsp;
              &nbsp; &nbsp;"192.168.55.4" &nbsp; &nbsp; &nbsp; &nbsp;0&nbsp;</font></div>
          <div><font size="2"><br>
            </font></div>
          <div><font size="2">if
              ((avp_db_load("$ruri/domain","s:lab1/labservers")
              &amp;&amp; avp_check("s:lab1", "eq/$Ri/gi"))) {</font></div>
          <div><span style="font-size: 13px; "># Do something</span><br>
          </div>
          <div><span style="font-size: 13px; ">}</span><br>
          </div>
          <div><font size="2"><br>
            </font></div>
          <div><font size="2">
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [rvalue.c:2857]: RV fixing type 3</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [rvalue.c:2857]: RV fixing type 2</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [rvalue.c:2865]: RV is str: "REGISTER"</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [route.c:506]: right EXP optimized: op10(O51, _ST22_)
                =&gt; op10(O51, _ST1_)</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [rvalue.c:2857]: RV fixing type 4</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: DEBUG: &lt;core&gt;
                [route.c:929]: fixing avp_db_load()</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: ERROR: avpops
                [avpops_parse.c:129]: error - bad avp flags</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: ERROR: avpops
                [avpops.c:299]: parse failed</div>
              <div>Mar 13 10:55:24 ubuntu
                /usr/local/sbin/kamailio[12012]: ERROR: &lt;core&gt;
                [route.c:1216]: fixing failed (code=-1) at
                cfg:/usr/local/etc/kamailio//kamailio.cfg:71</div>
              <div><br>
              </div>
              <div>Line 71 is the "if" statement above. Could someone
                see could be the issue?</div>
            </font></div>
        </div>
      </div>
    </blockquote>
    first problem is that you use a very old avp name syntax for
    avp_db_load() -- for many version the avp names have to be provided
    as full avp specs. So instead of "s:lab1" you have to use
    $avp(s:lab1) (you can even omit the 's:' if you run 3.x.<br>
    <br>
    Try with these changes and if you get other errors, paste the
    messages back to an email to the list.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
  </body>
</html>