i'm trying to create an array (similar to sql_xquery result) using xavp, i tried the ff:
$xavp(arr[0]=>foo1) = 'bar1'; $xavp(arr[0]=>foo2) = 'bar2'; $xavp(arr[1]=>foo1) = 'bar3'; $xavp(arr[1]=>foo2) = 'bar4';
this does not work.
Kelvin Chua
Hello,
whenever you want to add one xavp, you must not provide the index. Try:
$xavp(arr=>foo1) = 'bar1'; $xavp(arr[0]=>foo2) = 'bar2'; $xavp(arr=>foo1) = 'bar3'; $xavp(arr[0]=>foo2) = 'bar4';
Note that is still adding as a stack, like for avp. But when you provide an index, it is expecting to exist and overwritte if all indexes are provided.
Cheers, Daniel
On 27/12/13 09:34, Kelvin Chua wrote:
i'm trying to create an array (similar to sql_xquery result) using xavp, i tried the ff:
$xavp(arr[0]=>foo1) = 'bar1'; $xavp(arr[0]=>foo2) = 'bar2'; $xavp(arr[1]=>foo1) = 'bar3'; $xavp(arr[1]=>foo2) = 'bar4';
this does not work.
Kelvin Chua
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
ok got it, a lil bit counter intuitive but works.
Kelvin Chua
On Fri, Dec 27, 2013 at 5:22 PM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
Hello,
whenever you want to add one xavp, you must not provide the index. Try:
$xavp(arr=>foo1) = 'bar1'; $xavp(arr[0]=>foo2) = 'bar2'; $xavp(arr=>foo1) = 'bar3'; $xavp(arr[0]=>foo2) = 'bar4';
Note that is still adding as a stack, like for avp. But when you provide an index, it is expecting to exist and overwritte if all indexes are provided.
Cheers, Daniel
On 27/12/13 09:34, Kelvin Chua wrote:
i'm trying to create an array (similar to sql_xquery result) using xavp, i tried the ff:
$xavp(arr[0]=>foo1) = 'bar1'; $xavp(arr[0]=>foo2) = 'bar2'; $xavp(arr[1]=>foo1) = 'bar3'; $xavp(arr[1]=>foo2) = 'bar4';
this does not work.
Kelvin Chua
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users