Browse code

core: sdp payload may be in multipart body

Juha Heinanen authored on 07/05/2014 18:57:21
Showing 1 changed files
... ...
@@ -218,7 +218,14 @@ int AmOfferAnswer::onRxSdp(unsigned int m_cseq, const AmMimeBody& body, const ch
218 218
   int err_code = 0;
219 219
   assert(err_txt);
220 220
 
221
-  if(sdp_remote.parse((const char*)body.getPayload())){
221
+  const AmMimeBody *sdp = body.hasContentType("application/sdp");
222
+
223
+  if (sdp == NULL) {
224
+    err_code = 400;
225
+    *err_txt = "sdp body part not found";
226
+  }
227
+ 
228
+  if (sdp_remote.parse((const char*)sdp->getPayload())) {
222 229
     err_code = 400;
223 230
     *err_txt = "session description parsing failed";
224 231
   }