MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / extract_parsed_hdrs

Function extract_parsed_hdrs

modules/tm/t_msgbuilder.c:70–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70static inline struct hdr_field* extract_parsed_hdrs( char *buf, int len)
71{
72 char *p;
73 static struct sip_msg msg;
74 struct hdr_field *hdr;
75
76 /* skip the first line - not interesting */
77 p = eat_line( buf, len);
78 if (p>=buf+len)
79 return 0;
80
81 memset( &msg, 0, sizeof(struct sip_msg) );
82 msg.buf = buf;
83 msg.len = len;
84 msg.unparsed = p;
85
86 /* as we need all Route headers, we need to parse all headers */
87 if (parse_headers( &msg, HDR_EOH_F, 0)==-1)
88 goto error;
89
90 hdr = msg.headers;
91 msg.headers = 0;
92
93 free_sip_msg( &msg );
94 return hdr;
95error:
96 free_sip_msg( &msg );
97 return 0;
98}
99
100
101/* Build a local request based on a previous request; the only

Callers 1

build_localFunction · 0.85

Calls 2

eat_lineFunction · 0.85
free_sip_msgFunction · 0.85

Tested by

no test coverage detected