Fix bug 0002495: ICE restart doesn't work as expected.

A change in ICE credentials in the SDP detects an ICE restart and triggers stream reconstruction.
This commit is contained in:
Ghislain MARY 2015-09-28 17:04:51 +02:00
parent c1fbdd220d
commit 04185679c7
4 changed files with 12 additions and 6 deletions

View file

@ -141,6 +141,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
if ((md_changed & ( SAL_MEDIA_DESCRIPTION_CODEC_CHANGED
|SAL_MEDIA_DESCRIPTION_STREAMS_CHANGED
|SAL_MEDIA_DESCRIPTION_NETWORK_XXXCAST_CHANGED
|SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED
|SAL_MEDIA_DESCRIPTION_FORCE_STREAM_RECONSTRUCTION ))){
ms_message("Media descriptions are different, need to restart the streams.");
} else if ( call->playing_ringbacktone) {

View file

@ -325,6 +325,10 @@ int sal_stream_description_equals(const SalStreamDescription *sd1, const SalStre
if (sd1->ptime != sd2->ptime) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
if (sd1->dir != sd2->dir) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
/* ICE */
if (sd1->ice_ufrag != sd2->ice_ufrag) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED;
if (sd1->ice_pwd != sd2->ice_pwd) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED;
/*DTLS*/
if (sd1->dtls_role != sd2->dtls_role) result |= SAL_MEDIA_DESCRIPTION_CRYPTO_KEYS_CHANGED;
if (strcmp(sd1->dtls_fingerprint, sd2->dtls_fingerprint) != 0) result |= SAL_MEDIA_DESCRIPTION_CRYPTO_KEYS_CHANGED;
@ -341,6 +345,11 @@ int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaD
result |= SAL_MEDIA_DESCRIPTION_NETWORK_XXXCAST_CHANGED;
if (md1->nb_streams != md2->nb_streams) result |= SAL_MEDIA_DESCRIPTION_STREAMS_CHANGED;
if (md1->bandwidth != md2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
/* ICE */
if (md1->ice_ufrag != md2->ice_ufrag) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED;
if (md1->ice_pwd != md2->ice_pwd) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED;
for(i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){
if (!sal_stream_description_active(&md1->streams[i]) && !sal_stream_description_active(&md2->streams[i])) continue;
result |= sal_stream_description_equals(&md1->streams[i], &md2->streams[i]);

View file

@ -76,6 +76,7 @@ typedef enum {
#define SAL_MEDIA_DESCRIPTION_STREAMS_CHANGED (1<<4)
#define SAL_MEDIA_DESCRIPTION_NETWORK_XXXCAST_CHANGED (1<<5) /* use to notify when switching from multicast to unicast*/
#define SAL_MEDIA_DESCRIPTION_FORCE_STREAM_RECONSTRUCTION (1<<6) /* use force graph reconstruction*/
#define SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED (1<<7)

View file

@ -4783,11 +4783,9 @@ static void call_with_network_switch(void){
_call_with_network_switch(FALSE);
}
#if 0
static void call_with_network_switch_and_ice(void){
_call_with_network_switch(TRUE);
}
#endif
#ifdef CALL_LOGS_STORAGE_ENABLED
@ -5105,11 +5103,8 @@ test_t call_tests[] = {
{ "Call with custom RTP Modifier", call_with_custom_rtp_modifier },
{ "Call paused resumed with custom RTP Modifier", call_paused_resumed_with_custom_rtp_modifier },
{ "Call record with custom RTP Modifier", call_record_with_custom_rtp_modifier },
{ "Call with network switch", call_with_network_switch }
#if 0
,
{ "Call with network switch", call_with_network_switch },
{ "Call with network switch and ICE", call_with_network_switch_and_ice }
#endif
};
test_suite_t call_test_suite = {"Single Call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,