[OpenSIPS-Users] struct sip_msg

Ghaith ALKAYYEM ghaith.alkayyem at telecom-bretagne.eu
Wed Sep 2 13:27:31 CEST 2009


Hello list,

I was trying to play with the SIP header, So when i tried to access the
fields (to,from) in the sip_msg structure through a module c function
they were NULL and everything was included in the field headers.
I'd like to know whether there's something wrong or it's natural for
these fields to be NULL.

struct sip_msg {
	unsigned int id;               /* message id, unique/process*/
	struct msg_start first_line;   /* Message first line */
	struct via_body* via1;         /* The first via */
	struct via_body* via2;         /* The second via */
	struct hdr_field* headers;     /* All the parsed headers*/
	struct hdr_field* last_header; /* Pointer to the last parsed header*/
	hdr_flags_t parsed_flag;       /* Already parsed header field types */

	/* Via, To, CSeq, Call-Id, From, end of header*/
	/* pointers to the first occurrences of these headers;
	 * everything is also saved in 'headers' (see above)
	 */

	/* shorcuts to known headers */
	struct hdr_field* h_via1;
	struct hdr_field* h_via2;
	struct hdr_field* callid;
	struct hdr_field* to;
	struct hdr_field* cseq;
	struct hdr_field* from;
	...
	...




More information about the Users mailing list