Ignore:
Timestamp:
Jul 20, 2018 2:19:41 AM (2 years ago)
Author:
ming
Message:

Fixed #2128: Add feature to allow responding incoming INVITE/re-INVITE asynchronously and set the SDP answer

File:
1 edited

Legend:

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

    r5820 r5828  
    10921092     * current call setting. 
    10931093     * 
     1094     * Note: this callback may not be called if \a on_call_rx_reinvite() 
     1095     * is implemented. 
     1096     * 
    10941097     * @param call_id   The call index. 
    10951098     * @param offer     The new offer received. 
     
    11061109                             pjsip_status_code *code, 
    11071110                             pjsua_call_setting *opt); 
     1111 
     1112 
     1113    /** 
     1114     * Notify application when call has received a re-INVITE with offer 
     1115     * from the peer. It allows more fine-grained control over the response 
     1116     * to a re-INVITE. If application sets async to PJ_TRUE, it can send 
     1117     * the reply manually using the function #pjsua_call_answer_with_sdp(). 
     1118     * Otherwise, by default the re-INVITE will be answered automatically 
     1119     * after the callback returns. 
     1120     * 
     1121     * Currently, this callback is only called for re-INVITE with 
     1122     * SDP, but app should be prepared to handle the case of re-INVITE 
     1123     * without SDP. 
     1124     * 
     1125     * Remarks: If manually answering at a later timing, application may 
     1126     * need to monitor on_call_tsx_state() callback to check whether 
     1127     * the re-INVITE is already answered automatically with 487 due to 
     1128     * being cancelled. 
     1129     * 
     1130     * Note: on_call_rx_offer() will still be called after this callback, 
     1131     * but only if async is PJ_FALSE and code is 200.  
     1132     * 
     1133     * @param call_id   The call index. 
     1134     * @param offer     Remote offer. 
     1135     * @param rdata     The received re-INVITE request. 
     1136     * @param reserved  Reserved param, currently not used. 
     1137     * @param async     On input, it is PJ_FALSE. Set to PJ_TRUE if 
     1138     *                  app wants to manually answer the re-INVITE. 
     1139     * @param code      Status code to be returned for answering the 
     1140     *                  offer. On input, it contains status code 200. 
     1141     *                  Currently, valid values are only 200 and 488. 
     1142     * @param opt       The current call setting, application can update 
     1143     *                  this setting for answering the offer. 
     1144     */ 
     1145    void (*on_call_rx_reinvite)(pjsua_call_id call_id, 
     1146                                const pjmedia_sdp_session *offer, 
     1147                                pjsip_rx_data *rdata, 
     1148                                void *reserved, 
     1149                                pj_bool_t *async, 
     1150                                pjsip_status_code *code, 
     1151                                pjsua_call_setting *opt); 
    11081152 
    11091153 
     
    51235167 
    51245168/** 
     5169 * Same as #pjsua_call_answer2() but this function will set the SDP 
     5170 * answer first before sending the response. 
     5171 * 
     5172 * @param call_id       Incoming call identification. 
     5173 * @param sdp           SDP answer.  
     5174 * @param opt           Optional call setting. 
     5175 * @param code          Status code, (100-699). 
     5176 * @param reason        Optional reason phrase. If NULL, default text 
     5177 *                      will be used. 
     5178 * @param msg_data      Optional list of headers etc to be added to outgoing 
     5179 *                      response message. Note that this message data will 
     5180 *                      be persistent in all next answers/responses for this 
     5181 *                      INVITE request. 
     5182 * 
     5183 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     5184 */ 
     5185PJ_DECL(pj_status_t) 
     5186pjsua_call_answer_with_sdp(pjsua_call_id call_id, 
     5187                           const pjmedia_sdp_session *sdp,  
     5188                           const pjsua_call_setting *opt, 
     5189                           unsigned code, 
     5190                           const pj_str_t *reason, 
     5191                           const pjsua_msg_data *msg_data); 
     5192 
     5193 
     5194/** 
    51255195 * Hangup call by using method that is appropriate according to the 
    51265196 * call state. This function is different than answering the call with 
Note: See TracChangeset for help on using the changeset viewer.