<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.3">
</HEAD>
<BODY>
String function would be nice, but with Brett's suggested work around I got it working, might even be faster then if we had string functions?<BR>
<BR>
I think as more people want to make custom LCR implementations and various things these type of functions will come up more im sure. I think with the addition of db_http this will start coming up more, I know myself and few others were even thinking of using that for a LCR base. We ended up making a custom memcached program to do all our LCR and return data to OpenSIPS which in turn is a CSV.<BR>
<BR>
All of the ones Brett listed im sure would great features to add!<BR>
<BR>
-Brad<BR>
<BR>
On Mon, 2010-06-21 at 08:26 -0500, Brett Nemeroff wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Bogdan,</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Brad's AVP is a single AVP with CSV. He'd like to count the elements in the CSV.</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Some string array functions would be nice. :D</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">-Brett</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">On Mon, Jun 21, 2010 at 6:46 AM, Bogdan-Andrei Iancu <<A HREF="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</A>> wrote:</FONT><BR>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi Brad,</FONT><BR>
<BR>
<FONT COLOR="#000000">I guess you are looking for the set_count() function:</FONT><BR>
<BR>
<FONT COLOR="#000000"><A HREF="http://www.opensips.org/html/docs/modules/1.6.x/cfgutils.html#id228574">http://www.opensips.org/html/docs/modules/1.6.x/cfgutils.html#id228574</A></FONT>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<BR>
<FONT COLOR="#000000">Regards,</FONT><BR>
<FONT COLOR="#000000">Bogdan</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">--</FONT><BR>
<FONT COLOR="#000000">Bogdan-Andrei Iancu</FONT><BR>
<FONT COLOR="#000000">OpenSIPS Bootcamp</FONT><BR>
<FONT COLOR="#000000">20 - 24 September 2010, Frankfurt, Germany</FONT><BR>
<FONT COLOR="#000000"><A HREF="http://www.voice-system.ro">www.voice-system.ro</A></FONT><BR>
<BR>
<BR>
<BR>
<BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Brad Bendy wrote:</FONT><BR>
<FONT COLOR="#000000">> Brett,</FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">> I figured as much, but I thought I would try anyways.</FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">> I think adding the "count" to the front the string is going to be</FONT><BR>
<FONT COLOR="#000000">> easiest method and use the select functions, much more simpler!</FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">> Thanks for the advice.</FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">> On Sat, 2010-06-19 at 20:41 -0500, Brett Nemeroff wrote:</FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">>> Brad,</FONT><BR>
<FONT COLOR="#000000">>> param.count is for URI parameters and can't be used for any old</FONT><BR>
<FONT COLOR="#000000">>> format. If your string was in URI param format, I think it would then</FONT><BR>
<FONT COLOR="#000000">>> work:</FONT><BR>
<FONT COLOR="#000000">>> <A HREF="http://www.opensips.org/Resources/DocsCoreTran16#toc36">http://www.opensips.org/Resources/DocsCoreTran16#toc36</A></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> I haven't used this transformation, but it appears you'd take the</FONT><BR>
<FONT COLOR="#000000">>> params off a URI and then use the transformations on the params</FONT><BR>
<FONT COLOR="#000000">>> themselves.</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> I think what I do to find out if I'm at the end is to use the "select'</FONT><BR>
<FONT COLOR="#000000">>> transformation and check the value of the return.</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> Alternatively, you *could* make the first element in your list the</FONT><BR>
<FONT COLOR="#000000">>> number of values to expect. Not sure if that's even an option in your</FONT><BR>
<FONT COLOR="#000000">>> case..</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> -Brett</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> On Sat, Jun 19, 2010 at 8:34 PM, Brad Bendy</FONT><BR>
<FONT COLOR="#000000">>> <<A HREF="mailto:brad.bendy@benganetworks.com">brad.bendy@benganetworks.com</A>> wrote:</FONT><BR>
<FONT COLOR="#000000">>> Hi list,</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> Ive got a AVP that gets a value from a memcached store, it's a</FONT><BR>
<FONT COLOR="#000000">>> set of</FONT><BR>
<FONT COLOR="#000000">>> integers separated by commas , ex: 4,34,1,10</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> Is there a way to return the number of entries? In this case</FONT><BR>
<FONT COLOR="#000000">>> id like to</FONT><BR>
<FONT COLOR="#000000">>> have a 4 returned.</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> I cannot get {param.count} to work, but im not sure if it</FONT><BR>
<FONT COLOR="#000000">>> works like</FONT><BR>
<FONT COLOR="#000000">>> this or maybe im just not using is right.</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> Thanks for any help or suggestions</FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> _______________________________________________</FONT><BR>
<FONT COLOR="#000000">>> Users mailing list</FONT><BR>
<FONT COLOR="#000000">>> <A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT><BR>
<FONT COLOR="#000000">>> <A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">>> _______________________________________________</FONT><BR>
<FONT COLOR="#000000">>> Users mailing list</FONT><BR>
<FONT COLOR="#000000">>> <A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT><BR>
<FONT COLOR="#000000">>> <A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT><BR>
<FONT COLOR="#000000">>></FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">> _______________________________________________</FONT><BR>
<FONT COLOR="#000000">> Users mailing list</FONT><BR>
<FONT COLOR="#000000">> <A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT><BR>
<FONT COLOR="#000000">> <A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<FONT COLOR="#000000">></FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">_______________________________________________</FONT><BR>
<FONT COLOR="#000000">Users mailing list</FONT><BR>
<FONT COLOR="#000000"><A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT><BR>
<FONT COLOR="#000000"><A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT><BR>
<BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">Users mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT>
<FONT COLOR="#000000"><A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>