Ignore:
Timestamp:
Apr 24, 2012 5:40:32 AM (12 years ago)
Author:
nanang
Message:

Fix #1423:

  • Added provisional media in call for generating initial and subsequent SDP offer/answer. If a reoffer is rejected by peer, the main call media will remain unchanged and the provisional media will be cleaned up (the cleanup is currently delayed until call gets destroyed or another reoffer/answer occurs).
  • Reenabled media transport dump in pjsua_core.c.
File:
1 edited

Legend:

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

    r4068 r4071  
    545545        call->opt = *opt; 
    546546 
    547         /* Reinit media channel when media count is changed */ 
    548         if (opt->aud_cnt != old_opt.aud_cnt || 
    549             opt->vid_cnt != old_opt.vid_cnt) 
     547        /* Reinit media channel when media count is changed or we are the 
     548         * answerer (as remote offer may 'extremely' modify the existing 
     549         * media session, e.g: media type order). 
     550         */ 
     551        if (rem_sdp || 
     552            opt->aud_cnt!=old_opt.aud_cnt || opt->vid_cnt!=old_opt.vid_cnt) 
    550553        { 
    551554            pjsip_role_e role = rem_sdp? PJSIP_ROLE_UAS : PJSIP_ROLE_UAC; 
     
    11991202        pjsip_dlg_terminate(dlg); 
    12001203         */ 
    1201         pjsua_media_channel_deinit(call->index); 
    12021204        goto on_return; 
    12031205    } 
     
    13181320        if (status != PJ_SUCCESS) { 
    13191321            pjsua_perror(THIS_FILE, "Unable to send 100 response", status); 
     1322            pjsua_media_channel_deinit(call->index); 
    13201323            goto on_return; 
    13211324        } 
     
    32253228        pjsua_perror(THIS_FILE, "SDP negotiation has failed", status); 
    32263229 
     3230        /* Clean up provisional media */ 
     3231        pjsua_media_prov_clean_up(call->index); 
     3232 
    32273233        /* Do not deinitialize media since this may be a re-INVITE or 
    32283234         * UPDATE (which in this case the media should not get affected 
     
    34283434        call->opt = opt; 
    34293435    } 
    3430  
     3436     
    34313437    /* Re-init media for the new remote offer before creating SDP */ 
    3432     status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS, 
    3433                                       call->secure_level, 
    3434                                       call->inv->pool_prov, 
    3435                                       offer, NULL, 
    3436                                       PJ_FALSE, NULL); 
    3437     if (status != PJ_SUCCESS) { 
    3438         pjsua_perror(THIS_FILE, "Error re-initializing media channel", status); 
    3439         goto on_return; 
    3440     } 
     3438    status = apply_call_setting(call, &call->opt, offer); 
     3439    if (status != PJ_SUCCESS) 
     3440        goto on_return; 
    34413441 
    34423442    status = pjsua_media_channel_create_sdp(call->index,  
Note: See TracChangeset for help on using the changeset viewer.