Changeset 3172 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- May 13, 2010 5:22:51 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r3153 r3172 1369 1369 return status; 1370 1370 } 1371 1372 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 1373 /* Check if SRTP is in optional mode and configured to use duplicated 1374 * media, i.e: secured and unsecured version, in the SDP offer. 1375 */ 1376 if (!rem_sdp && 1377 pjsua_var.acc[call->acc_id].cfg.use_srtp == PJMEDIA_SRTP_OPTIONAL && 1378 pjsua_var.acc[call->acc_id].cfg.srtp_optional_dup_offer) 1379 { 1380 unsigned i; 1381 1382 for (i = 0; i < sdp->media_count; ++i) { 1383 pjmedia_sdp_media *m = sdp->media[i]; 1384 1385 /* Check if this media is unsecured but has SDP "crypto" 1386 * attribute. 1387 */ 1388 if (pj_stricmp2(&m->desc.transport, "RTP/AVP") == 0 && 1389 pjmedia_sdp_media_find_attr2(m, "crypto", NULL) != NULL) 1390 { 1391 pjmedia_sdp_media *new_m; 1392 1393 /* Duplicate this media and apply secured transport */ 1394 new_m = pjmedia_sdp_media_clone(pool, m); 1395 pj_strdup2(pool, &new_m->desc.transport, "RTP/SAVP"); 1396 1397 /* Remove the "crypto" attribute in the unsecured media */ 1398 pjmedia_sdp_media_remove_all_attr(m, "crypto"); 1399 1400 /* Insert the new media before the unsecured media */ 1401 if (sdp->media_count < PJMEDIA_MAX_SDP_MEDIA) { 1402 pj_array_insert(sdp->media, sizeof(new_m), 1403 sdp->media_count, i, &new_m); 1404 ++sdp->media_count; 1405 ++i; 1406 } 1407 } 1408 } 1409 } 1410 #endif 1371 1411 1372 1412 /* Update currently advertised RTP source address */
Note: See TracChangeset
for help on using the changeset viewer.