Changeset 5641


Ignore:
Timestamp:
Aug 16, 2017 4:53:44 AM (7 years ago)
Author:
ming
Message:

Fixed #2037: Add on_rx_offer2() callback for SIP invite
Thanks to Andrey Kovalenko for the suggestion and the initial version of the patch.

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h

    r5435 r5641  
    9898 
    9999/** 
     100 * Structure to hold parameters when calling the callback 
     101 * #on_rx_offer2(). 
     102 */ 
     103struct pjsip_inv_on_rx_offer_cb_param 
     104{ 
     105    const pjmedia_sdp_session   *offer;     /** Remote offer.               */ 
     106    const pjsip_rx_data         *rdata;     /** The received request.       */ 
     107}; 
     108 
     109 
     110/** 
    100111 * This structure contains callbacks to be registered by application to  
    101112 * receieve notifications from the framework about various events in 
     
    155166     * will be sent with the SIP message. 
    156167     * 
     168     * Note: if callback #on_rx_offer2() is implemented, this callback will 
     169     * not be called. 
     170     * 
    157171     * @param inv       The invite session. 
    158172     * @param offer     Remote offer. 
    159173     */ 
    160174    void (*on_rx_offer)(pjsip_inv_session *inv, 
    161                         const pjmedia_sdp_session *offer); 
     175                        const pjmedia_sdp_session *offer); 
     176 
     177    /** 
     178     * This callback is called when the invite session has received  
     179     * new offer from peer. Variant of #on_rx_offer() callback. 
     180     * 
     181     * @param inv       The invite session. 
     182     * @param param     The callback parameters. 
     183     */ 
     184    void (*on_rx_offer2)(pjsip_inv_session *inv, 
     185                         struct pjsip_inv_on_rx_offer_cb_param *param); 
    162186 
    163187    /** 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r5610 r5641  
    21042104 
    21052105        /* Inform application about remote offer. */ 
    2106         if (mod_inv.cb.on_rx_offer && inv->notify) { 
    2107  
    2108             (*mod_inv.cb.on_rx_offer)(inv, sdp_info->sdp); 
    2109  
     2106        if (mod_inv.cb.on_rx_offer2 && inv->notify) { 
     2107            struct pjsip_inv_on_rx_offer_cb_param param; 
     2108 
     2109            param.offer = sdp_info->sdp; 
     2110            param.rdata = rdata; 
     2111            (*mod_inv.cb.on_rx_offer2)(inv, &param); 
     2112        } else if (mod_inv.cb.on_rx_offer && inv->notify) { 
     2113            (*mod_inv.cb.on_rx_offer)(inv, sdp_info->sdp); 
    21102114        } 
    21112115 
Note: See TracChangeset for help on using the changeset viewer.