<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">David,<div><br></div><div>The documentation and examples included with opensips are excellent for this type of operation. &nbsp;The first place I use it in my opensips.cfg is to load a trunk flag variable, using the To user of the registration as the key. &nbsp;This key matches the UUID in my "trunk" table.</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (is_method("REGISTER")) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (is_avp_set("$avp(s:t_flags)")) avp_delete("$avp(s:t_flags)/g");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;avp_db_load("$tU", "$avp(s:t_flags)");</div><div><br></div><div>In this case, I load an avp called&nbsp;$avp(s:t_flags) based on the To user of the REGISTER packet (pseudo-variable $tU), clearing it out just in case it was already there. &nbsp;Which is unlikely on a REGISTER.</div><div><br></div><div>Hopefully that's helpful. &nbsp;Good luck. &nbsp;I've found the best way to learn this is to make heavy use of xlog to look at what the inputs and outputs of the functions. &nbsp;That way, you know what's going in, you can determine what the function is doing (with help from the docs!), and you see what comes out of it.</div><div><br></div><div><br></div><div>- Jeff</div><div><br></div><div><br></div><div><div>On Aug 13, 2010, at 10:30 AM, David J. wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div text="#000000" bgcolor="#ffffff">
    Thanks, Pasan, Jeff,<br>
    <br>
    Jeff, when you query by uuid, can you show me a sample how to do it
    that way?<br>
    <br>
    <br>
    <br>
    On 8/13/10 9:15 AM, Jeff Pyle wrote:
    <blockquote cite="mid:A5ACA0B4-2501-4804-82E9-F4B462398BE3@fidelityvoice.com" type="cite">David,
      <div><br>
      </div>
      <div>As Pasan mentioned, it can be used for the query key for
        whatever value you're pulling. &nbsp;In my network, the uuid could be
        a trunk name if I'm storing trunk attributes, a trunk group
        number if I'm storing data about that group, or a phone number
        to hold call forwarding or other information about that phone
        number...</div>
      <div><br>
      </div>
      <div>There are several ways in the AVP environment to key values.
        &nbsp;I use uuid rather than username or username/domain.</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>- Jeff</div>
      <div><br>
        <div>
          <div>On Aug 13, 2010, at 8:08 AM, David J. wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <div text="#000000" bgcolor="#ffffff"> Thx...<br>
              <br>
              Any idea what the purpose of the field is?<br>
              <br>
              <br>
              <br>
              On 8/13/10 6:39 AM, Pasan Meemaduma wrote:
              <blockquote cite="mid:662878.11553.qm@web45202.mail.sp1.yahoo.com" type="cite">
                <style type="text/css"><!-- DIV {margin:0px;} --></style>
                <div style="font-family: times new roman,new
                  york,times,serif; font-size: 12pt;">
                  <div>Hi David,<br>
                    <br>
                    UUID field is not mandatory. you can just insert
                    other fields without UUID.<br>
                    <br>
                    It could use as a reference key if you want.<br>
                    <br>
+-------+------+------------+-----------+-----------+------+-------+---------------------+<br>
                    | id&nbsp;&nbsp;&nbsp; | uuid | username&nbsp;&nbsp; | domain&nbsp;&nbsp;&nbsp; | attribute
                    | type | value | last_modified&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
+-------+------+------------+-----------+-----------+------+-------+---------------------+<br>
                    | 14497 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | xxx | xxxx | timeout&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 0 |
                    50&nbsp;&nbsp;&nbsp; | 2000-03-02 16:21:59 | <br>
                    <br>
                  </div>
                  <div style="font-family: times new roman,new
                    york,times,serif; font-size: 12pt;"><br>
                    <div style="font-family: arial,helvetica,sans-serif;
                      font-size: 13px;"><font face="Tahoma" size="2">
                        <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
                        David J. <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:david@styleflare.com">&lt;david@styleflare.com&gt;</a><br>
                        <b><span style="font-weight: bold;">To:</span></b>
                        OpenSIPS users mailling list <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org">&lt;users@lists.opensips.org&gt;</a><br>
                        <b><span style="font-weight: bold;">Sent:</span></b>
                        Friday, August 13, 2010 15:57:28<br>
                        <b><span style="font-weight: bold;">Subject:</span></b>
                        [OpenSIPS-Users] UUID value in usr_preferences<br>
                      </font><br>
                      &nbsp; List,<br>
                      <br>
                      what value should I be using in the UUID field in
                      the usr_preferences table?<br>
                      <br>
                      I was trying to manually insert into the table,
                      and got stumbled by this <br>
                      field, the rest seem to make sense.<br>
                      <br>
                      Thx.<br>
                      <br>
                      <br>
                      <br>
                      _______________________________________________<br>
                      Users mailing list<br>
                      <a moz-do-not-send="true" ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                      <a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                    </div>
                  </div>
                </div>
                <br>
                <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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>
            </div>
            _______________________________________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <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><br>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
  </div>

_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote></div><br></div></body></html>