diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index fa29096b7..909e376dd 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -147,8 +147,10 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia /* we already started media: check if we really need to restart it*/ if (oldmd){ int md_changed = media_parameters_changed(call, oldmd, new_md); - if ((md_changed & SAL_MEDIA_DESCRIPTION_CODEC_CHANGED) || call->playing_ringbacktone) { + if ((md_changed & SAL_MEDIA_DESCRIPTION_CODEC_CHANGED)){ ms_message("Media descriptions are different, need to restart the streams."); + } else if ( call->playing_ringbacktone) { + ms_message("Playing ringback tone, will restart the streams."); } else { if (md_changed == SAL_MEDIA_DESCRIPTION_UNCHANGED) { if (call->all_muted){ diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 83fca175b..6747c5ec3 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2350,6 +2350,11 @@ void static start_dtls( MSMediaStreamSessions *sessions, const SalStreamDescrip void static start_dtls_on_all_streams(LinphoneCall *call) { SalMediaDescription *remote_desc = sal_call_get_remote_media_description(call->op); SalMediaDescription *result_desc = sal_call_get_final_media_description(call->op); + if( remote_desc == NULL || result_desc == NULL ){ + ms_warning("Invalid remote or result media description, disabling DTLS"); + return; + } + if (call->audiostream && (media_stream_get_state((const MediaStream *)call->audiostream) == MSStreamStarted))/*dtls must start at the end of ice*/ start_dtls(&call->audiostream->ms.sessions ,sal_media_description_find_best_stream(result_desc,SalAudio) @@ -2379,6 +2384,12 @@ void static set_dtls_fingerprint( MSMediaStreamSessions *sessions, const SalStr void static set_dtls_fingerprint_on_all_streams(LinphoneCall *call) { SalMediaDescription *remote_desc = sal_call_get_remote_media_description(call->op); SalMediaDescription *result_desc = sal_call_get_final_media_description(call->op); + + if( remote_desc == NULL || result_desc == NULL ){ + ms_warning("Invalid remote or final media desc, aborting DTLS fingerprinting"); + return; + } + if (call->audiostream && (media_stream_get_state((const MediaStream *)call->audiostream) == MSStreamStarted))/*dtls must start at the end of ice*/ set_dtls_fingerprint(&call->audiostream->ms.sessions ,sal_media_description_find_best_stream(result_desc,SalAudio)