Ignore:
Timestamp:
Sep 24, 2014 8:26:33 AM (10 years ago)
Author:
nanang
Message:

Close #1793: Avoid call setting flags PJSUA_CALL_UNHOLD, PJSUA_CALL_UPDATE_CONTACT, and PJSUA_CALL_NO_SDP_OFFER to be sticky or reused in the next calls of pjsua_call_reinvite/update().

File:
1 edited

Legend:

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

    r4924 r4929  
    557557 
    558558/* 
     559 * Cleanup call setting flag to avoid one time flags, such as 
     560 * PJSUA_CALL_UNHOLD, PJSUA_CALL_UPDATE_CONTACT, or 
     561 * PJSUA_CALL_NO_SDP_OFFER, to be sticky (ticket #1793). 
     562 */ 
     563static void cleanup_call_setting_flag(pjsua_call_setting *opt) 
     564{ 
     565    opt->flag &= ~(PJSUA_CALL_UNHOLD | PJSUA_CALL_UPDATE_CONTACT | 
     566                   PJSUA_CALL_NO_SDP_OFFER); 
     567} 
     568 
     569 
     570/* 
    559571 * Initialize call settings based on account ID. 
    560572 */ 
     
    580592    pj_assert(call); 
    581593 
    582     if (!opt) 
     594    if (!opt) { 
     595        cleanup_call_setting_flag(&call->opt); 
    583596        return PJ_SUCCESS; 
     597    } 
    584598 
    585599#if !PJMEDIA_HAS_VIDEO 
     
    11461160        /* Copy call setting from the replaced call */ 
    11471161        call->opt = replaced_call->opt; 
     1162        cleanup_call_setting_flag(&call->opt); 
    11481163 
    11491164        /* Notify application */ 
     
    24112426        call->opt.flag = options; 
    24122427 
    2413     status = pjsua_call_reinvite2(call_id, NULL, msg_data); 
     2428    status = pjsua_call_reinvite2(call_id, &call->opt, msg_data); 
    24142429 
    24152430on_return: 
     
    25252540        call->opt.flag = options; 
    25262541 
    2527     status = pjsua_call_update2(call_id, NULL, msg_data); 
     2542    status = pjsua_call_update2(call_id, &call->opt, msg_data); 
    25282543 
    25292544on_return: 
     
    39523967    if (pjsua_var.ua_cfg.cb.on_call_rx_offer) { 
    39533968        pjsip_status_code code = PJSIP_SC_OK; 
    3954         pjsua_call_setting opt = call->opt; 
     3969        pjsua_call_setting opt; 
     3970 
     3971        cleanup_call_setting_flag(&call->opt); 
     3972        opt = call->opt; 
    39553973 
    39563974        (*pjsua_var.ua_cfg.cb.on_call_rx_offer)(call->index, offer, NULL, 
     
    43744392    } 
    43754393 
     4394    cleanup_call_setting_flag(&existing_call->opt); 
    43764395    call_opt = existing_call->opt; 
    43774396    if (pjsua_var.ua_cfg.cb.on_call_transfer_request2) { 
     
    46774696        { 
    46784697            /* Call unhold failed */ 
    4679             call->opt.flag &= ~PJSUA_CALL_UNHOLD; 
    46804698            call->local_hold = PJ_TRUE; 
    46814699            PJ_LOG(3,(THIS_FILE, "Error releasing hold on call %d (reason=%d)", 
Note: See TracChangeset for help on using the changeset viewer.