[Devel] openser -- problems with multiple headers of the same type?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Feb 15 17:22:43 CET 2006


Hi Daniel,

I haven't double check the RFC to see if multiple hdrs are allowed for 
ALLOW or SUPPORTED hdr.
But if it so, the solution will be to extend the structure that stores 
the parsed body to allow the chaining of this hdr (in the same way as 
for Contact hdr): the msg->allow points to the first hdr; the parsed 
structure contains also a pointer to the next ALLOW hdr and so on.

the parsed structure will also contain the combined masks from all the 
ALLOW hdrs - to avoid getting through the list each time you need the 
allow mask.

regards,
bogdan

Daniel Hsueh wrote:

> Hello,
>
> I've noticed this problem while coding a module, and I'm wondering if 
> it's a known problem or not:
>
> Some parts of openser code assume that there will only be one instance 
> of a certain header whereas the values can be actually spread across 
> multiple headers on multiple lines.
>
> For example, the "Allow:" header is usually seen with all the method 
> names on one line:
>   Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, SUBSCRIBE
>
> but the following is legal as well:
>   Allow: ACK, BYE
>   Allow: CANCEL, INFO, INVITE
>   [junk in between]
>   Allow: NOTIFY, OPTIONS, SUBSCRIBE
>
> Other headers that can be split up like this include Supported, 
> Proxy-Require.
>
> It isn't difficult to parse_headers(HDR_EOH_F) and then run through 
> the (struct sip_msg *)p->headers linked list to find all instances of 
> the header you want, but there already exists code that assumes that 
> there will be only one instance (e.g., parse_allow, get_allow_methods, 
> any of the named struct hdr_field members of struct sip_msg).
>
> Yes?
>




More information about the Devel mailing list