Hello,

There should be no '' around the delimiter.  That's why the documentation says "single character".  The '' in the documentation are there because the convention in the documentation is to surround literal examples in '' - you can see this throughout that wiki-page.

I neither expected comma to work as a delimiter nor expected it not to work.  However, I did think there was a chance it would.  I now suspect comma is one of the few delimiters that won't work and this is probably because the transformation parser doesn't handle them as it interprets them as the separator for transformation arguments.

As was pointed out these transformations were originally for parsing SIP header and URI parameters which are always delimited with semi-colon.  I extended them to take an optional delimiter so that they could be used to parse HTTP URI parameters which are delimited by ampersand.  I would never expect to have comma delimited parameters in SIP or HTTP, so I did not consider comma when I extended the transformation.

Regards,

Peter


On 18 October 2013 21:54, Seudin Kasumovic <seudin.kasumovic@gmail.com> wrote:
Hi Peter,

I tried transformation {pram.value,name['delimiter']} for 4.1.0-pre0:

$(avp(my_var){param.value, a, ';'})

and got parsing error:

0(32237) ERROR: pv [pv_trans.c:2386]: tr_parse_paramlist(): invalid separator in transformation: value,a,';'}
0(32237) ERROR: <core> [pvapi.c:1586]: tr_lookup(): error parsing [{param.value,a,';'}]
0(32237) ERROR: <core> [pvapi.c:972]: pv_parse_spec2(): bad tr in pvar name "avp"
0(32237) ERROR: <core> [pvapi.c:998]: pv_parse_spec2(): invalid parsing in [$(avp(my_var){param.value,a,';'})] at (4)

If set delimiter without quotes (documentation isn't clear for this), e.g.

$(avp(my_var){param.value, a, ;})

then no parsing complain. But, get same wrong results, for parameter value not quoted if contains ','.

Is this expected behavior?

Regards,
Seudin


On Fri, Oct 18, 2013 at 10:41 AM, Seudin Kasumovic <seudin.kasumovic@gmail.com> wrote:
Hello,

will try this feature...

thank you Peter.


On Thu, Oct 17, 2013 at 5:36 PM, Peter Dunkley <peter.dunkley@crocodilertc.net> wrote:
Hello,

Parameters to SIP headers are ';' separated.  ',' is used to concatenate multiple headers onto a single line.  The {param...} transformation is intended to process SIP header parameters.

However, there is a new feature in Kamailio 4.1 (currently in a pre-release/testing phase) that allows you to specify the delimiter value.  That may do what you require.


Regards,

Peter


On 17 October 2013 16:04, Seudin Kasumovic <seudin.kasumovic@gmail.com> wrote:
Hi,

Transformation {param.value, param_name} returns incomplete or empty values when parameter value contains comma (,).

See next example:

$avp(my_var)="a=val_a1,val_a2,val_a3;b=val_b";

in next transformations:

$(avp(my_var){param.value, a}) returns 'val_a1'
$(avp(my_var){param.value, b}) returns empty string

Seams that comma in parameter value conflicts with semi column separator.

Is this bug or wrong documented?

Related link:

-- 
Seudin Kasumovic
Tuzla, Bosnia

_______________________________________________
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




--
Peter Dunkley
Technical Director
Crocodile RCS Ltd

_______________________________________________
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




--
MSC Seudin Kasumovic
Tuzla, Bosnia



--
MSC Seudin Kasumovic
Tuzla, Bosnia

_______________________________________________
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




--
Peter Dunkley
Technical Director
Crocodile RCS Ltd