]> sjero.net Git - linphone/commitdiff
Update of ICE from remote media description may delete the ICE session, so check...
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Thu, 9 Aug 2012 12:47:20 +0000 (14:47 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Thu, 9 Aug 2012 12:47:20 +0000 (14:47 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c

index 4cd4a07347a864d54ff110a43a96c559859299b0..36ffc4f8190ad0f8c9fe029df7094cc71c89663c 100644 (file)
@@ -392,12 +392,14 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
                        call->ice_session = ice_session_new();
                        ice_session_set_role(call->ice_session, IR_Controlled);
                        linphone_core_update_ice_from_remote_media_description(call, sal_call_get_remote_media_description(op));
-                       linphone_call_init_media_streams(call);
-                       linphone_call_start_media_streams_for_ice_gathering(call);
-                       if (linphone_core_gather_ice_candidates(call->core,call)<0) {
-                               /* Ice candidates gathering failed, proceed with the call anyway. */
-                               linphone_call_delete_ice_session(call);
-                               linphone_call_stop_media_streams(call);
+                       if (call->ice_session != NULL) {
+                               linphone_call_init_media_streams(call);
+                               linphone_call_start_media_streams_for_ice_gathering(call);
+                               if (linphone_core_gather_ice_candidates(call->core,call)<0) {
+                                       /* Ice candidates gathering failed, proceed with the call anyway. */
+                                       linphone_call_delete_ice_session(call);
+                                       linphone_call_stop_media_streams(call);
+                               }
                        }
                        break;
                case LinphonePolicyUseStun:
index b8911702b68f7c56d9fc9f3ef9079a5bee44598e..3b8a274b7c6adff5ad3700b8cd18c0c00ed2395d 100644 (file)
@@ -2593,7 +2593,7 @@ int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const
        update_local_media_description(lc,call);
        if (call->ice_session != NULL) {
                linphone_core_update_ice_from_remote_media_description(call, sal_call_get_remote_media_description(call->op));
-               if (!ice_session_candidates_gathered(call->ice_session)) {
+               if ((call->ice_session != NULL) &&!ice_session_candidates_gathered(call->ice_session)) {
                        if ((call->params.has_video) && (call->params.has_video != old_has_video)) {
                                linphone_call_init_video_stream(call);
                                video_stream_prepare_video(call->videostream);