Changeset 3598 for pjproject


Ignore:
Timestamp:
Jun 24, 2011 7:35:28 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1318: Prevent PJSIP_INV_STATE_CALLING from being reported more than once (thanks Sam Yasin for the report)

Location:
pjproject/branches/1.x/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/include/pjsip-ua/sip_inv.h

    r3553 r3598  
    368368    pj_str_t             cause_text;                /**< Cause text.        */ 
    369369    pj_bool_t            notify;                    /**< Internal.          */ 
     370    unsigned             cb_called;                 /**< Cb has been called */ 
    370371    pjsip_dialog        *dlg;                       /**< Underlying dialog. */ 
    371372    pjsip_role_e         role;                      /**< Invite role.       */ 
  • pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_inv.c

    r3574 r3598  
    196196{ 
    197197    pjsip_inv_state prev_state = inv->state; 
     198    pj_bool_t dont_notify = PJ_FALSE; 
    198199    pj_status_t status; 
    199200 
     201    /* Prevent STATE_CALLING from being reported more than once because 
     202     * of authentication 
     203     * https://trac.pjsip.org/repos/ticket/1318 
     204     */ 
     205    if (state==PJSIP_INV_STATE_CALLING &&  
     206        (inv->cb_called & (1 << PJSIP_INV_STATE_CALLING)) != 0) 
     207    { 
     208        dont_notify = PJ_TRUE; 
     209    } 
    200210 
    201211    /* If state is confirmed, check that SDP negotiation is done, 
     
    225235              inv->cause != 0); 
    226236 
     237    /* Mark the callback as called for this state */ 
     238    inv->cb_called |= (1 << state); 
     239 
    227240    /* Call on_state_changed() callback. */ 
    228     if (mod_inv.cb.on_state_changed && inv->notify) 
     241    if (mod_inv.cb.on_state_changed && inv->notify && !dont_notify) 
    229242        (*mod_inv.cb.on_state_changed)(inv, e); 
    230243 
Note: See TracChangeset for help on using the changeset viewer.