Ignore:
Timestamp:
Mar 16, 2011 3:52:20 AM (11 years ago)
Author:
bennylp
Message:

Fixed #1209: new enhancement: Option to update Contact URI when sending re-INVITE or UPDATE

File:
1 edited

Legend:

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

    r3374 r3452  
    16611661 */ 
    16621662PJ_DEF(pj_status_t) pjsua_call_reinvite( pjsua_call_id call_id, 
    1663                                          pj_bool_t unhold, 
     1663                                         unsigned options, 
    16641664                                         const pjsua_msg_data *msg_data) 
    16651665{ 
    16661666    pjmedia_sdp_session *sdp; 
     1667    pj_str_t *new_contact = NULL; 
    16671668    pjsip_tx_data *tdata; 
    16681669    pjsua_call *call; 
     
    16851686 
    16861687    /* Create SDP */ 
    1687     if (call->local_hold && !unhold) { 
     1688    if (call->local_hold && (options & PJSUA_CALL_UNHOLD)==0) { 
    16881689        status = create_sdp_of_call_hold(call, &sdp); 
    16891690    } else { 
     
    17001701    } 
    17011702 
     1703    if ((options & PJSUA_CALL_UPDATE_CONTACT) & 
     1704            pjsua_acc_is_valid(call->acc_id)) 
     1705    { 
     1706        new_contact = &pjsua_var.acc[call->acc_id].contact; 
     1707    } 
     1708 
    17021709    /* Create re-INVITE with new offer */ 
    1703     status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     1710    status = pjsip_inv_reinvite( call->inv, new_contact, sdp, &tdata); 
    17041711    if (status != PJ_SUCCESS) { 
    17051712        pjsua_perror(THIS_FILE, "Unable to create re-INVITE", status); 
     
    17331740{ 
    17341741    pjmedia_sdp_session *sdp; 
     1742    pj_str_t *new_contact = NULL; 
    17351743    pjsip_tx_data *tdata; 
    17361744    pjsua_call *call; 
     
    17581766    } 
    17591767 
     1768    if ((options & PJSUA_CALL_UPDATE_CONTACT) & 
     1769            pjsua_acc_is_valid(call->acc_id)) 
     1770    { 
     1771        new_contact = &pjsua_var.acc[call->acc_id].contact; 
     1772    } 
     1773 
    17601774    /* Create UPDATE with new offer */ 
    1761     status = pjsip_inv_update(call->inv, NULL, sdp, &tdata); 
     1775    status = pjsip_inv_update(call->inv, new_contact, sdp, &tdata); 
    17621776    if (status != PJ_SUCCESS) { 
    17631777        pjsua_perror(THIS_FILE, "Unable to create UPDATE request", status); 
Note: See TracChangeset for help on using the changeset viewer.