<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Paul,<br>
      <br>
      The usage of avp_db_load() is no right . see:<br>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/avpops.html#id293741">http://www.opensips.org/html/docs/modules/1.11.x/avpops.html#id293741</a><br>
      <br>
      Instead of:<br>
      &nbsp;&nbsp;&nbsp; avp_db_load("$to/username", "s:site1/usr_preferences");<br>
      try:<br>
      &nbsp;&nbsp;&nbsp; avp_db_load("$to/username", "$avp(site1)/usr_preferences");<br>
      <br>
      Regards,<br>
      <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>
      On 18.07.2014 00:43, Paul Williams wrote:<br>
    </div>
    <blockquote
      cite="mid:1405633408.40910.YahooMailNeo@web120802.mail.ne1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12pt">
        <div style="" class="">Can anyone help me with a basic
          integration example of db_text module to store some custom
          data and reference that data using an AVP variable.</div>
        <div style="" class=""><br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">These are
          the errors received.. I know this has to do with my
          avp_db_load, but I wanted to make sure I set everything else
          up as well.<br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">Jul 17
          17:19:13 ServerName /usr/sbin/opensips[5526]:
          ERROR:avpops:parse_avp_db: error - bad avp flags<br style=""
            class="">
          Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]:
          ERROR:avpops:fixup_db_avp: parse failed<br style="" class="">
          Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]:
          ERROR:core:fix_actions: fixing failed (code=-1) at cfg line
          214<br style="" class="">
          Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]:
          ERROR:core:main: failed to fix configuration with err code -1<br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">Here's my
          current setup.</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">I have a
          file called usr_preferences in the /etc/opensips/dbtext
          directory</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">Contents
          are....<br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">id(int,auto)
          username(str) attribute(str) value(str)<br style="" class="">
          1:1234:site1:9545551212<br style="" class="">
          2:i5678:site2:7183334444<br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">my
          opensipsctl file has<br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"># database
          path used by dbtext or db_berkeley<br style="" class="">
          DB_PATH="/etc/opensips/dbtext"</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br>
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br>
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">my
          relevant modules&nbsp; and params are</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">loadmodule
          "db_text.so"<br style="" class="">
          modparam("db_text", "db_mode", 1)</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">loadmodule
          "avpops.so"<br style="" class="">
          modparam("avpops", "db_url", "text:///")<br style="" class="">
          modparam("avpops", "avp_table", "usr_preferences")</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">I'm
          referencing as<br style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">avp_db_load("$to/username",
          "s:site1/usr_preferences");</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">Any
          insight would be helpful, I'm sure I'm making some silly
          mistakes, but I've tried numerous combinations at this point.</div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;">And yes,
          I've searched all over the place, but couldn't find anything
          that clarified exactly. I also read the docs and the book.<br
            style="" class="">
        </div>
        <div class="" style="color: rgb(0, 0, 0); font-size: 16px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;"><br
            style="" class="">
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>