[prev in list] [next in list] [prev in thread] [next in thread]
List: openser-users
Subject: [SR-Users] Cannot read an indexed xavp from Kemi-Lua
From: Michel Pelletier <michel () voip ! ms>
Date: 2019-11-22 15:04:10
Message-ID: CADvnLS-qG6mrwpsJLwjB_V4Y4GoSDwBY4188tCs6YE6TV9f-Ow () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi,
I am having trouble reading an indexed xavp from Kemi-Lua. The xavp
contains 3 entries but I can only access the first one. The xavp is the
one filled by the dispatcher module after a call
to KSR.dispatcher.ds_select(group, 4) with the flags parameter set to 2. I
can get the number of entries using KSR.pvx.xavp_child_get("ds_ctx", "cnt")
which returns 3. I can also get the contents of the first element using,
for example, KSR.pvx.xavp_child_get("ds_dst", "attrs"). But all my
attempts at adding an index value using KSR.pvx.xavp_get()
or KSR.pvx.xavp_child_get() return the value 'nil';
Below is the output of KSR.pvx.pv_xavp_print():
+++++ start XAVP list: (nil) ((nil)) (level=0)
----- end XAVP list: (nil) (level=0)
+++++ start XAVP list: 0x7f94ce01f1f8 ((nil)) (level=0)
*** (l:0 - 0x7f94ce01f1f8) XAVP name: ds_ctx
XAVP id: 1762531321
XAVP value type: 6
XAVP value: <xavp:0x7f94ce01f150>
+++++ start XAVP list: 0x7f94ce01f150 (0x7f94ce01f218) (level=1)
*** (l:1 - 0x7f94ce01f150) XAVP name: cnt
XAVP id: 7279890
XAVP value type: 1
XAVP value (int): 3
*** (l:1 - 0x7f94ce01f150) end
----- end XAVP list: 0x7f94ce01f150 (level=1)
*** (l:0 - 0x7f94ce01f1f8) end
*** (l:0 - 0x7f94ce01eaf8) XAVP name: ds_dst
XAVP id: 1762531862
XAVP value type: 6
XAVP value: <xavp:0x7f94ce01ea30>
+++++ start XAVP list: 0x7f94ce01ea30 (0x7f94ce01eb18) (level=1)
*** (l:1 - 0x7f94ce01ea30) XAVP name: attrs
XAVP id: 1835799177
XAVP value type: 2
XAVP value (str): duid=newjersey3;maxload=200
*** (l:1 - 0x7f94ce01ea30) end
*** (l:1 - 0x7f94ce01e988) XAVP name: grp
XAVP id: 7056653
XAVP value type: 1
XAVP value (int): 1
*** (l:1 - 0x7f94ce01e988) end
*** (l:1 - 0x7f94ce01e8c8) XAVP name: uri
XAVP id: 8122237
XAVP value type: 2
XAVP value (str): sip:123.123.123.123:5060
*** (l:1 - 0x7f94ce01e8c8) end
----- end XAVP list: 0x7f94ce01ea30 (level=1)
*** (l:0 - 0x7f94ce01eaf8) end
*** (l:0 - 0x7f94ce01edd0) XAVP name: ds_dst
XAVP id: 1762531862
XAVP value type: 6
XAVP value: <xavp:0x7f94ce01ed08>
+++++ start XAVP list: 0x7f94ce01ed08 (0x7f94ce01edf0) (level=1)
*** (l:1 - 0x7f94ce01ed08) XAVP name: attrs
XAVP id: 1835799177
XAVP value type: 2
XAVP value (str): duid=newjersey2;maxload=200
*** (l:1 - 0x7f94ce01ed08) end
*** (l:1 - 0x7f94ce01ec60) XAVP name: grp
XAVP id: 7056653
XAVP value type: 1
XAVP value (int): 1
*** (l:1 - 0x7f94ce01ec60) end
*** (l:1 - 0x7f94ce01eba0) XAVP name: uri
XAVP id: 8122237
XAVP value type: 2
XAVP value (str): sip:123.123.123.123:5060
*** (l:1 - 0x7f94ce01eba0) end
----- end XAVP list: 0x7f94ce01ed08 (level=1)
*** (l:0 - 0x7f94ce01edd0) end
*** (l:0 - 0x7f94ce01f0a8) XAVP name: ds_dst
XAVP id: 1762531862
XAVP value type: 6
XAVP value: <xavp:0x7f94ce01efe0>
+++++ start XAVP list: 0x7f94ce01efe0 (0x7f94ce01f0c8) (level=1)
*** (l:1 - 0x7f94ce01efe0) XAVP name: attrs
XAVP id: 1835799177
XAVP value type: 2
XAVP value (str): duid=newjersey1;maxload=200
*** (l:1 - 0x7f94ce01efe0) end
*** (l:1 - 0x7f94ce01ef38) XAVP name: grp
XAVP id: 7056653
XAVP value type: 1
XAVP value (int): 1
*** (l:1 - 0x7f94ce01ef38) end
*** (l:1 - 0x7f94ce01ee78) XAVP name: uri
XAVP id: 8122237
XAVP value type: 2
XAVP value (str): sip:123.123.123.123:5060
*** (l:1 - 0x7f94ce01ee78) end
----- end XAVP list: 0x7f94ce01efe0 (level=1)
*** (l:0 - 0x7f94ce01f0a8) end
----- end XAVP list: 0x7f94ce01f1f8 (level=0)
Regards,
Michel Pelletier
[Attachment #5 (text/html)]
<div dir="ltr">Hi,<div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature"></div><div><br></div><div>I am having trouble \
reading an indexed xavp from Kemi-Lua. The xavp contains 3 entries but I can only \
access the first one. The xavp is the one filled by the dispatcher module after a \
call to KSR.dispatcher.ds_select(group, 4) with the flags parameter set to 2. I \
can get the number of entries using KSR.pvx.xavp_child_get("ds_ctx", \
"cnt") which returns 3. I can also get the contents of the first element \
using, for example, KSR.pvx.xavp_child_get("ds_dst", "attrs"). \
But all my attempts at adding an index value using KSR.pvx.xavp_get() or \
KSR.pvx.xavp_child_get() return the value \
'nil';<br></div><div><br></div><div>Below is the output of \
KSR.pvx.pv_xavp_print():<br></div><div><span \
style="color:rgb(0,0,0);font-family:"Droid Sans \
Mono",monospace,monospace,"Droid Sans \
Fallback";font-size:14px;white-space:pre"><br></span></div><div> +++++ start \
XAVP list: (nil) ((nil)) (level=0)<br> ----- end XAVP list: (nil) (level=0)<br> \
+++++ start XAVP list: 0x7f94ce01f1f8 ((nil)) (level=0)<br> *** (l:0 - \
0x7f94ce01f1f8) XAVP name: ds_ctx<br> XAVP id: 1762531321<br> XAVP \
value type: 6<br> XAVP value: <xavp:0x7f94ce01f150><br> +++++ start \
XAVP list: 0x7f94ce01f150 (0x7f94ce01f218) (level=1)<br> *** (l:1 - \
0x7f94ce01f150) XAVP name: cnt<br> XAVP id: 7279890<br> XAVP value \
type: 1<br> XAVP value (int): 3<br> *** (l:1 - 0x7f94ce01f150) \
end<br> ----- end XAVP list: 0x7f94ce01f150 (level=1)<br> *** (l:0 - \
0x7f94ce01f1f8) end<br> *** (l:0 - 0x7f94ce01eaf8) XAVP name: ds_dst<br> \
XAVP id: 1762531862<br> XAVP value type: 6<br> XAVP value: \
<xavp:0x7f94ce01ea30><br> +++++ start XAVP list: 0x7f94ce01ea30 \
(0x7f94ce01eb18) (level=1)<br> *** (l:1 - 0x7f94ce01ea30) XAVP name: \
attrs<br> XAVP id: 1835799177<br> XAVP value type: 2<br> XAVP \
value (str): duid=newjersey3;maxload=200<br> *** (l:1 - 0x7f94ce01ea30) \
end<br> *** (l:1 - 0x7f94ce01e988) XAVP name: grp<br> XAVP id: \
7056653<br> XAVP value type: 1<br> XAVP value (int): 1<br> \
*** (l:1 - 0x7f94ce01e988) end<br> *** (l:1 - 0x7f94ce01e8c8) XAVP name: \
uri<br> XAVP id: 8122237<br> XAVP value type: 2<br> XAVP \
value (str): sip:<a href="http://123.123.123.123:5060">123.123.123.123:5060</a><br> \
*** (l:1 - 0x7f94ce01e8c8) end<br> ----- end XAVP list: 0x7f94ce01ea30 (level=1)<br> \
*** (l:0 - 0x7f94ce01eaf8) end<br> *** (l:0 - 0x7f94ce01edd0) XAVP name: \
ds_dst<br> XAVP id: 1762531862<br> XAVP value type: 6<br> \
XAVP value: <xavp:0x7f94ce01ed08><br> +++++ start XAVP list: 0x7f94ce01ed08 \
(0x7f94ce01edf0) (level=1)<br> *** (l:1 - 0x7f94ce01ed08) XAVP name: \
attrs<br> XAVP id: 1835799177<br> XAVP value type: 2<br> XAVP \
value (str): duid=newjersey2;maxload=200<br> *** (l:1 - 0x7f94ce01ed08) \
end<br> *** (l:1 - 0x7f94ce01ec60) XAVP name: grp<br> XAVP id: \
7056653<br> XAVP value type: 1<br> XAVP value (int): 1<br> \
*** (l:1 - 0x7f94ce01ec60) end<br> *** (l:1 - 0x7f94ce01eba0) XAVP name: \
uri<br> XAVP id: 8122237<br> XAVP value type: 2<br> XAVP \
value (str): sip:<a href="http://123.123.123.123:5060">123.123.123.123:5060</a><br> \
*** (l:1 - 0x7f94ce01eba0) end<br> ----- end XAVP list: 0x7f94ce01ed08 (level=1)<br> \
*** (l:0 - 0x7f94ce01edd0) end<br> *** (l:0 - 0x7f94ce01f0a8) XAVP name: \
ds_dst<br> XAVP id: 1762531862<br> XAVP value type: 6<br> \
XAVP value: <xavp:0x7f94ce01efe0><br> +++++ start XAVP list: 0x7f94ce01efe0 \
(0x7f94ce01f0c8) (level=1)<br> *** (l:1 - 0x7f94ce01efe0) XAVP name: \
attrs<br> XAVP id: 1835799177<br> XAVP value type: 2<br> XAVP \
value (str): duid=newjersey1;maxload=200<br> *** (l:1 - 0x7f94ce01efe0) \
end<br> *** (l:1 - 0x7f94ce01ef38) XAVP name: grp<br> XAVP id: \
7056653<br> XAVP value type: 1<br> XAVP value (int): 1<br> \
*** (l:1 - 0x7f94ce01ef38) end<br> *** (l:1 - 0x7f94ce01ee78) XAVP name: \
uri<br> XAVP id: 8122237<br> XAVP value type: 2<br> XAVP \
value (str): sip:<a href="http://123.123.123.123:5060">123.123.123.123:5060</a><br> \
*** (l:1 - 0x7f94ce01ee78) end<br> ----- end XAVP list: 0x7f94ce01efe0 (level=1)<br> \
*** (l:0 - 0x7f94ce01f0a8) end<br> ----- end XAVP list: 0x7f94ce01f1f8 (level=0)<br> \
<br></div><div>Regards,</div><div><br></div><div>Michel \
Pelletier</div><div><br></div></div>
[Attachment #6 (text/plain)]
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic