Ignore:
Timestamp:
Nov 26, 2012 2:04:17 AM (11 years ago)
Author:
ming
Message:

Fixes #1595: Allow call hangup immediately after outgoing call

File:
1 edited

Legend:

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

    r4280 r4300  
    389389    } 
    390390 
    391     /* pjsua_media_channel_deinit() has been called. */ 
    392     if (call->async_call.med_ch_deinit) 
     391    /* pjsua_media_channel_deinit() has been called or 
     392     * call has been hung up. 
     393     */ 
     394    if (call->async_call.med_ch_deinit || 
     395        call->async_call.call_var.out_call.hangup) 
     396    { 
     397        PJ_LOG(4,(THIS_FILE, "Call has been hung up or media channel has " 
     398                             "been deinitialized")); 
    393399        goto on_error; 
     400    } 
    394401 
    395402    /* Create offer */ 
     
    488495 
    489496    /* Done. */ 
     497    call->med_ch_cb = NULL; 
    490498 
    491499    pjsip_dlg_dec_lock(dlg); 
     
    514522        pjsua_media_channel_deinit(call_id); 
    515523    } 
     524 
     525    call->med_ch_cb = NULL; 
     526 
     527    pjsua_check_snd_dev_idle(); 
    516528 
    517529    PJSUA_UNLOCK(); 
     
    21452157    if (status != PJ_SUCCESS) 
    21462158        goto on_return; 
     2159 
     2160    /* If media transport creation is not yet completed, we will hangup 
     2161     * the call in the media transport creation callback instead. 
     2162     */ 
     2163    if (call->med_ch_cb) { 
     2164        PJ_LOG(4,(THIS_FILE, "Pending call %d hangup upon completion " 
     2165                             "of media transport", call_id)); 
     2166        call->async_call.call_var.out_call.hangup = PJ_TRUE; 
     2167        if (code == 0) 
     2168            call->last_code = PJSIP_SC_REQUEST_TERMINATED; 
     2169        else 
     2170            call->last_code = code; 
     2171        if (reason) { 
     2172            pj_strncpy(&call->last_text, reason, 
     2173                       sizeof(call->last_text_buf_)); 
     2174        } 
     2175         
     2176        goto on_return; 
     2177    } 
    21472178 
    21482179    if (code==0) { 
Note: See TracChangeset for help on using the changeset viewer.