Bogdan,<div>Brad's AVP is a single AVP with CSV. He'd like to count the elements in the CSV.</div><div><br></div><div>Some string array functions would be nice. :D</div><div>-Brett</div><div><br></div><div><br><div class="gmail_quote">
On Mon, Jun 21, 2010 at 6:46 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Brad,<br>
<br>
I guess you are looking for the set_count() function:<br>
<br>
<a href="http://www.opensips.org/html/docs/modules/1.6.x/cfgutils.html#id228574" target="_blank">http://www.opensips.org/html/docs/modules/1.6.x/cfgutils.html#id228574</a><br>
<div class="im"><br>
Regards,<br>
Bogdan<br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Bootcamp<br>
20 - 24 September 2010, Frankfurt, Germany<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">Brad Bendy wrote:<br>
> Brett,<br>
><br>
> I figured as much, but I thought I would try anyways.<br>
><br>
> I think adding the "count" to the front the string is going to be<br>
> easiest method and use the select functions, much more simpler!<br>
><br>
> Thanks for the advice.<br>
><br>
> On Sat, 2010-06-19 at 20:41 -0500, Brett Nemeroff wrote:<br>
><br>
>> Brad,<br>
>> param.count is for URI parameters and can't be used for any old<br>
>> format. If your string was in URI param format, I think it would then<br>
>> work:<br>
>> <a href="http://www.opensips.org/Resources/DocsCoreTran16#toc36" target="_blank">http://www.opensips.org/Resources/DocsCoreTran16#toc36</a><br>
>><br>
>><br>
>> I haven't used this transformation, but it appears you'd take the<br>
>> params off a URI and then use the transformations on the params<br>
>> themselves.<br>
>><br>
>><br>
>> I think what I do to find out if I'm at the end is to use the "select'<br>
>> transformation and check the value of the return.<br>
>><br>
>><br>
>> Alternatively, you *could* make the first element in your list the<br>
>> number of values to expect. Not sure if that's even an option in your<br>
>> case..<br>
>><br>
>><br>
>> -Brett<br>
>><br>
>><br>
>><br>
>><br>
>> On Sat, Jun 19, 2010 at 8:34 PM, Brad Bendy<br>
>> <<a href="mailto:brad.bendy@benganetworks.com">brad.bendy@benganetworks.com</a>> wrote:<br>
>> Hi list,<br>
>><br>
>> Ive got a AVP that gets a value from a memcached store, it's a<br>
>> set of<br>
>> integers separated by commas , ex: 4,34,1,10<br>
>><br>
>> Is there a way to return the number of entries? In this case<br>
>> id like to<br>
>> have a 4 returned.<br>
>><br>
>> I cannot get {param.count} to work, but im not sure if it<br>
>> works like<br>
>> this or maybe im just not using is right.<br>
>><br>
>> Thanks for any help or suggestions<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>