From 92cc560b745a1853373a9cb2b6a07a06f82300b9 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 7 May 2015 17:04:46 -0400 Subject: [PATCH] don't shut down ICE agent on consecutive re-invites fixes #103 --- daemon/call.c | 4 +++- daemon/sdp.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 0d0d338b8..b66a174d1 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2432,10 +2432,12 @@ static void __rtp_payload_types(struct call_media *media, GQueue *types) { } static void __ice_start(struct call_media *media) { - if (!MEDIA_ISSET(media, ICE) || MEDIA_ISSET(media, PASSTHRU)) { + if (MEDIA_ISSET(media, PASSTHRU)) { ice_shutdown(&media->ice_agent); return; } + if (!MEDIA_ISSET(media, ICE)) /* don't init new ICE agent but leave it running if there is one */ + return; ice_agent_init(&media->ice_agent, media); } diff --git a/daemon/sdp.c b/daemon/sdp.c index 6ccc22649..64fb45a15 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2014,7 +2014,7 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu insert_crypto(call_media, chop); insert_dtls(call_media, chop); - if (call_media->ice_agent) { + if (MEDIA_ISSET(call_media, ICE)) { chopper_append_c(chop, "a=ice-ufrag:"); chopper_append_str(chop, &call_media->ice_agent->ufrag[1]); chopper_append_c(chop, "\r\na=ice-pwd:");