Changeset 4315


Ignore:
Timestamp:
Jan 11, 2013 8:53:52 AM (11 years ago)
Author:
nanang
Message:

Fix #1605: always re-init media channel for SDP re-offer/answer generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r4309 r4315  
    563563#endif 
    564564 
     565    call->opt = *opt; 
     566 
    565567    /* If call is established, reinit media channel */ 
    566568    if (call->inv && call->inv->state == PJSIP_INV_STATE_CONFIRMED) { 
    567         pjsua_call_setting old_opt; 
     569        pjsip_role_e role = rem_sdp? PJSIP_ROLE_UAS : PJSIP_ROLE_UAC; 
    568570        pj_status_t status; 
    569571 
    570         old_opt = call->opt; 
    571         call->opt = *opt; 
    572  
    573         /* Reinit media channel when media count is changed or we are the 
    574          * answerer (as remote offer may 'extremely' modify the existing 
    575          * media session, e.g: media type order). 
    576          */ 
    577         if (rem_sdp || 
    578             opt->aud_cnt!=old_opt.aud_cnt || opt->vid_cnt!=old_opt.vid_cnt) 
    579         { 
    580             pjsip_role_e role = rem_sdp? PJSIP_ROLE_UAS : PJSIP_ROLE_UAC; 
    581             status = pjsua_media_channel_init(call->index, role, 
    582                                               call->secure_level, 
    583                                               call->inv->pool_prov, 
    584                                               rem_sdp, NULL, 
    585                                               PJ_FALSE, NULL); 
    586             if (status != PJ_SUCCESS) { 
    587                 pjsua_perror(THIS_FILE, "Error re-initializing media channel", 
    588                              status); 
    589                 return status; 
    590             } 
    591         } 
    592     } else { 
    593         call->opt = *opt; 
     572        status = pjsua_media_channel_init(call->index, role, 
     573                                          call->secure_level, 
     574                                          call->inv->pool_prov, 
     575                                          rem_sdp, NULL, 
     576                                          PJ_FALSE, NULL); 
     577        if (status != PJ_SUCCESS) { 
     578            pjsua_perror(THIS_FILE, "Error re-initializing media channel", 
     579                         status); 
     580            return status; 
     581        } 
    594582    } 
    595583 
Note: See TracChangeset for help on using the changeset viewer.