[Devel] get an unparsed header

Daniel-Constantin Mierla daniel at voice-system.ro
Sun Nov 20 14:25:09 CET 2005


Hello,

On 11/18/05 16:40, Klaus Darilion wrote:
> Hi!
>
> is there an easy way to get a certain header unparsed, e.g.
> get_header_unparsed(char * hdr, _hdr_types_t)
>
> should return a buffer to the unparsed header, e.g.
>
> "t:   klaus
>    <sip:klaus at klaus.com>"
>
> Can I reuse some functions for this or do I have to write my own 
> parser which parses sip_msg.buf ?
there is no such function. The function get_hdr_field() from 
parser/msg_parser.c automatically does the parsing of several headers, 
when they are recognized. Most of the headers are not parsed by default, 
some specific funtions have to be used.

Points to start is the function is_present_hf() from textops module. For 
common-known headers you can use the ID, for the others, the name. The 
header is stored in a 'struct hdr_field' and starts at hdr_field.name.s 
and ends at hdr_field.name.s+len.

Cheers,
Daniel

>
> regards
> klaus
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>



More information about the Devel mailing list