Changeset 5314


Ignore:
Timestamp:
May 24, 2016 7:37:16 AM (8 years ago)
Author:
nanang
Message:

Fix #1923: Delay call-answer triggered from simulated onIncomingCall() to avoid assertion.

File:
1 edited

Legend:

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

    r5288 r5314  
    953953{ 
    954954    struct call_answer *answer, *next; 
     955 
     956    /* No initial answer yet, this function should be called again later */ 
     957    if (!call->inv->last_answer) 
     958        return; 
    955959 
    956960    answer = call->async_call.call_var.inc_call.answers.next; 
     
    16311635        if (pjsua_var.ua_cfg.cb.on_incoming_call) { 
    16321636            pjsua_var.ua_cfg.cb.on_incoming_call(acc_id, call_id, rdata); 
     1637 
     1638            /* onIncomingCall() may be simulated by onCreateMediaTransport() 
     1639             * when media init is done synchrounously (see #1916). And if app 
     1640             * happens to answer the call from the callback, the answer should 
     1641             * have been delayed (see #1923), so let's process the answer now. 
     1642             */ 
     1643            if (call->med_ch_cb == NULL) 
     1644                process_pending_call_answer(call); 
    16331645        } else { 
    16341646            pjsua_call_hangup(call_id, PJSIP_SC_TEMPORARILY_UNAVAILABLE, 
     
    22192231    /* If media transport creation is not yet completed, we will answer 
    22202232     * the call in the media transport creation callback instead. 
     2233     * Or if initial answer is not sent yet, we will answer the call after 
     2234     * initial answer is sent (see #1923). 
    22212235     */ 
    2222     if (call->med_ch_cb) { 
     2236    if (call->med_ch_cb || !call->inv->last_answer) { 
    22232237        struct call_answer *answer; 
    22242238 
Note: See TracChangeset for help on using the changeset viewer.