Re: [SR-Users] comma as param.count delimiter produces parse error

2017-01-14 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> Not sure who added this transformation, but I will try to add support
> for comma as delimiter in the params.

Thanks if you have time for it.  In the meantime I'm converting , to
something else before applying the param transforms.

-- Juha

___
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


Re: [SR-Users] comma as param.count delimiter produces parse error

2017-01-13 Thread Daniel-Constantin Mierla
Looking at the code, there is an issue when setting the param delimiter
same as transformation format delimiter, both being the comma in this case.

This is supported in other transformations, like {s.select}, but has to
be special parsing in the code to avoid the misinterpretation of an
empty value for transformation arguments that can be in between two commas.

Not sure who added this transformation, but I will try to add support
for comma as delimiter in the params.

Hope it is going to work, because comma is also end of a header and the
SIP parser might stop there when parsing the parameters -- the {param}
transformation is using SIP headers parameter parser.

An workaround for now could be replacement of the comma with another
char via a subst and then using the count transformation.

Cheers,
Daniel


On 13/01/2017 06:57, Juha Heinanen wrote:
> Parameter list transformation param.count produces parse error when
> delimiter is comma (,) character.
>
> From document:
>
>   {param.value,name[, delimiter]}
>
>   'delimiter' allows you to specify a single character to use as the
>   parameter delimiter. For example, when parsing HTTP URL query strings
>   use '&'.
>
> When I have in config statement:
>
> $var(count) = $(var(servers){param.count,,});
>
> I get to syslog:
>
> Jan 13 07:48:15 lohi sip-proxy[18000]: 0(18050) ERROR: pv [pv_trans.c:2645]: 
> tr_parse_paramlist(): invalid separator in transformation: count,,}
> Jan 13 07:48:15 lohi sip-proxy[18000]: 0(18050) ERROR:  
> [core/pvapi.c:1629]: tr_lookup(): error parsing [{param.count,,}]
> Jan 13 07:48:15 lohi sip-proxy[18000]: 0(18050) ERROR:  
> [core/pvapi.c:1010]: pv_parse_spec2(): bad tr in pvar name "var"
> Jan 13 07:48:15 lohi sip-proxy[18000]: 0(18050) ERROR:  
> [core/pvapi.c:1036]: pv_parse_spec2(): invalid parsing in 
> [$(var(servers){param.count,,})] at (4)
> Jan 13 07:48:15 lohi sip-proxy[18000]: 0(18050) :  [core/cfg.y:3407]: 
> yyerror_at(): parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 
> 6426, column 19-48: Can't get from cache: $(var(servers){param.count,,})
> Jan 13 07:48:15 lohi sip-proxy[18000]: ERROR: bad config file (1 errors)
>
> -- Juha
>
> ___
> 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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
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