Changeset 1810 for pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
- Timestamp:
- Feb 21, 2008 10:08:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1790 r1810 25 25 #define THIS_FILE "transport_ice.c" 26 26 27 static const pj_str_t ID_RTP_AVP = { "RTP/AVP", 7 }; 28 27 29 struct transport_ice 28 30 { … … 30 32 pj_ice_strans *ice_st; 31 33 pjmedia_ice_cb cb; 34 unsigned media_option; 32 35 33 36 pj_time_val start_ice; … … 75 78 static pj_status_t transport_media_create(pjmedia_transport *tp, 76 79 pj_pool_t *pool, 80 unsigned options, 77 81 pjmedia_sdp_session *sdp_local, 78 82 const pjmedia_sdp_session *sdp_remote, … … 259 263 static pj_status_t transport_media_create(pjmedia_transport *tp, 260 264 pj_pool_t *pool, 265 unsigned options, 261 266 pjmedia_sdp_session *sdp_local, 262 267 const pjmedia_sdp_session *sdp_remote, … … 270 275 unsigned i, cand_cnt; 271 276 pj_status_t status; 277 278 tp_ice->media_option = options; 279 280 /* Validate media transport */ 281 /* By now, this transport only support RTP/AVP transport */ 282 if ((tp_ice->media_option & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { 283 pjmedia_sdp_media *m_rem, *m_loc; 284 285 m_rem = sdp_remote? sdp_remote->media[media_index] : NULL; 286 m_loc = sdp_local->media[media_index]; 287 288 if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP) || 289 (m_rem && pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP))) 290 { 291 pjmedia_sdp_media_deactivate(pool, m_loc); 292 return PJMEDIA_SDP_EINPROTO; 293 } 294 } 272 295 273 296 /* Init ICE */ … … 500 523 pj_status_t status; 501 524 502 PJ_UNUSED_ARG(sdp_local);503 504 525 PJ_ASSERT_RETURN(tp && pool && sdp_remote, PJ_EINVAL); 505 526 PJ_ASSERT_RETURN(media_index < sdp_remote->media_count, PJ_EINVAL); 506 527 507 528 sdp_med = sdp_remote->media[media_index]; 529 530 /* Validate media transport */ 531 /* By now, this transport only support RTP/AVP transport */ 532 if ((tp_ice->media_option & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { 533 pjmedia_sdp_media *m_rem, *m_loc; 534 535 m_rem = sdp_remote->media[media_index]; 536 m_loc = sdp_local->media[media_index]; 537 538 if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP) || 539 (pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP))) 540 { 541 pjmedia_sdp_media_deactivate(pool, m_loc); 542 return PJMEDIA_SDP_EINPROTO; 543 } 544 } 508 545 509 546 /* Get the SDP connection for the media stream.
Note: See TracChangeset
for help on using the changeset viewer.