[SR-Users] Cannot read an indexed xavp from Kemi-Lua

Michel Pelletier michel at voip.ms
Fri Nov 22 16:04:10 CET 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191122/5d273b64/attachment.html>


More information about the sr-users mailing list