Use ICE selected pairs instead of nominated valid pairs.

This commit is contained in:
Ghislain MARY 2012-08-08 11:43:51 +02:00
parent dbb1253c6d
commit 3611187779
2 changed files with 4 additions and 3 deletions

View file

@ -1739,6 +1739,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
switch (ice_session_state(call->ice_session)) {
case IS_Completed:
if (ice_session_role(call->ice_session) == IR_Controlling) {
ice_session_select_candidates(call->ice_session);
linphone_core_update_call(call->core, call, &call->current_params);
}
break;

View file

@ -614,7 +614,7 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
if (session_state == IS_Completed) {
desc->ice_completed = TRUE;
ice_check_list_nominated_valid_local_candidate(ice_session_check_list(session, 0), &rtp_addr, NULL, NULL, NULL);
ice_check_list_selected_valid_local_candidate(ice_session_check_list(session, 0), &rtp_addr, NULL, NULL, NULL);
strncpy(desc->addr, rtp_addr, sizeof(desc->addr));
}
else {
@ -629,7 +629,7 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
if (cl == NULL) continue;
if (cl->state == ICL_Completed) {
stream->ice_completed = TRUE;
ice_check_list_nominated_valid_local_candidate(ice_session_check_list(session, i), &rtp_addr, &stream->rtp_port, &rtcp_addr, &stream->rtcp_port);
ice_check_list_selected_valid_local_candidate(ice_session_check_list(session, i), &rtp_addr, &stream->rtp_port, &rtcp_addr, &stream->rtcp_port);
strncpy(stream->rtp_addr, rtp_addr, sizeof(stream->rtp_addr));
strncpy(stream->rtcp_addr, rtcp_addr, sizeof(stream->rtcp_addr));
} else {
@ -678,7 +678,7 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
if ((cl->state == ICL_Completed) && (ice_session_role(session) == IR_Controlling)) {
int rtp_port, rtcp_port;
memset(stream->ice_remote_candidates, 0, sizeof(stream->ice_remote_candidates));
ice_check_list_nominated_valid_remote_candidate(cl, &rtp_addr, &rtp_port, &rtcp_addr, &rtcp_port);
ice_check_list_selected_valid_remote_candidate(cl, &rtp_addr, &rtp_port, &rtcp_addr, &rtcp_port);
strncpy(stream->ice_remote_candidates[0].addr, rtp_addr, sizeof(stream->ice_remote_candidates[0].addr));
stream->ice_remote_candidates[0].port = rtp_port;
strncpy(stream->ice_remote_candidates[1].addr, rtcp_addr, sizeof(stream->ice_remote_candidates[1].addr));