Re: [sr-dev] [kamailio/kamailio] uri.param and param.value error when last character is delimiter (#1991)

2019-07-01 Thread Daniel-Constantin Mierla
Closed #1991.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1991#event-2451613284___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] uri.param and param.value error when last character is delimiter (#1991)

2019-07-01 Thread Daniel-Constantin Mierla
I pushed a commit to relax the behaviour of the transformation not to be SIP 
spec strict in such cases -  1c4af823c39d28b694c1dec607d8d72c5b726456 , hoping 
to help by being more flexible with values loaded from various sources.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1991#issuecomment-507312165___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] uri.param and param.value error when last character is delimiter (#1991)

2019-06-25 Thread geejay101
Hello Daniel,

I receive such URIs from Asterisk 16.3 . This extra delimiter at the end seems 
to appear when Asterisk has stored contact URIs which are bigger than the db 
field. My fullcontact field length was 256 bytes in the Asterisk db, now I 
increased to 512 bytes and the problem went away.

Yes, I chop off the last delimiter in Kamailio now. That prevents the problem.

Thanks for your hints.

Best Gerrit



> On 25 Jun 2019, at 18:05, Daniel-Constantin Mierla  
> wrote:
> 
> From where did you get such URI? Because, afaik, by specs/RFC grammar, the 
> uri must not be terminated by ; -- the last param value must be left without 
> ;.
> 
> I haven't implemented the parser for uri+params, but that's what I understood 
> from the developer long time ago. I know that for some some modparams that 
> use the uri-params parser, I had to check if the last char is ; and skip it 
> when passing the value to the parser to avoid loosing the checks of the 
> parser to break specs requirements.
> 
> The solution right now is to check the last char in such value and skip it 
> using other string transformations such as s.substr.
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub 
> ,
>  or mute the thread 
> .
> 



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1991#issuecomment-505497720___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] uri.param and param.value error when last character is delimiter (#1991)

2019-06-25 Thread Daniel-Constantin Mierla
>From where did you get such URI? Because, afaik, by specs/RFC grammar, the uri 
>must not be terminated by `;` -- the last param value must be left without `;`.

I haven't implemented the parser for uri+params, but that's what I understood 
from the developer long time ago. I know that for some some modparams that use 
the uri-params parser, I had to check if the last char is `;` and skip it when 
passing the value to the parser to avoid loosing the checks of the parser to 
break specs requirements.

The solution right now is to check the last char in such value and skip it 
using other string transformations such as s.substr.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1991#issuecomment-505486781___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] uri.param and param.value error when last character is delimiter (#1991)

2019-06-24 Thread geejay101
### Description

I am trying to extract a parameter with transformations from an URI in Kamailio 
5.2.3, Centos 7

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.

# Example
$var(someuri) = "sip:2660926042@23.26.41.95:65485;app-id=7537263245341023;";

# error with uri.param
$var(appid) = $(var(someuri){uri.param,app-id});

# another error with param.value
$var(appid) = $(var(someuri){param.value,app-id});

error:
"Param name missing after  ;"

The problem is here where an error is thrown for zero length params:
https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_param.c

if(_s->len == 0) {
LM_ERR("Param name missing after %c\n", separator);
goto error;
}



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1991___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev