[Pkg-voip-commits] [janus] 131/282: Notify hangup to users only when janus_ice_webrtc_free is called.

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.

commit e2b19e26d4c042e0c1c64ac10e99472f3b776ad7
Author: Alessandro Toppi <atoppi at meetecho.com>
Date:   Mon Oct 16 14:47:01 2017 +0200

    Notify hangup to users only when janus_ice_webrtc_free is called.
---
 ice.c | 7 ++++++-
 ice.h | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ice.c b/ice.c
index 375a43f..330e7a8 100644
--- a/ice.c
+++ b/ice.c
@@ -1214,7 +1214,8 @@ void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason) {
 			handle->handle_id, reason, plugin->get_name());
 		if(plugin && plugin->hangup_media)
 			plugin->hangup_media(handle->app_handle);
-		janus_ice_notify_hangup(handle, reason);
+		//janus_ice_notify_hangup(handle, reason);
+		handle->hangup_reason=reason;
 	}
 	if(handle->queued_packets != NULL)
 		g_async_queue_push_front(handle->queued_packets, &janus_ice_dtls_alert);
@@ -1312,6 +1313,10 @@ void janus_ice_webrtc_free(janus_ice_handle *handle) {
 	}
 	janus_flags_clear(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_CLEANING);
 	janus_flags_clear(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_HAS_AGENT);
+	if (!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_STOP) && handle->hangup_reason) {
+		janus_ice_notify_hangup(handle,handle->hangup_reason);
+	}
+	handle->hangup_reason = NULL;
 	janus_mutex_unlock(&handle->mutex);
 	JANUS_LOG(LOG_INFO, "[%"SCNu64"] WebRTC resources freed\n", handle->handle_id);
 }
diff --git a/ice.h b/ice.h
index 0a0f7ec..a40b567 100644
--- a/ice.h
+++ b/ice.h
@@ -324,6 +324,8 @@ struct janus_ice_handle {
 	gchar *local_sdp;
 	/*! \brief SDP received by the peer (just for debugging purposes) */
 	gchar *remote_sdp;
+	/*! \brief Reason this handle has been hung up*/
+	const gchar *hangup_reason;
 	/*! \brief List of pending trickle candidates (those we received before getting the JSEP offer) */
 	GList *pending_trickles;
 	/*! \brief Queue of outgoing packets to send */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list