- Timestamp:
- Mar 27, 2007 10:53:57 AM (18 years ago)
- Location:
- pjproject/branches/pjproject-0.5-stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/pjproject-0.5-stable/pjmedia/src/pjmedia/session.c
r1007 r1107 126 126 pjmedia_sdp_rtpmap *rtpmap; 127 127 int local_fmtp_mode = 0, rem_fmtp_mode = 0; 128 unsigned i, pt ;128 unsigned i, pt, fmti; 129 129 pj_status_t status; 130 130 … … 249 249 250 250 251 /* And codec must be numeric! */ 251 /* Get the payload number for receive channel. */ 252 /* 253 Previously we used to rely on fmt[0] being the selected codec, 254 but some UA sends telephone-event as fmt[0] and this would 255 cause assert failure below. 256 257 Thanks Chris Hamilton <chamilton .at. cs.dal.ca> for this patch. 258 259 // And codec must be numeric! 252 260 if (!pj_isdigit(*local_m->desc.fmt[0].ptr) || 253 261 !pj_isdigit(*rem_m->desc.fmt[0].ptr)) … … 256 264 } 257 265 258 /* Get the payload number for receive channel. */259 266 pt = pj_strtoul(&local_m->desc.fmt[0]); 260 267 pj_assert(PJMEDIA_RTP_PT_TELEPHONE_EVENTS==0 || 261 268 pt != PJMEDIA_RTP_PT_TELEPHONE_EVENTS); 269 */ 270 271 /* This is to suppress MSVC warning about uninitialized var */ 272 pt = 0; 273 274 /* Find the first codec which is not telephone-event */ 275 for ( fmti = 0; fmti < local_m->desc.fmt_count; ++fmti ) { 276 if ( !pj_isdigit(*local_m->desc.fmt[fmti].ptr) ) 277 return PJMEDIA_EINVALIDPT; 278 pt = pj_strtoul(&local_m->desc.fmt[fmti]); 279 if ( PJMEDIA_RTP_PT_TELEPHONE_EVENTS == 0 || 280 pt != PJMEDIA_RTP_PT_TELEPHONE_EVENTS ) 281 break; 282 } 283 if ( fmti >= local_m->desc.fmt_count ) 284 return PJMEDIA_EINVALIDPT; 262 285 263 286 /* Get codec info. … … 272 295 273 296 attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 274 &local_m->desc.fmt[ 0]);297 &local_m->desc.fmt[fmti]); 275 298 if (attr == NULL) { 276 299 has_rtpmap = PJ_FALSE; … … 285 308 if (has_rtpmap) { 286 309 si->fmt.type = si->type; 287 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[ 0]);310 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[fmti]); 288 311 pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name); 289 312 si->fmt.clock_rate = rtpmap->clock_rate; … … 323 346 324 347 attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 325 &local_m->desc.fmt[ 0]);348 &local_m->desc.fmt[fmti]); 326 349 if (attr == NULL) 327 350 return PJMEDIA_EMISSINGRTPMAP; … … 334 357 335 358 si->fmt.type = si->type; 336 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[ 0]);359 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[fmti]); 337 360 pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name); 338 361 si->fmt.clock_rate = rtpmap->clock_rate; … … 357 380 358 381 /* Get fmtp mode= param in local SDP, if any */ 359 get_fmtp_mode(local_m, &local_m->desc.fmt[ 0], &local_fmtp_mode);382 get_fmtp_mode(local_m, &local_m->desc.fmt[fmti], &local_fmtp_mode); 360 383 361 384 /* Determine payload type for outgoing channel, by finding -
pjproject/branches/pjproject-0.5-stable/pjsip/src/pjsua-lib/pjsua_call.c
r974 r1107 690 690 pjsua_perror(THIS_FILE, "Error answering session", status); 691 691 692 /* Note that inv may be invalid if 200/OK has caused error in 693 * starting the media. 694 */ 692 695 693 696 PJ_LOG(4,(THIS_FILE, "Disconnecting replaced call %d", … … 1015 1018 pjsip_dlg_dec_lock(dlg); 1016 1019 return status; 1020 } 1021 1022 /* Call might have been disconnected if application is answering with 1023 * 200/OK and the media failed to start. 1024 */ 1025 if (call->inv == NULL) { 1026 pjsip_dlg_dec_lock(dlg); 1027 return PJSIP_ESESSIONTERMINATED; 1017 1028 } 1018 1029
Note: See TracChangeset
for help on using the changeset viewer.