Ignore:
Timestamp:
Dec 8, 2011 8:18:02 AM (9 years ago)
Author:
nanang
Message:

Re #1419: updated call transfer to allow both the transferee and the transfer destination to update the current call setting:

  • for transferee (attended & unattended): via new PJSUA-LIB callback on_call_transfer_request2()
  • for transfer destination (attended only): via new PJSUA-LIB callback on_call_replace_request2()
File:
1 edited

Legend:

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

    r3901 r3903  
    567567 
    568568/** 
     569 * Call settings. 
     570 */ 
     571typedef struct pjsua_call_setting 
     572{ 
     573    /** 
     574     * Bitmask of #pjsua_call_flag constants. 
     575     * 
     576     * Default: 0 
     577     */ 
     578    unsigned         flag; 
     579 
     580    /** 
     581     * This flag controls what methods to request keyframe are allowed on 
     582     * the call. Value is bitmask of #pjsua_vid_req_keyframe_method. 
     583     */ 
     584    unsigned         req_keyframe_method; 
     585 
     586    /** 
     587     * Number of simultaneous active audio streams for this call. Setting 
     588     * this to zero will disable audio in this call. 
     589     * 
     590     * Default: 1 
     591     */ 
     592    unsigned         audio_cnt; 
     593 
     594    /** 
     595     * Number of simultaneous active video streams for this call. Setting 
     596     * this to zero will disable video in this call. 
     597     * 
     598     * Default: 1 (if video feature is enabled, otherwise it is zero) 
     599     */ 
     600    unsigned         video_cnt; 
     601 
     602} pjsua_call_setting; 
     603 
     604 
     605/** 
    569606 * This structure describes application callback to receive various event 
    570607 * notification from PJSUA-API. All of these callbacks are OPTIONAL, 
     
    666703     * by setting the code (default is 202). When this callback 
    667704     * is not defined, the default behavior is to accept the 
    668      * transfer. 
     705     * transfer. See also on_call_transfer_request2() callback for 
     706     * the version with \a pjsua_call_setting in the argument list. 
    669707     * 
    670708     * @param call_id   The call index. 
     
    677715                                     const pj_str_t *dst, 
    678716                                     pjsip_status_code *code); 
     717 
     718    /** 
     719     * Notify application on call being transfered (i.e. REFER is received). 
     720     * Application can decide to accept/reject transfer request 
     721     * by setting the code (default is 202). When this callback 
     722     * is not defined, the default behavior is to accept the 
     723     * transfer. 
     724     * 
     725     * @param call_id   The call index. 
     726     * @param dst       The destination where the call will be  
     727     *                  transfered to. 
     728     * @param code      Status code to be returned for the call transfer 
     729     *                  request. On input, it contains status code 200. 
     730     * @param opt       The current call setting, application can update 
     731     *                  this setting for the call being transfered. 
     732     */ 
     733    void (*on_call_transfer_request2)(pjsua_call_id call_id, 
     734                                      const pj_str_t *dst, 
     735                                      pjsip_status_code *code, 
     736                                      pjsua_call_setting *opt); 
    679737 
    680738    /** 
     
    704762     * Notify application about incoming INVITE with Replaces header. 
    705763     * Application may reject the request by setting non-2xx code. 
     764     * See also on_call_replace_request2() callback for the version 
     765     * with \a pjsua_call_setting in the argument list. 
    706766     * 
    707767     * @param call_id       The call ID to be replaced. 
     
    715775                                    int *st_code, 
    716776                                    pj_str_t *st_text); 
     777 
     778    /** 
     779     * Notify application about incoming INVITE with Replaces header. 
     780     * Application may reject the request by setting non-2xx code. 
     781     * 
     782     * @param call_id       The call ID to be replaced. 
     783     * @param rdata         The incoming INVITE request to replace the call. 
     784     * @param st_code       Status code to be set by application. Application 
     785     *                      should only return a final status (200-699). 
     786     * @param st_text       Optional status text to be set by application. 
     787     * @param opt           The current call setting, application can update 
     788     *                      this setting for the call being replaced. 
     789     */ 
     790    void (*on_call_replace_request2)(pjsua_call_id call_id, 
     791                                     pjsip_rx_data *rdata, 
     792                                     int *st_code, 
     793                                     pj_str_t *st_text, 
     794                                     pjsua_call_setting *opt); 
    717795 
    718796    /** 
     
    34053483 
    34063484/** 
    3407  * Call settings. 
    3408  */ 
    3409 typedef struct pjsua_call_setting 
    3410 { 
    3411     /** 
    3412      * Bitmask of #pjsua_call_flag constants. 
    3413      * 
    3414      * Default: 0 
    3415      */ 
    3416     unsigned         flag; 
    3417  
    3418     /** 
    3419      * This flag controls what methods to request keyframe are allowed on 
    3420      * the call. Value is bitmask of #pjsua_vid_req_keyframe_method. 
    3421      */ 
    3422     unsigned         req_keyframe_method; 
    3423  
    3424     /** 
    3425      * Number of simultaneous active audio streams for this call. Setting 
    3426      * this to zero will disable audio in this call. 
    3427      * 
    3428      * Default: 1 
    3429      */ 
    3430     unsigned         audio_cnt; 
    3431  
    3432     /** 
    3433      * Number of simultaneous active video streams for this call. Setting 
    3434      * this to zero will disable video in this call. 
    3435      * 
    3436      * Default: 1 (if video feature is enabled, otherwise it is zero) 
    3437      */ 
    3438     unsigned         video_cnt; 
    3439  
    3440 } pjsua_call_setting; 
    3441  
    3442  
    3443 /** 
    34443485 * This structure describes the information and current status of a call. 
    34453486 */ 
     
    40674108 * 
    40684109 * @param call_id       Call identification. 
    4069  * @param opt           Optional call setting. 
     4110 * @param opt           Optional call setting, if NULL, the current call 
     4111 *                      setting will remain unchanged. 
    40704112 * @param msg_data      Optional message components to be sent with 
    40714113 *                      the request. 
     
    40974139 * 
    40984140 * @param call_id       Call identification. 
    4099  * @param opt           Optional call setting. 
     4141 * @param opt           Optional call setting, if NULL, the current call 
     4142 *                      setting will remain unchanged. 
    41004143 * @param msg_data      Optional message components to be sent with 
    41014144 *                      the request. 
Note: See TracChangeset for help on using the changeset viewer.