Greetings all;<br><br>I have a feeling I&#39;m &quot;almost there, but not quite&quot; with this one, I was wondering if someone can point out the missing piece of my puzzle here.<br><br>I&#39;m attempting to index an AVP with another AVP, which works just fine in OpenSIPS, but I&#39;m attempting to seed the initial AVP array from an exec&#39;d perl routine. Problem is, I&#39;m not sure if the perl AVP routines can actually address indexed AVPs...<br>
<br>My perl looks (vaguely) like this:<br><br>my $idx = 0;<br>while(my $Data = &amp;Get_Data) {<br>   OpenSIPS::AVP::add(&quot;MAGIC[$idx]&quot;, &quot;$Data&quot;);<br>   $idx++;<br>}<br><br>Which I discovered I can access like this:<br>
xlog(&quot;L_INFO&quot;, &quot;Displaying index 0: $avp(s:MAGIC[0])\n&quot;);<br><br>Note the position the [0] index - according to all the documentation it _should_ look like this: $(avp(s:MAGIC)[0]). This leads me to believe that the AVP name is being set, literally, to &quot;MAGIC[0]&quot; rather than a &quot;MAGIC&quot; array, per se.<br>
<br>I&#39;m then trying to access the AVP later with an index inside another AVP, like so:<br>$avp(s:IDX) = 0;<br>xlog(&quot;L_INFO&quot;, &quot;A index 0: $avp(s:MAGIC[$avp(s:IDX)])\n&quot;);<br>
xlog(&quot;L_INFO&quot;, &quot;B index 0: $(avp(s:MAGIC)[$avp(s:IDX)])\n&quot;);<br>

<br>Both of which return a &lt;null&gt;. The former because I don&#39;t think you can insert a string into an AVP name in the manner I&#39;m (accidentally) doing, and the latter because MAGIC it isn&#39;t an array like it should be.<br>
<br>What&#39;s the appropriate way of doing this? Can I mangle the AVP name and simply have a list of several named AVPs rather than using the array feature - or is there a way of access the indices from the OpenSIPS::AVP::add()?<br>
<br>Thanks!<br><br> - Jock<br>