Changeset 4421


Ignore:
Timestamp:
Mar 6, 2013 5:55:09 AM (12 years ago)
Author:
ming
Message:

Fixed #1629: Add pjsua_call_set_hold2() API to allow update of Contact header

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r4347 r4421  
    40104010    /** 
    40114011     * Update the local invite session's contact with the contact URI from 
    4012      * the account. This flag is only valid for #pjsua_call_reinvite() and 
    4013      * #pjsua_call_update(). This flag is useful in IP address change 
    4014      * situation, after the local account's Contact has been updated 
    4015      * (typically with re-registration) use this flag to update the invite 
    4016      * session with the new Contact and to inform this new Contact to the 
    4017      * remote peer with the outgoing re-INVITE or UPDATE 
     4012     * the account. This flag is only valid for #pjsua_call_set_hold2(), 
     4013     * #pjsua_call_reinvite() and #pjsua_call_update(). This flag is useful 
     4014     * in IP address change situation, after the local account's Contact has 
     4015     * been updated (typically with re-registration) use this flag to update 
     4016     * the invite session with the new Contact and to inform this new Contact 
     4017     * to the remote peer with the outgoing re-INVITE or UPDATE. 
    40184018     */ 
    40194019    PJSUA_CALL_UPDATE_CONTACT = 2, 
     
    44754475                                         const pjsua_msg_data *msg_data); 
    44764476 
     4477/** 
     4478 * Put the specified call on hold. This will send re-INVITE with the 
     4479 * appropriate SDP to inform remote that the call is being put on hold. 
     4480 * The final status of the request itself will be reported on the 
     4481 * \a on_call_media_state() callback, which inform the application that 
     4482 * the media state of the call has changed. 
     4483 * 
     4484 * @param call_id       Call identification. 
     4485 * @param options       Bitmask of pjsua_call_flag constants. Currently, only 
     4486 *                      the flag PJSUA_CALL_UPDATE_CONTACT can be used. 
     4487 * @param msg_data      Optional message components to be sent with 
     4488 *                      the request. 
     4489 * 
     4490 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     4491 */ 
     4492PJ_DECL(pj_status_t) pjsua_call_set_hold2(pjsua_call_id call_id, 
     4493                                          unsigned options, 
     4494                                          const pjsua_msg_data *msg_data); 
    44774495 
    44784496/** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r4411 r4421  
    22582258                                        const pjsua_msg_data *msg_data) 
    22592259{ 
     2260    return pjsua_call_set_hold2(call_id, 0, msg_data); 
     2261} 
     2262 
     2263PJ_DEF(pj_status_t) pjsua_call_set_hold2(pjsua_call_id call_id, 
     2264                                         unsigned options, 
     2265                                         const pjsua_msg_data *msg_data) 
     2266{ 
    22602267    pjmedia_sdp_session *sdp; 
    22612268    pjsua_call *call; 
    22622269    pjsip_dialog *dlg = NULL; 
    22632270    pjsip_tx_data *tdata; 
     2271    pj_str_t *new_contact = NULL; 
    22642272    pj_status_t status; 
    22652273 
     
    22842292        goto on_return; 
    22852293 
     2294    if ((options & PJSUA_CALL_UPDATE_CONTACT) && 
     2295        pjsua_acc_is_valid(call->acc_id)) 
     2296    { 
     2297        new_contact = &pjsua_var.acc[call->acc_id].contact; 
     2298    } 
     2299 
    22862300    /* Create re-INVITE with new offer */ 
    2287     status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     2301    status = pjsip_inv_reinvite( call->inv, new_contact, sdp, &tdata); 
    22882302    if (status != PJ_SUCCESS) { 
    22892303        pjsua_perror(THIS_FILE, "Unable to create re-INVITE", status); 
Note: See TracChangeset for help on using the changeset viewer.