[OpenSIPS-Users] explode function

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Jun 6 12:38:45 EDT 2017


Hi Schneur,

There is no "explode" like in php - I guess you need to stick to 
s.select for the moment (some major changes on handling arrays from 
script are planned for the future releases). To have a clean script, 
simply make a route[] dedicated to unpack a comma separated list into a 
multi-value AVP ;)

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Bootcamp 2017, Houston, US
   http://opensips.org/training/OpenSIPS_Bootcamp_2017.html

On 06/02/2017 12:55 PM, Schneur Rosenberg wrote:
> Hi, I'm trying to store a list of gateways in memcache, due to NoSQL
> nature I can't store a avp with multiple values, so I used the avp
> with the [*] which gave me a comma delimited list which I can store,
> now I want to create a array of all the values similar to explode() in
> php.
>
> The closest thing I can think of is to use {s.select,index,separator}
> but that would be very messy, as I would need to use a while loop with
> {s.index} until it returns -1 and use the {s.select,index,separator}
> to populate the array, I was hoping that there is a easier way, does a
> easier way exist?
>
> thank you
> S. Rosenberg
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list