Ignore:
Timestamp:
Sep 28, 2012 8:56:08 AM (12 years ago)
Author:
nanang
Message:

Re #1587:

  • Don't answer call replace request with 200 if the replaced call hasn't reach confirmed state and has UAS role.
  • Only apply accept_replace_in_early_state when call is in early state.
File:
1 edited

Legend:

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

    r4244 r4268  
    826826                                             call->index); 
    827827 
    828     PJ_LOG(4,(THIS_FILE, "Answering replacement call %d with 200/OK", 
    829                          call->index)); 
    830  
    831     /* Answer the new call with 200 response */ 
    832     status = pjsip_inv_answer(call->inv, 200, NULL, NULL, &tdata); 
     828    if (replaced_call->inv->state <= PJSIP_INV_STATE_EARLY && 
     829        replaced_call->inv->role != PJSIP_ROLE_UAC) 
     830    { 
     831        /* Replaced call is not in confirmed state yet and we are not 
     832         * the call initiator, should not answer with 200 response here. 
     833         */ 
     834    } else { 
     835        PJ_LOG(4,(THIS_FILE, "Answering replacement call %d with 200/OK", 
     836                             call->index)); 
     837 
     838        /* Answer the new call with 200 response */ 
     839        status = pjsip_inv_answer(call->inv, 200, NULL, NULL, &tdata); 
     840    } 
     841 
    833842    if (status == PJ_SUCCESS) 
    834843        status = pjsip_inv_send_msg(call->inv, tdata); 
Note: See TracChangeset for help on using the changeset viewer.