<h3>Description</h3>
<p>I am trying to extract a parameter with transformations from an URI in Kamailio 5.2.3, Centos 7</p>
<p>The problem occurs with uri.param and param.value transformation when the last character of the input string is the separator. I such case an error is thrown and no parameter value can be received. The code should be fixed so that empty parameters are simply skipped.</p>
<h1>Example</h1>
<p>$var(someuri) = "sip:2660926042@23.26.41.95:65485;app-id=7537263245341023;";</p>
<h1>error with uri.param</h1>
<p>$var(appid) = $(var(someuri){uri.param,app-id});</p>
<h1>another error with param.value</h1>
<p>$var(appid) = $(var(someuri){param.value,app-id});</p>
<p>error:<br>
"Param name missing after  ;"</p>
<p>The problem is here where an error is thrown for zero length params:<br>
<a href="https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_param.c">https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_param.c</a></p>
<pre><code>if(_s->len == 0) {
        LM_ERR("Param name missing after %c\n", separator);
        goto error;
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1991?email_source=notifications&email_token=ABO7UZO6UFR4UHJG2XUO7H3P4C3QJA5CNFSM4H26BGUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3I4L2Q">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMVXZFCGTZVUM3VNBLP4C3QJANCNFSM4H26BGUA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZNRCNRIFMSM3SDXCTTP4C3QJA5CNFSM4H26BGUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3I4L2Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1991?email_source=notifications\u0026email_token=ABO7UZO6UFR4UHJG2XUO7H3P4C3QJA5CNFSM4H26BGUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3I4L2Q",
"url": "https://github.com/kamailio/kamailio/issues/1991?email_source=notifications\u0026email_token=ABO7UZO6UFR4UHJG2XUO7H3P4C3QJA5CNFSM4H26BGUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3I4L2Q",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>