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

Function extract_body

modules/rtpengine/rtpengine_funcs.c:162–190  ·  view source on GitHub ↗

* Get message body and check Content-Type header field */

Source from the content-addressed store, hash-verified

160 * Get message body and check Content-Type header field
161 */
162int extract_body(struct sip_msg *msg, str *body )
163{
164 struct body_part * p;
165
166 if ( parse_sip_body(msg)<0 || msg->body==NULL )
167 {
168 LM_DBG("No body found\n");
169 return -1;
170 }
171
172 for ( p=&msg->body->first ; p ; p=p->next )
173 {
174 /* skip body parts which were deleted or newly added */
175 if (!is_body_part_received(p))
176 continue;
177
178 *body = p->body;
179 if( p->mime != ((TYPE_APPLICATION << 16) + SUBTYPE_SDP)
180 || body->len == 0)
181 continue;
182
183 /* found and return an SDP part */
184 return 1;
185 }
186
187 body->s = NULL;
188 body->len = 0;
189 return -1;
190}
191
192
193/*

Callers 3

rtpe_function_call_asyncFunction · 0.70

Calls 1

parse_sip_bodyFunction · 0.85

Tested by

no test coverage detected