Changeset 3749


Ignore:
Timestamp:
Sep 15, 2011 10:09:44 AM (8 years ago)
Author:
bennylp
Message:

Fixed #1369: Local state is set to HOLD even if hold operation fails

Location:
pjproject/branches/1.x/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua_internal.h

    r3553 r3749  
    6464    pjsua_call_hold_type call_hold_type; /**< How to do call hold.          */ 
    6565    pj_bool_t            local_hold;/**< Flag for call-hold by local.       */ 
     66    void                *hold_msg;  /**< Outgoing hold tx_data.             */ 
    6667    pjsua_call_media_status media_st;/**< Media state.                      */ 
    6768    pjmedia_dir          media_dir; /**< Media direction.                   */ 
  • pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_call.c

    r3584 r3749  
    16541654    pjsua_process_msg_data( tdata, msg_data); 
    16551655 
     1656    /* Record the tx_data to keep track the operation */ 
     1657    call->hold_msg = (void*) tdata; 
     1658 
    16561659    /* Send the request */ 
    16571660    status = pjsip_inv_send_msg( call->inv, tdata); 
    16581661    if (status != PJ_SUCCESS) { 
    16591662        pjsua_perror(THIS_FILE, "Unable to send re-INVITE", status); 
     1663        call->hold_msg = NULL; 
    16601664        pjsip_dlg_dec_lock(dlg); 
    16611665        return status; 
     
    43904394            } 
    43914395        } 
    4392     } 
     4396    } else if (tsx->role == PJSIP_ROLE_UAC && 
     4397               tsx->last_tx == (pjsip_tx_data*)call->hold_msg && 
     4398               tsx->state >= PJSIP_TSX_STATE_COMPLETED) 
     4399    { 
     4400        /* Monitor the status of call hold request */ 
     4401        call->hold_msg = NULL; 
     4402        if (tsx->status_code/100 != 2) { 
     4403            /* Outgoing call hold failed */ 
     4404            call->local_hold = PJ_FALSE; 
     4405            PJ_LOG(3,(THIS_FILE, "Error putting call %d on hold (reason=%d)", 
     4406                      call->index, tsx->status_code)); 
     4407        } 
     4408    } 
     4409 
    43934410 
    43944411 
Note: See TracChangeset for help on using the changeset viewer.