< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] [resiprocate] New headers and parameters from RFC 3455 and UUI drafts (#6)


Hi Scott,

I will try to create the new class next week.

I think that I could take the same approach used for QuotedDataParameter, deriving class from Token and adding a data member mQuoted that is set while parsing and it is used to encode stream. 

Do you think that it could also be necessary / useful having a class to handle tokens without a value like P-Charging-Vector?

Maybe I could try to write also a class like TokenWithoutValue or ParametersToken (any suggestions for the name would be appreciated): value might contain the complete string with all the parameters, but in first position we expect a parameter (param=value;...), so when we stream the object we don't put ';' at the start of the string.

Best regards,

Dario

 


Da: slgodin@xxxxxxxxx [slgodin@xxxxxxxxx] per conto di Scott Godin [sgodin@xxxxxxxxxxxxxxx]
Inviato: venerdì 3 ottobre 2014 17.50
A: Dario Bozzali
Cc: resiprocate-devel@xxxxxxxxxxxxxxx
Oggetto: Re: [reSIProcate] [resiprocate] New headers and parameters from RFC 3455 and UUI drafts (#6)

Sorry for my mistake in the last email - QuotedDataParameter is for parameters not headers.   You could use the StringCategory type, but then you won't get any special stack handling of header parameters.  

I think the proper solution is to create a custom header parser class (like WarningCategory) that will handle a token or quoted string and the parameters that go with it (named something like: TokenOrQuotedStringCategory).

Scott


On Fri, Oct 3, 2014 at 6:28 AM, Dario Bozzali <Dario.Bozzali@xxxxxxxxxxx> wrote:

Hello Scott,

In draft-ietf-cuss-sip-uui-17 draft (section 4.1) the value of User-to-User header is defined as a token or a quoted string.

 

UUI         = "User-to-User" HCOLON uui-value *(COMMA uui-value)

uui-value   = uui-data *(SEMI uui-param)

uui-data    = token / quoted-string

uui-param   = pkg-param / cont-param / enc-param / generic-param

pkg-param   = "purpose" EQUAL pkg-param-value

pkg-param-value = token

cont-param  = "content" EQUAL cont-param-value

cont-param-value = token

enc-param   = "encoding" EQUAL enc-param-value

enc-param-value = token / "hex"

 

Maybe Token is a proper type for UUI value, but like in the case of P-Charging-Vector header we must handle “special cases”. Something similar to the following code:

 

Data uuiData(Data::from(msg.header(h_UserToUser).c_str()));

ParseBuffer uuiBuffer(uuiData);

if (!uuiBuffer.eof()) {

    try {

        // extract the UUI value

        const char* uuiStart = uuiBuffer.skipWhitespace();

        const char* uuiEnd = NULL;

        if (*uuiBuffer.position() == Symbols::DOUBLE_QUOTE[0]) {

            uuiBuffer.skipChar();

           uuiStart = uuiBuffer.position();

            uuiEnd = uuiBuffer.skipToEndQuote();

       }

        else {

            uuiEnd = uuiBuffer.skipToChar(';');

        }

        if ((int)(uuiEnd - uuiStart) >= 0) {

            Data uuiDataValue;

            uuiBuffer.data(uuiDataValue, uuiStart);

            // use uuiDataValue

        }

    }

    catch (resip::BaseException& ex) {

        // handle parsing error, if any

    }

}

 

What is your opinion? Can we continue to use Token type?

 

Best regards,

Dario.

 

From: slgodin@xxxxxxxxx [mailto:slgodin@xxxxxxxxx] On Behalf Of Scott Godin
Sent: giovedì 2 ottobre 2014 21.44
To: Dario Bozzali
Cc: resiprocate-devel@xxxxxxxxxxxxxxx

Subject: Re: [reSIProcate] [resiprocate] New headers and parameters from RFC 3455 and UUI drafts (#6)

 

>Scenario 1 related to User-to-User header.
>How to parse the following header?
>User-to-User: "the quick silver fox jumped over the lazy brown dog";encoding=hex
>When I try to get the value of the header I obtain the string ""the" because Token::parse() method skip till first whitespace or semicolon.

 

Perhaps the header type you used is wrong then.  If the Data is always quoted you should use QuotedDataParameter instead of Token.

 

Scott

 

On Thu, Oct 2, 2014 at 9:43 AM, Dario Bozzali <Dario.Bozzali@xxxxxxxxxxx> wrote:

Hi all,
I'm executing some additional tests on new headers. I have a couple of doubts, but I don't know if there is a bug in the pull request or in my test scenarios.

Scenario 1 related to User-to-User header.
How to parse the following header?
User-to-User: "the quick silver fox jumped over the lazy brown dog";encoding=hex
When I try to get the value of the header I obtain the string ""the" because Token::parse() method skip till first whitespace or semicolon.

Scenario 2 related to P-Charging-Vector header.
P-Charging-Value has icid-value mandatory parameter and other optional parameters. I understood that it should be modelled as a Token with empty value, but in this way one ";" is inserted before icid-value.
Example:
        P-Charging-Vector: ;icid-value=B6012049-0080-42D3-982E-473B24816316;icid-generated-at=192.168.56.1;orig-ioi=myserver

What is the right way to set header value?
Should I use a icid-value parameter to set P-Charging-Vector value?

Something like this:

        Token chargingVectorToken;
        DataParameter icidValueParam(ParameterTypes::icidValue);
        icidValueParam.value() = Data("B6012049-0080-42D3-982E-473B24816316");
        Data icidData;
        DataStream icidDataStream(icidData);
        icidValueParam.encode(icidDataStream);
        chargingVectorToken.value() = icidData;
        chargingVectorToken.param(p_icidGeneratedAt) = Data("192.168.56.1");
        chargingVectorToken.param(p_origIoi) = Data("myserver");

Maybe John Gregg could help me on this.

Thank you in advance and kind regards.

Dario


-----Original Message-----
From: resiprocate-devel [mailto:
resiprocate-devel-bounces@xxxxxxxxxxxxxxx] On Behalf Of Dario Bozzali
Sent: martedì 23 settembre 2014 18.34
To: 'Daniel Pocock'
Cc:
resiprocate-devel@xxxxxxxxxxxxxxx
Subject: Re: [reSIProcate] [resiprocate] New headers and parameters from RFC 3455 and UUI drafts (#6)

Hi Daniel,
Excluding DayOfWeekHash and MonthHash from build I was able to compile without changing DateCategory.cxx.
DayOfWeekHash and MonthHash are built because tool configured in project is "C/C++ Compiler Tool" instead of "Custom Build Tool" as per other header files.

Regards,
Dario.

-----Original Message-----
From: Daniel Pocock [mailto:
daniel@xxxxxxxxxx]
Sent: martedì 23 settembre 2014 18.24
To: Dario Bozzali
Cc:
resiprocate-devel@xxxxxxxxxxxxxxx
Subject: Re: [resiprocate] New headers and parameters from RFC 3455 and UUI drafts (#6)


Hi Dario,

I notice that MethodHash is including string.h and ctype.h so I've added those same includes to DateCategory.cxx so they will be included before DayOfWeekHash and MonthHash

Can you just confirm, Visual Studio is not trying to compile these cxx files into separate objects?  It should only be including them when it compiles DateCategory.cxx so they should all become part of the object file DateCategory.o

Regards,

Daniel

On 23/09/14 18:08, Dario Bozzali wrote:
> Hi Daniel,
> Below I reported the output obtained using Visual Studio 2005 to build master.
> Dario.
>
> 1>DayOfWeekHash.cxx
> 1>dayofweek.gperf(5) : error C2146: syntax error : missing ';' before identifier 'type'
> 1>dayofweek.gperf(5) : error C4430: missing type specifier - int
> 1>assumed. Note: C++ does not support default-int
> 1>dayofweek.gperf(5) : error C4430: missing type specifier - int
> 1>assumed. Note: C++ does not support default-int
> 1>dayofweek.gperf(13) : error C2065: 'Sat' : undeclared identifier
> 1>dayofweek.gperf(13) : error C2078: too many initializers
> 1>dayofweek.gperf(8) : error C2065: 'Mon' : undeclared identifier
> 1>dayofweek.gperf(7) : error C2065: 'Sun' : undeclared identifier
> 1>dayofweek.gperf(10) : error C2065: 'Wed' : undeclared identifier
> 1>dayofweek.gperf(11) : error C2065: 'Thu' : undeclared identifier
> 1>dayofweek.gperf(12) : error C2065: 'Fri' : undeclared identifier
> 1>dayofweek.gperf(9) : error C2065: 'Tue' : undeclared identifier
> 1>dayofweek.gperf(20) : error C3861: 'strncmp': identifier not found
> 1>MonthHash.cxx
> 1>month.gperf(5) : error C2146: syntax error : missing ';' before identifier 'type'
> 1>month.gperf(5) : error C4430: missing type specifier - int assumed.
> 1>Note: C++ does not support default-int
> 1>month.gperf(5) : error C4430: missing type specifier - int assumed.
> 1>Note: C++ does not support default-int
> 1>month.gperf(12) : error C2065: 'Jun' : undeclared identifier
> 1>month.gperf(12) : error C2078: too many initializers
> 1>month.gperf(13) : error C2065: 'Jul' : undeclared identifier
> 1>month.gperf(7) : error C2065: 'Jan' : undeclared identifier
> 1>month.gperf(11) : error C2065: 'May' : undeclared identifier
> 1>month.gperf(8) : error C2065: 'Feb' : undeclared identifier
> 1>month.gperf(9) : error C2065: 'Mar' : undeclared identifier
> 1>month.gperf(10) : error C2065: 'Apr' : undeclared identifier
> 1>month.gperf(18) : error C2065: 'Dec' : undeclared identifier
> 1>month.gperf(14) : error C2065: 'Aug' : undeclared identifier
> 1>month.gperf(15) : error C2065: 'Sep' : undeclared identifier
> 1>month.gperf(16) : error C2065: 'Oct' : undeclared identifier
> 1>month.gperf(17) : error C2065: 'Nov' : undeclared identifier
> 1>month.gperf(28) : error C3861: 'strncmp': identifier not found
>
> -----Original Message-----
> From: Daniel Pocock [mailto:
daniel@xxxxxxxxxx]
> Sent: martedì 23 settembre 2014 17.48
> To: Dario Bozzali
> Cc:
resiprocate-devel@xxxxxxxxxxxxxxx
> Subject: Re: [resiprocate] New headers and parameters from RFC 3455
> and UUI drafts (#6)
>
>
>
> On 23/09/14 17:42, Dario Bozzali wrote:
>> Hi Daniel,
>> I solved the compiling issue changing Visual Studio project settings to exclude DayOfWeekHash.cxx and MonthHash.cxx from build. I commit this change for every VS version.
>> Now I will take a look at conflict issue.
>
>
> That sounds odd.  If you checkout the master branch, without any of your changes, does it build with those files included?
>
> If it doesn't build on master, can you tell me what error it gives?
>

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel