Changeset 1114 for pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
- Timestamp:
- Mar 29, 2007 9:54:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1112 r1114 25 25 { 26 26 pjmedia_transport base; 27 pj_ice_strans 27 pj_ice_strans *ice_st; 28 28 29 29 pj_time_val start_ice; … … 409 409 pj_ice_sess_cand cand[PJ_ICE_MAX_CAND]; 410 410 const pjmedia_sdp_media *sdp_med; 411 pj_bool_t remote_is_lite = PJ_FALSE; 412 const pj_str_t STR_CANDIDATE = {"candidate", 9}; 413 const pj_str_t STR_ICE_LITE = {"ice-lite", 8}; 411 414 pj_str_t uname, pass; 412 415 pj_status_t status; … … 445 448 pass = attr->value; 446 449 447 /* Get all candidates */450 /* Get all candidates in the media */ 448 451 cand_cnt = 0; 449 452 for (i=0; i<sdp_med->attr_count; ++i) { … … 451 454 452 455 attr = sdp_med->attr[i]; 453 if (pj_strcmp2(&attr->name, "candidate")!=0) 456 457 if (pj_strcmp(&attr->name, &STR_ICE_LITE)==0) 458 remote_is_lite = PJ_TRUE; 459 460 if (pj_strcmp(&attr->name, &STR_CANDIDATE)!=0) 454 461 continue; 455 462 … … 463 470 /* Mark start time */ 464 471 pj_gettimeofday(&tp_ice->start_ice); 472 473 /* If our role was controlled but it turns out that remote is 474 * a lite implementation, change our role to controlling. 475 */ 476 if (remote_is_lite && 477 tp_ice->ice_st->ice->role == PJ_ICE_SESS_ROLE_CONTROLLED) 478 { 479 pj_ice_sess_change_role(tp_ice->ice_st->ice, 480 PJ_ICE_SESS_ROLE_CONTROLLING); 481 } 465 482 466 483 /* Start ICE */ … … 553 570 struct transport_ice *tp_ice = (struct transport_ice*)tp; 554 571 return pj_ice_strans_sendto(tp_ice->ice_st, 1, 555 pkt, size, &tp_ice->remote_rtp,556 572 pkt, size, &tp_ice->remote_rtp, 573 sizeof(pj_sockaddr_in)); 557 574 } 558 575 … … 565 582 if (tp_ice->ice_st->comp_cnt > 1) { 566 583 return pj_ice_strans_sendto(tp_ice->ice_st, 2, 567 pkt, size, &tp_ice->remote_rtp,568 sizeof(pj_sockaddr_in));584 pkt, size, &tp_ice->remote_rtp, 585 sizeof(pj_sockaddr_in)); 569 586 } else { 570 587 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.