Changeset 3091


Ignore:
Timestamp:
Feb 9, 2010 12:28:03 PM (10 years ago)
Author:
bennylp
Message:

Fixed ticket #1034: Crash on accepting a call with no codec in the SDP offer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r2951 r3091  
    245245        /* Release the flip-flop pools */ 
    246246        pj_pool_release(inv->pool_prov); 
     247        inv->pool_prov = NULL; 
    247248        pj_pool_release(inv->pool_active); 
     249        inv->pool_active = NULL; 
    248250    } 
    249251} 
     
    14991501        (*mod_inv.cb.on_media_update)(inv, status); 
    15001502 
    1501     /* Swap the flip-flop pool when SDP negotiation success. */ 
    1502     if (status == PJ_SUCCESS) { 
    1503         swap_pool(&inv->pool_prov, &inv->pool_active); 
    1504     } 
    1505  
    1506     /* Reset the provisional pool regardless SDP negotiation result. */ 
    1507     pj_pool_reset(inv->pool_prov); 
     1503    /* Invite session may have been terminated by the application even  
     1504     * after a successful SDP negotiation, for example when no audio  
     1505     * codec is present in the offer (see ticket #1034). 
     1506     */ 
     1507    if (inv->state != PJSIP_INV_STATE_DISCONNECTED) { 
     1508 
     1509        /* Swap the flip-flop pool when SDP negotiation success. */ 
     1510        if (status == PJ_SUCCESS) { 
     1511            swap_pool(&inv->pool_prov, &inv->pool_active); 
     1512        } 
     1513 
     1514        /* Reset the provisional pool regardless SDP negotiation result. */ 
     1515        pj_pool_reset(inv->pool_prov); 
     1516 
     1517    } else { 
     1518 
     1519        status = PJSIP_ERRNO_FROM_SIP_STATUS(inv->cause); 
     1520    } 
    15081521 
    15091522    return status; 
Note: See TracChangeset for help on using the changeset viewer.