Changeset 5274


Ignore:
Timestamp:
Apr 6, 2016 8:15:45 AM (5 years ago)
Author:
ming
Message:

Fixed #1911: Callback onCallSdpCreated() (pjsua2) doesn't modify the SDP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5209 r5274  
    895895    /* Check if application modifies the SDP */ 
    896896    if (orig_sdp != prm.sdp.wholeSdp) { 
    897         pjmedia_sdp_parse(pool, (char*)prm.sdp.wholeSdp.c_str(), 
    898                           prm.sdp.wholeSdp.size(), &sdp); 
     897        pjmedia_sdp_session *new_sdp; 
     898        pj_str_t dup_new_sdp; 
     899        pj_str_t new_sdp_str = {(char*)prm.sdp.wholeSdp.c_str(), 
     900                                prm.sdp.wholeSdp.size()}; 
     901 
     902        pj_strdup(pool, &dup_new_sdp, &new_sdp_str);         
     903        pjmedia_sdp_parse(pool, dup_new_sdp.ptr, 
     904                          dup_new_sdp.slen, &new_sdp); 
     905        pj_memcpy(sdp, new_sdp, sizeof(*sdp)); 
    899906    } 
    900907} 
Note: See TracChangeset for help on using the changeset viewer.