<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Daniel,<br>
    yes, when I use db_mode 2 [1 not tested], after 'timer_interval'
    seconds (30s in my case),<br>
    data are passed to location_attrs table (through insert query for
    first registration and then delete/insert for refresh)<br>
    but just first and last attribute are passed (i.e. in db table I can
    find just first and last attribure for each <code class="varname">ruid).<br>
      <br>
      Regards<br>
      <br>
      Luca<br>
      <br>
    </code>
    <div class="moz-cite-prefix">Il 02/07/2015 18:12, Daniel-Constantin
      Mierla ha scritto:<br>
    </div>
    <blockquote cite="mid:559562D9.9090406@gmail.com" type="cite">
      <pre wrap="">Hello,

when you use db_mode 1 or 2, do you see the values in location_attrs
database table?

Cheers,
Daniel

On 02/07/15 12:45, Luca Mularoni wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi All,
I'm using kamailio 4.2.5 (compiled from source and aligned up to
commit [00a36ae07c587992d6486277ce2e9ae6c009685f]).
In order to enrich users data collected during registering phase, I
would like to store them in USRLOC Additional Attributes
through the use of 'xavp_contact' structure, but I'm having problems
storing them.
Below relevant chunks of config:

...
# ----- usrloc params -----
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "xavp_contact", "ulvals")
...

route[REGISTRAR] {
    ...
    # Just an example
    $xavp(ulvals=>A) = "A";
    $xavp(ulvals[0]=>B) = "B";
    $xavp(ulvals[0]=>C) = "C";
    $xavp(ulvals[0]=>D) = "D";
    ...
    if (!save("location"))
        sl_reply_error();
    exit;
}

route[LOCATION] {
    ...
    if(!lookup("location") {
        # Handle Failure
        ...
    }
    # Print USRLOC Additional Attributes
    # Just an Example
    $var(i) = 0;
    $var(N) = $branch(count);
    while($var(i)<=$var(N)) {
        xlog("LOC - [$var(i)] - A [$xavp(ulvals[$var(i)]=>A)]\n");
        xlog("LOC - [$var(i)] - B [$xavp(ulvals[$var(i)]=>B)]\n");
        xlog("LOC - [$var(i)] - C [$xavp(ulvals[$var(i)]=>C)]\n");
        xlog("LOC - [$var(i)] - D [$xavp(ulvals[$var(i)]=>D)]\n");
        $var(i) = $var(i) + 1;
    }
    ...
}

And this is the relevant chunk of syslog when a local subscriber is
found in 'location' table:
...
LOC - [0] - A [A]
LOC - [0] - B [<null>]
LOC - [0] - C [<null>]
LOC - [0] - D [D]
...

Summing up, it seems that when xavp structure is stored in memory,
just first and last elementsare inserted.
In real config I'm using more than 4 attributes and behaviour is the
same: just first and last are stored.
I've tried also with modparam("usrloc", "db_mode", 0) but the problem
remains.

Where I'm wrong in using this structure? Or it could be a bug?

Thank You in advance for your help

Luca Mularoni


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>