Changeset 5878 for pjproject/trunk/pjsip/src/pjsua2/call.cpp
- Timestamp:
- Sep 4, 2018 3:12:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/call.cpp
r5877 r5878 30 30 /////////////////////////////////////////////////////////////////////////////// 31 31 32 #define SDP_BUFFER_SIZE 102433 32 34 33 MathStat::MathStat() … … 111 110 void SdpSession::fromPj(const pjmedia_sdp_session &sdp) 112 111 { 113 char buf[SDP_BUFFER_SIZE]; 112 #if PJSUA2_MAX_SDP_BUF_LEN 113 char buf[PJSUA2_MAX_SDP_BUF_LEN]; 114 114 int len; 115 115 116 116 len = pjmedia_sdp_print(&sdp, buf, sizeof(buf)); 117 117 wholeSdp = (len > -1? string(buf, len): ""); 118 #else 119 wholeSdp = ""; 120 #endif 118 121 pjSdpSession = (void *)&sdp; 119 122 } … … 168 171 */ 169 172 void setPortId(int id); 173 174 /** 175 * Destructor 176 */ 177 virtual ~CallAudioMedia(); 170 178 }; 171 179 … … 174 182 { 175 183 this->id = pid; 184 } 185 186 CallAudioMedia::~CallAudioMedia() 187 { 188 id = PJSUA_INVALID_ID; 176 189 } 177 190 … … 419 432 p_reason = (reason.slen == 0? NULL: &reason); 420 433 421 if (sdp_str == "") { 422 sdp = NULL; 423 } else { 434 sdp = NULL; 435 if (sdp_str != "") { 424 436 pj_str_t dup_pj_sdp; 425 437 pj_str_t pj_sdp_str = {(char*)sdp_str.c_str(), 426 438 (pj_ssize_t)sdp_str.size()}; 439 pj_status_t status; 427 440 428 441 pj_strdup(pool, &dup_pj_sdp, &pj_sdp_str); 429 pjmedia_sdp_parse(pool, dup_pj_sdp.ptr, 430 dup_pj_sdp.slen, &sdp); 442 status = pjmedia_sdp_parse(pool, dup_pj_sdp.ptr, 443 dup_pj_sdp.slen, &sdp); 444 if (status != PJ_SUCCESS) { 445 PJ_PERROR(4,(THIS_FILE, status, 446 "Failed to parse SDP for call param")); 447 } 431 448 } 432 449 } … … 753 770 754 771 if (pjsua_call_get_info(id, &pj_ci) == PJ_SUCCESS) { 772 if (medias.size()) { 773 /* Clear medias. */ 774 for (mi = 0; mi < medias.size(); mi++) { 775 if (medias[mi]) 776 delete medias[mi]; 777 } 778 medias.clear(); 779 } 780 755 781 for (mi = 0; mi < pj_ci.media_cnt; mi++) { 756 782 if (mi >= medias.size()) {
Note: See TracChangeset
for help on using the changeset viewer.