Ignore:
Timestamp:
Jul 20, 2018 2:19:41 AM (6 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/pjsua2/call.hpp

    r5755 r5828  
    867867 
    868868/** 
     869 * This structure contains parameters for Call::onCallRxReinvite() callback. 
     870 */ 
     871struct OnCallRxReinviteParam 
     872{ 
     873    /** 
     874     * The new offer received. 
     875     */ 
     876    SdpSession          offer; 
     877 
     878    /** 
     879     * The incoming re-INVITE. 
     880     */ 
     881    SipRxData           rdata; 
     882     
     883    /** 
     884     * On input, it is false. Set to true if app wants to manually answer 
     885     * the re-INVITE. 
     886     */ 
     887    bool                async; 
     888     
     889    /** 
     890     * Status code to be returned for answering the offer. On input, 
     891     * it contains status code 200. Currently, valid values are only 
     892     * 200 and 488. 
     893     */ 
     894    pjsip_status_code   statusCode; 
     895     
     896    /** 
     897     * The current call setting, application can update this setting for 
     898     * answering the offer. 
     899     */ 
     900    CallSetting         opt; 
     901}; 
     902 
     903/** 
    869904 * This structure contains parameters for Call::onCallTxOffer() callback. 
    870905 */ 
     
    10361071     */ 
    10371072    SipTxOption         txOption; 
     1073 
     1074    /** 
     1075     * SDP answer. Currently only used for Call::answer(). 
     1076     */ 
     1077    SdpSession          sdp; 
    10381078     
    10391079public: 
     
    16581698    { PJ_UNUSED_ARG(prm); } 
    16591699     
     1700    /** 
     1701     * Notify application when call has received a re-INVITE offer from 
     1702     * the peer. It allows more fine-grained control over the response to 
     1703     * a re-INVITE. If application sets async to PJ_TRUE, it can send 
     1704     * the reply manually using the function #Call::answer() and setting 
     1705     * the SDP answer. Otherwise, by default the re-INVITE will be 
     1706     * answered automatically after the callback returns. 
     1707     * 
     1708     * Currently, this callback is only called for re-INVITE with 
     1709     * SDP, but app should be prepared to handle the case of re-INVITE 
     1710     * without SDP. 
     1711     * 
     1712     * Remarks: If manually answering at a later timing, application may 
     1713     * need to monitor onCallTsxState() callback to check whether 
     1714     * the re-INVITE is already answered automatically with 487 due to 
     1715     * being cancelled. 
     1716     * 
     1717     * Note: onCallRxOffer() will still be called after this callback, 
     1718     * but only if prm.async is false and prm.code is 200.  
     1719     */ 
     1720    virtual void onCallRxReinvite(OnCallRxReinviteParam &prm) 
     1721    { PJ_UNUSED_ARG(prm); } 
     1722 
     1723 
    16601724    /** 
    16611725     * Notify application when call has received INVITE with no SDP offer. 
     
    18061870 
    18071871private: 
     1872    friend class Endpoint; 
     1873 
    18081874    Account             &acc; 
    18091875    pjsua_call_id        id; 
    18101876    Token                userData; 
    18111877    std::vector<Media *> medias; 
     1878    pj_pool_t           *sdp_pool; 
    18121879}; 
    18131880 
Note: See TracChangeset for help on using the changeset viewer.