<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>this is because the chlidren value are not grouped inside the
same root xavp, but there are 3 root xavps, each with one child
value. Try:</p>
<p>$xavp(ulattrs=>PubNetIP) = $si;<br>
$xavp(ulattrs[0]=>PubNetPort) = $sp;<br>
$xavp(ulattrs[0]=>Transport) = $proto;<br>
<br>
Feel free to enhance the docs in the wiki, if you consider them
not very clear on what the operations with avps do:</p>
<p> * <a
href="https://www.kamailio.org/wiki/cookbooks/5.3.x/pseudovariables#xavp_id_-_xavps">https://www.kamailio.org/wiki/cookbooks/5.3.x/pseudovariables#xavp_id_-_xavps</a></p>
<p>In short, if no index is provided, the xavps are added, both root
and child.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 02.04.20 05:21, Sergiu Pojoga wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJZsGCmZkBRCf8Y2W7PpWRY5aiQdg144KBYu8-4NW5FUKfcbXA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi there,<br>
<div><br>
</div>
<div>I'm observing a similar behavior as reported a while ago in
this case: <a
href="https://github.com/kamailio/kamailio/issues/243"
moz-do-not-send="true">https://github.com/kamailio/kamailio/issues/243</a></div>
<div><br>
</div>
<div>It appears that only the <b>last </b>attribute before
save() is stored in DB and later restored on lookup()</div>
<div><br>
</div>
<div>kamcmd version<br>
kamailio 5.2.5 (x86_64/linux) e10d4f<br>
</div>
<div><br>
</div>
<div>Script:</div>
<div>$xavp(ulattrs=>PubNetIP) = $si;<br>
$xavp(ulattrs=>PubNetPort) = $sp;<br>
$xavp(ulattrs=>Transport) = $proto;<br>
<br>
</div>
<div>pv_xavp_print();<br>
<br>
</div>
<div>save("location", "");<br>
</div>
<div><br>
</div>
<div>Mysql log:</div>
<div>insert into `location_attrs`
(`username`,`ruid`,`last_modified`,`aname`,`atype`,`avalue`,`domain`
) values ('firstuser','uloc-5e855601-2529-1','2020-04-01
23:03:48','Transport',0,'udp','<a
href="http://sip.mydomain.net" moz-do-not-send="true">sip.mydomain.net</a>')<br>
</div>
<div><br>
</div>
<div>MariaDB [(none)]> select * from kamailio.location_attrs;<br>
*************************** 1. row ***************************<br>
id: 26<br>
ruid: uloc-5e855601-2529-1<br>
username: firstuser<br>
domain: <a href="http://sip.mydomain.net"
moz-do-not-send="true">sip.mydomain.net</a><br>
aname: Transport<br>
atype: 0<br>
avalue: udp<br>
last_modified: 2020-04-01 23:12:48<br>
</div>
<div><br>
</div>
<div>Kamailio xavp pring in logs:</div>
<div>
<table style="border-collapse:collapse;width:48pt" width="64"
cellspacing="0" cellpadding="0" border="0">
<colgroup><col style="width:48pt" width="64"> </colgroup><tbody>
<tr style="height:15pt" height="20">
<td
style="height:15pt;width:48pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
width="64" height="20">+++++ start XAVP list:
0x7f28ff1e9590 ((nil)) (level=0)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e9590) XAVP name:
ulattrs</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 2085639187</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 6</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value: <xavp:0x7f28ff1e94e0></td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">+++++ start XAVP list: 0x7f28ff1e94e0
(0x7f28ff1e95b0) (level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e94e0) XAVP name:
Transport</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 3694982711</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 2</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value (str): udp</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e94e0) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">----- end XAVP list: 0x7f28ff1e94e0
(level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e9590) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e9438) XAVP name:
ulattrs</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 2085639187</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 6</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value: <xavp:0x7f28ff1e9388></td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">+++++ start XAVP list: 0x7f28ff1e9388
(0x7f28ff1e9458) (level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e9388) XAVP name:
PubNetPort</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 3296056264</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 1</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value (int): 58535</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e9388) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">----- end XAVP list: 0x7f28ff1e9388
(level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e9438) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e92e0) XAVP name:
ulattrs</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 2085639187</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 6</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value: <xavp:0x7f28ff1e9228></td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">+++++ start XAVP list: 0x7f28ff1e9228
(0x7f28ff1e9300) (level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e9228) XAVP name:
PubNetIP</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP id: 3296017806</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value type: 2</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">XAVP value (str): 173.246.28.83</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:1 - 0x7f28ff1e9228) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">----- end XAVP list: 0x7f28ff1e9228
(level=1)</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">*** (l:0 - 0x7f28ff1e92e0) end</td>
</tr>
<tr style="height:15pt" height="20">
<td
style="height:15pt;padding-top:1px;padding-right:1px;padding-left:1px;color:black;font-size:11pt;font-family:Calibri,sans-serif;vertical-align:bottom;border:none;white-space:nowrap"
height="20">----- end XAVP list: 0x7f28ff1e9590
(level=0)</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
</body>
</html>