mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
NULL-checks for DTLS activation.
This commit is contained in:
parent
695ad3d6e8
commit
1af008598f
2 changed files with 14 additions and 1 deletions
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue