<font color='black' size='2' face='arial'><font face="arial"><font size="2">Thank you! &nbsp;I used the usr_preferences table with the debug level 4 it showed me the way. &nbsp;My issue was&nbsp;</font>that<font size="2">&nbsp;I did not set a value for the last value of int.</font></font><br>
<br>
<br>

<div style="color: black; font-size: 10pt; font-family: arial, helvetica;">-----Original Message-----<br>
From: Bogdan-Andrei Iancu &lt;bogdan@opensips.org&gt;<br>
To: OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;; discodog62 &lt;discodog62@aol.com&gt;<br>
Sent: Tue, Sep 16, 2014 12:10 am<br>
Subject: Re: [OpenSIPS-Users] avpops module<br>
<br>




<div id="AOLMsgPart_1_4e52340f-2356-4ec4-ac2f-fa73f7b546ba">

  
    
  
  
<div class="aolReplacedBody" text="#000000" bgcolor="#FFFFFF">
    
<div class="moz-cite-prefix"><tt>Hi</tt><tt>,</tt><tt><br>

      </tt><tt><br>

      </tt><tt>I guess you try to load from avpops table the "myvar" avp
        belonging to UUID "1.2.3.4" (which is actually the src IP) ?</tt><tt><br>

      </tt><tt><br>

      </tt><tt>So:</tt><tt><br>

      </tt><tt><br>

      </tt><tt>1) are you sure you properly order the values according
        to the dbtext header . Note that the official db structure is a
        bit different (see </tt><tt>scripts/dbtext/opensips/usr_preferences
        )</tt><tt><br>

      </tt><tt><br>

      </tt><tt>2) run in debug mode 4 to see more logs from opensips
        when the query is performed.</tt><tt><br>

      </tt><tt><br>

      </tt><tt>3) you may try to temporary use db_mysql (where you can
        trace the actual query to DB level) to see which is the faulty
        part - the why you do the query or the way you have the data in
        DB.</tt><tt><br>

      </tt><tt>&nbsp;&nbsp;&nbsp; </tt><tt><br>

      </tt><tt>Regards,</tt><br>

      <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" target="_blank" removedlink__1058773056__href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
      On 15.09.2014 21:33, <a class="moz-txt-link-abbreviated" removedlink__1058773056__href="mailto:discodog62@aol.com">discodog62@aol.com</a> wrote:<br>

    </div>

    <blockquote type="cite"><font size="2" color="black" face="arial"><font style="font-size: small; background-color: rgb(255, 255,           255);" size="2" face="arial">I am confused on the avpops
          module. &nbsp;I am hoping some one can straight things out for me.
          &nbsp;</font><span style="font-size: small; background-color:           rgb(255, 255, 255);"></span>
        
<div style="font-size: small; background-color: rgb(255, 255,           255);"><font size="2" face="arial"><br>

          </font></div>

        
<div style="font-size: small; background-color: rgb(255, 255,           255);"><font size="2" face="arial">I am using opensips 1.8</font>
          
<div style="font-size: 10pt;"><br>

          </div>

          
<div style="font-size: 10pt;">Here is my relevant setup</div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div style="font-size: 10pt;">1.2.3.4 is the IP that I am
            sending the call from.</div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div><font face="arial">loadmodule "avpops.so"</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">modparam("avpops",
              "db_url","text:///etc/opensips/dbtext")&nbsp;</font></div>

          
<div><font face="arial">modparam("avpops","avp_table","avpops")</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">my avpops db_text file</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">
              
<div>id(int,auto) username(string) attribute(string)
                value(string) uuid(string) domain(string) type(int)</div>

              
<div>1::myvar:AAAAA:1.2.3.4::</div>

            </font></div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div style="font-size: 10pt;"><span style="font-size: 10pt;">I
              am hoping that I can use the avpops module to do the
              following....</span></div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div style="font-size: 10pt;">when a call comes in I would
            like to use the source ip to match the UUID and load the
            attribute value into my variable $avp(myvar).</div>

          
<div style="font-size: 10pt;"><br>

          </div>

          
<div>
            
<div><font face="arial">avp_db_load("$si","$avp(myvar)/avpops");</font></div>

            
<div><font face="arial">&nbsp;&nbsp;</font></div>

            
<div><font face="arial">&nbsp;xlog("L_INFO","****** Updated AVP:
                $avp(</font>myvar<font face="arial">) ******\n");</font></div>

          </div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">When I do this I see&nbsp;&lt;null&gt;&nbsp;in
              my $svp(myvar).</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">I also tried assigning the $si to a
              avp variable&nbsp;as well&nbsp;</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div><font face="arial">$avp(tst_uuid) = $si;</font></div>

          
<div><font face="arial"><br>

            </font></div>

          
<div>avp_db_load("<span style="font-size: 10pt;">$avp(tst_uuid)</span><span style="font-size: 10pt;">","$avp(myvar)/avpops");</span></div>

          
<div><span style="font-size: 10pt;"><br>

            </span></div>

          
<div><span style="font-size: 10pt;">same results.</span></div>

          
<div><span style="font-size: 10pt;"><br>

            </span></div>

          
<div><span style="font-size: 10pt;"><br>

            </span></div>

          
<div><span style="font-size: 10pt;">I added the avp_print()</span></div>

          
<div><span style="font-size: 10pt;"><br>

            </span></div>

          
<div><span style="font-size: 10pt;">and I would see this</span></div>

          
<div><span style="font-size: 10pt;"><br>

            </span></div>

          
<div>
            
<div><font face="arial">Sep 15 11:10:07 [15608]
                <a class="moz-txt-link-freetext">INFO:avpops:ops_print_avp</a>: p=0x7fa1364ae880,
                flags=0x0002</font></div>

            
<div><font face="arial">Sep 15 11:10:07 [15608]
                <a class="moz-txt-link-freetext">INFO:avpops:ops_print_avp</a>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;id=&lt;1&gt;</font></div>

            
<div><font face="arial">Sep 15 11:10:07 [15608]
                <a class="moz-txt-link-freetext">INFO:avpops:ops_print_avp</a>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;val_str=&lt;1.2.3.4 / 13&gt;</font></div>

          </div>

        </div>

      </font>
      <br>

      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>

      <pre>_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" removedlink__1058773056__href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" target="_blank" removedlink__1058773056__href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>

  </div>



</div>




</div>
</font>