Changeset 3376


Ignore:
Timestamp:
Dec 1, 2010 8:20:28 AM (13 years ago)
Author:
nanang
Message:

Fix #1165:

  • Fixed pjsua_media_channel_create_sdp() to re-calculate audio index of the remote offer, instead of using existing audio index calculated by pjsua_media_channel_init(), as for subsequent SDP offer/answer, pjsua_media_channel_init() may not be called.
  • Fixed SRTP transport to be able to switch SRTP status from active to inactive/by-passed and vice versa.
Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r3348 r3376  
    646646 
    647647    p_srtp->session_inited = PJ_FALSE; 
     648    pj_bzero(&p_srtp->rx_policy, sizeof(p_srtp->rx_policy)); 
     649    pj_bzero(&p_srtp->tx_policy, sizeof(p_srtp->tx_policy)); 
    648650 
    649651    pj_lock_release(p_srtp->mutex); 
     
    12221224     
    12231225    srtp->offerer_side = sdp_remote == NULL; 
     1226    srtp->bypass_srtp = PJ_FALSE; 
    12241227 
    12251228    m_rem = sdp_remote ? sdp_remote->media[media_index] : NULL; 
     
    15771580    srtp->bypass_srtp = PJ_TRUE; 
    15781581    srtp->peer_use = PJMEDIA_SRTP_DISABLED; 
     1582    if (srtp->session_inited) { 
     1583        pjmedia_transport_srtp_stop(tp); 
     1584    } 
    15791585 
    15801586PROPAGATE_MEDIA_START: 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r3334 r3376  
    12481248 
    12491249#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
    1250         srtp_active = acc->cfg.use_srtp && srtp != NULL; 
     1250        srtp_active = acc->cfg.use_srtp; 
    12511251#else 
    12521252        srtp_active = PJ_FALSE; 
     
    13001300    if (call->med_tp == NULL) { 
    13011301        return PJ_EBUSY; 
     1302    } 
     1303 
     1304    if (rem_sdp && rem_sdp->media_count != 0) { 
     1305        pj_bool_t srtp_active; 
     1306 
     1307#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     1308        srtp_active = pjsua_var.acc[call->acc_id].cfg.use_srtp; 
     1309#else 
     1310        srtp_active = PJ_FALSE; 
     1311#endif 
     1312 
     1313        call->audio_idx = find_audio_index(rem_sdp, srtp_active); 
    13021314    } 
    13031315 
Note: See TracChangeset for help on using the changeset viewer.