]> sjero.net Git - linphone/commitdiff
Do not delete ICE session when it is in the Failed state.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Thu, 23 Aug 2012 07:57:10 +0000 (09:57 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Fri, 24 Aug 2012 08:57:05 +0000 (10:57 +0200)
If the ICE session is deleted it can not be restarted later.
However try to send a re-invite if the session state is Failed but some check
lists have completed successfully.

coreapi/linphonecall.c
coreapi/misc.c

index 340f02cc30a6b045b1f143b45cfb059eb69d8945..4ffb699b2648db4f100a1f2cf8e3d7bce38e1887 100644 (file)
@@ -1718,7 +1718,13 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
                                }
                                break;
                        case IS_Failed:
-                               linphone_call_delete_ice_session(call);
+                               if (ice_session_has_completed_check_list(call->ice_session) == TRUE) {
+                                       if (ice_session_role(call->ice_session) == IR_Controlling) {
+                                               /* At least one ICE session has succeeded, so perform a call update. */
+                                               ice_session_select_candidates(call->ice_session);
+                                               linphone_core_update_call(call->core, call, &call->current_params);
+                                       }
+                               }
                                break;
                        default:
                                break;
index e5aa6ec2cf6d5ece0806ece91a0b98969000cc81..3f48b419bc585ffad00438da77b78d82ffeb2e95 100644 (file)
@@ -808,7 +808,7 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call,
                }
                ice_session_check_mismatch(call->ice_session);
        }
-       if ((ice_session_state(call->ice_session) == IS_Failed) || (ice_session_nb_check_lists(call->ice_session) == 0)) {
+       if (ice_session_nb_check_lists(call->ice_session) == 0) {
                linphone_call_delete_ice_session(call);
        }
 }