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

Re: [reSIProcate-users] question about ExtensionHeader and ExtensionParameter




OK - In that case, I'd like to put in a plea for an enhancement. Ideally, I'd like user-defined proprietary headers and parameters to work together as well as the predefined ones do. That is, I'd like to be able to do

ExtensionHeader fooHdr("P-Foo");
ExtensionParameter batParam("bat");

sipMsg->header(FooHdr).front().exists(batParam), sipMsg->header(FooHdr).front().param(batParam).front(), etc. I think this only makes sense.

Barring that, it seems to me that at the very least, the above stuff should not compile. It is misleading that sipMsg->header(FooHdr).front().exists(batParam) compiles just fine, but is useless, and always returns FALSE no matter what the content of the proprietary header in the SIP message. This fooled me for a while, and I had to dig and hack some test cases to figure out what was really going on.

Thanks,

-John Gregg



On 05/23/2014 11:57 AM, Scott Godin wrote:
That is correct.  :)

You can use the ParseBuffer class to do customized parsing.

Scott


On Fri, May 23, 2014 at 11:38 AM, John Gregg <jgregg@xxxxxxxxx> wrote:
Am I correct in thinking that if I have a proprietary header that I define with ExtensionHeader, I can't use ExtensionParameter to grab its parameters? It looks like if I have a SIP message containing:

P-Foo: someData;faz=3;bat=987;bar=cheddar

And in my code I have

ExtensionHeader fooHdr("P-Foo");
ExtensionParameter batParam("bat");

then

sipMsg->header(FooHdr).front().exists(batParam)

always returns FALSE. It looks like sipMsg->header(FooHdr).front().value().c_str() is just the raw string "someData;faz=3;bat=987;bar=cheddar", and then I have to pull out my proprietary parameters by hand using good old C/C++ string manipulation primitives. The ExtensionParameter, then, is only useful for proprietary parameters on headers that are already known to resiprocate, like

Call-ID: 1-3730@10.0.23.14;bat=987

Or am I missing something? It sure would be nice to be able to use proprietary headers and parameters with the same ease as the predefined ones.

Thanks,

-John Gregg

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/