<div dir="ltr">Hello,<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Regards,</div><div><br></div><div>Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 18 October 2013 21:54, Seudin Kasumovic <span dir="ltr"><<a href="mailto:seudin.kasumovic@gmail.com" target="_blank">seudin.kasumovic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Peter,<div><br></div><div>I tried transformation {pram.value,name['delimiter']} for 4.1.0-pre0:</div>
<div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><font face="courier new, monospace"><span style="color:rgb(80,0,80);font-size:13px">$(</span><b style="color:rgb(80,0,80);font-size:13px">avp</b><span style="color:rgb(80,0,80);font-size:13px">(my_var){param.value, a, ';'})</span></font><br>

</div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div>and got parsing error:</div><div><br></div><div><div>0(32237) ERROR: pv [pv_trans.c:2386]: tr_parse_paramlist(): invalid separator in transformation: value,a,';'}</div>

<div>0(32237) ERROR: <core> [pvapi.c:1586]: tr_lookup(): error parsing [{param.value,a,';'}]</div><div>0(32237) ERROR: <core> [pvapi.c:972]: pv_parse_spec2(): bad tr in pvar name "avp"</div>
<div>
0(32237) ERROR: <core> [pvapi.c:998]: pv_parse_spec2(): invalid parsing in [$(avp(my_var){param.value,a,';'})] at (4)</div></div><div><br></div><div>If set delimiter without quotes (documentation isn't clear for this), e.g.</div>

<div><br></div><div><div><font face="courier new, monospace"><span style="color:rgb(80,0,80);font-size:13px">$(</span><b style="color:rgb(80,0,80);font-size:13px">avp</b><span style="color:rgb(80,0,80);font-size:13px">(my_var){param.value, a, ;})</span></font><br>

</div></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font color="#500050" face="arial, sans-serif">then no parsing complain. </font><span style="color:rgb(80,0,80);font-family:arial,sans-serif">But, get same wrong results, for parameter value not quoted if contains ','.</span></div>

<div><br></div><div>Is this expected behavior?</div><div><br></div><div>Regards,</div><div>Seudin</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 18, 2013 at 10:41 AM, Seudin Kasumovic <span dir="ltr"><<a href="mailto:seudin.kasumovic@gmail.com" target="_blank">seudin.kasumovic@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>will try this feature...</div><div><br></div><div>thank you Peter.</div></div>

<div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 5:36 PM, Peter Dunkley <span dir="ltr"><<a href="mailto:peter.dunkley@crocodilertc.net" target="_blank">peter.dunkley@crocodilertc.net</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>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.</div>



<div><br></div><div>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.</div><div><br></div><div>Please see: <a href="http://www.kamailio.org/wiki/cookbooks/devel/transformations#paramvalue_name_delimiter" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/transformations#paramvalue_name_delimiter</a></div>



<div><br></div><div>Regards,</div><div><br></div><div>Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On 17 October 2013 16:04, Seudin Kasumovic <span dir="ltr"><<a href="mailto:seudin.kasumovic@gmail.com" target="_blank">seudin.kasumovic@gmail.com</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div><br></div><div>Transformation {param.value, param_name} returns incomplete or empty values when parameter value contains comma (,).</div>



<div><br></div><div>See next example:</div><div><br></div><div>
<b>$avp</b>(my_var)="a=val_a1,val_a2,val_a3;b=val_b";</div><div><div><br></div><div>in next transformations:</div><div><br></div><div>$(<b>avp</b>(my_var){param.value, a}) returns 'val_a1'</div><div>$(<b>avp</b>(my_var){param.value, b}) returns empty string</div>




<div><br></div><div>Seams that comma in parameter value conflicts with semi column separator.</div><div><br></div><div>Is this bug or wrong documented?</div><div><br></div><div>Related link:</div><div><a href="http://www.kamailio.org/wiki/cookbooks/4.0.x/transformations#paramvalue_name" target="_blank">http://www.kamailio.org/wiki/cookbooks/4.0.x/transformations#paramvalue_name</a></div>



<span><font color="#888888">
<div><br></div><div>-- <br></div>Seudin Kasumovic<br>Tuzla, Bosnia
</font></span></div></div>
<br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font face="courier new, monospace">Peter Dunkley</font></div><div><font face="courier new, monospace">Technical Director</font></div>


<div>
<font face="courier new, monospace">Crocodile RCS Ltd</font></div></div>
</font></span></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div>MSC Seudin Kasumovic<br>Tuzla, Bosnia
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>MSC Seudin Kasumovic<br>Tuzla, Bosnia
</div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font face="courier new, monospace">Peter Dunkley</font></div><div><font face="courier new, monospace">Technical Director</font></div><div>
<font face="courier new, monospace">Crocodile RCS Ltd</font></div></div>
</div>