[Pkg-voip-commits] [janus] 03/06: Add bugfix patches cherry-picked upsteam - superceding patch 2002.

Jonas Smedegaard dr at jones.dk
Sat Mar 25 13:10:39 UTC 2017


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

js pushed a commit to branch master
in repository janus.

commit 54585b5e442d5c386efab0ca5e97202f7b5b6d63
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Sat Mar 25 12:43:48 2017 +0100

    Add bugfix patches cherry-picked upsteam - superceding patch 2002.
---
 debian/patches/020170308~462023e.patch         |  23 +++
 debian/patches/020170309~3d11cb0.patch         | 235 ++++++++++++++++++++++++
 debian/patches/020170309~f13d55d.patch         |  16 ++
 debian/patches/020170310~70043a5.patch         |  27 +++
 debian/patches/020170313headers1~7fc815c.patch |  32 ++++
 debian/patches/020170313headers2~ba16db3.patch |  19 ++
 debian/patches/020170313headers3~3a9a43f.patch |  17 ++
 debian/patches/020170313~1fa9d73.patch         |  18 ++
 debian/patches/020170313~2a6903c.patch         |  33 ++++
 debian/patches/020170313~d7bfb68.patch         |  19 ++
 debian/patches/020170314~d905174.patch         |  17 ++
 debian/patches/020170315~67b1d5a.patch         |  24 +++
 debian/patches/020170315~6dfa794.patch         |  44 +++++
 debian/patches/020170315~a83f3cd.patch         |  55 ++++++
 debian/patches/020170315~f947fbe.patch         |  42 +++++
 debian/patches/020170315~fc72d3a.patch         | 108 +++++++++++
 debian/patches/020170317~5b868e3.patch         |  17 ++
 debian/patches/020170317~7f82f31.patch         |  41 +++++
 debian/patches/020170317~81d6156.patch         |  48 +++++
 debian/patches/020170317~9380393.patch         | 242 +++++++++++++++++++++++++
 debian/patches/020170318~dbd48d7.patch         |  17 ++
 debian/patches/020170320~cdd6c44.patch         |  64 +++++++
 debian/patches/020170321~fcec9a1.patch         |  39 ++++
 debian/patches/020170324~938e723.patch         |  25 +++
 debian/patches/020170324~9df683d.patch         |  18 ++
 debian/patches/2002_avoid_tmp.patch            | 228 -----------------------
 debian/patches/series                          |  26 ++-
 27 files changed, 1265 insertions(+), 229 deletions(-)

diff --git a/debian/patches/020170308~462023e.patch b/debian/patches/020170308~462023e.patch
new file mode 100644
index 0000000..907eb6a
--- /dev/null
+++ b/debian/patches/020170308~462023e.patch
@@ -0,0 +1,23 @@
+Description: Make sure reply is initialised (TextRoom plugin)
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/462023e
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_textroom.c
++++ b/plugins/janus_textroom.c
+@@ -816,13 +816,13 @@
+ 		error_code, error_cause, TRUE,
+ 		JANUS_TEXTROOM_ERROR_MISSING_ELEMENT, JANUS_TEXTROOM_ERROR_INVALID_ELEMENT);
+ 	const char *transaction_text = NULL;
++	json_t *reply = NULL;
+ 	if(error_code != 0)
+ 		goto msg_response;
+ 	json_t *request = json_object_get(root, "textroom");
+ 	json_t *transaction = json_object_get(root, "transaction");
+ 	const char *request_text = json_string_value(request);
+ 	transaction_text = json_string_value(transaction);
+-	json_t *reply = NULL;
+ 	if(!strcasecmp(request_text, "message")) {
+ 		JANUS_VALIDATE_JSON_OBJECT(root, message_parameters,
+ 			error_code, error_cause, TRUE,
diff --git a/debian/patches/020170309~3d11cb0.patch b/debian/patches/020170309~3d11cb0.patch
new file mode 100644
index 0000000..8621f0d
--- /dev/null
+++ b/debian/patches/020170309~3d11cb0.patch
@@ -0,0 +1,235 @@
+Description: Make SRTP errors way less spammy (unless debug=7 is used)
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/3d11cb0
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/ice.c
++++ b/ice.c
+@@ -2650,6 +2650,8 @@
+ #endif
+ 		NULL);
+ 	handle->agent_created = janus_get_monotonic_time();
++	handle->srtp_errors_count = 0;
++	handle->last_srtp_error = 0;
+ 	/* Any STUN server to use? */
+ 	if(janus_stun_server != NULL && janus_stun_port > 0) {
+ 		g_object_set(G_OBJECT(handle->agent),
+@@ -2784,6 +2786,7 @@
+ 		audio_stream->audio_rtcp_ctx->tb = 48000;	/* May change later */
+ 		audio_stream->video_rtcp_ctx = g_malloc0(sizeof(rtcp_context));
+ 		audio_stream->video_rtcp_ctx->tb = 90000;
++		audio_stream->noerrorlog = FALSE;
+ 		janus_mutex_init(&audio_stream->mutex);
+ 		audio_stream->components = g_hash_table_new(NULL, NULL);
+ 		g_hash_table_insert(handle->streams, GUINT_TO_POINTER(handle->audio_id), audio_stream);
+@@ -2937,6 +2940,7 @@
+ 		video_stream->video_rtcp_ctx = g_malloc0(sizeof(rtcp_context));
+ 		video_stream->video_rtcp_ctx->tb = 90000;
+ 		video_stream->components = g_hash_table_new(NULL, NULL);
++		video_stream->noerrorlog = FALSE;
+ 		janus_mutex_init(&video_stream->mutex);
+ 		g_hash_table_insert(handle->streams, GUINT_TO_POINTER(handle->video_id), video_stream);
+ 		if(!have_turnrest_credentials) {
+@@ -3115,6 +3119,7 @@
+ 		/* FIXME By default, if we're being called we're DTLS clients, but this may be changed by ICE... */
+ 		data_stream->dtls_role = offer ? JANUS_DTLS_ROLE_CLIENT : JANUS_DTLS_ROLE_ACTPASS;
+ 		data_stream->components = g_hash_table_new(NULL, NULL);
++		data_stream->noerrorlog = FALSE;
+ 		janus_mutex_init(&data_stream->mutex);
+ 		g_hash_table_insert(handle->streams, GUINT_TO_POINTER(handle->data_id), data_stream);
+ 		handle->data_stream = data_stream;
+@@ -3166,7 +3171,7 @@
+ 	gint64 before = janus_get_monotonic_time(),
+ 		audio_rtcp_last_rr = before, audio_rtcp_last_sr = before, audio_last_event = before,
+ 		video_rtcp_last_rr = before, video_rtcp_last_sr = before, video_last_event = before,
+-		last_nack_cleanup = before;
++		last_srtp_summary = before, last_nack_cleanup = before;
+ 	while(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT)) {
+ 		if(handle->queued_packets != NULL) {
+ 			pkt = g_async_queue_timeout_pop(handle->queued_packets, 500000);
+@@ -3385,6 +3390,16 @@
+ 			janus_cleanup_nack_buffer(now, handle->video_stream);
+ 			last_nack_cleanup = now;
+ 		}
++		/* Check if we should also print a summary of SRTP-related errors */
++		if(now-last_srtp_summary >= (2*G_USEC_PER_SEC)) {
++			if(handle->srtp_errors_count > 0) {
++				JANUS_LOG(LOG_ERR, "[%"SCNu64"] Got %d SRTP/SRTCP errors in the last few seconds (last error: %s)\n",
++					handle->handle_id, handle->srtp_errors_count, janus_srtp_error_str(handle->last_srtp_error));
++				handle->srtp_errors_count = 0;
++				handle->last_srtp_error = 0;
++			}
++			last_srtp_summary = now;
++		}
+ 
+ 		/* Now let's get on with the packets */
+ 		if(pkt == NULL) {
+@@ -3444,7 +3459,7 @@
+ 			if(!stream->cdone) {
+ 				if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !stream->noerrorlog) {
+ 					JANUS_LOG(LOG_ERR, "[%"SCNu64"]     %s candidates not gathered yet for stream??\n", handle->handle_id, video ? "video" : "audio");
+-					stream->noerrorlog = 1;	/* Don't flood with the same error all over again */
++					stream->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 				}
+ 				g_free(pkt->data);
+ 				pkt->data = NULL;
+@@ -3452,11 +3467,11 @@
+ 				pkt = NULL;
+ 				continue;
+ 			}
+-			stream->noerrorlog = 0;
++			stream->noerrorlog = FALSE;
+ 			if(!component->dtls || !component->dtls->srtp_valid || !component->dtls->srtp_out) {
+ 				if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !component->noerrorlog) {
+ 					JANUS_LOG(LOG_WARN, "[%"SCNu64"]     %s stream (#%u) component has no valid SRTP session (yet?)\n", handle->handle_id, video ? "video" : "audio", stream->stream_id);
+-					component->noerrorlog = 1;	/* Don't flood with the same error all over again */
++					component->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 				}
+ 				g_free(pkt->data);
+ 				pkt->data = NULL;
+@@ -3464,7 +3479,7 @@
+ 				pkt = NULL;
+ 				continue;
+ 			}
+-			component->noerrorlog = 0;
++			component->noerrorlog = FALSE;
+ 			if(pkt->encrypted) {
+ 				/* Already SRTCP */
+ 				int sent = nice_agent_send(handle->agent, stream->stream_id, component->component_id, pkt->length, (const gchar *)pkt->data);
+@@ -3523,13 +3538,14 @@
+ 					res = srtp_protect_rtcp(component->dtls->srtp_out, sbuf, &protected);
+ 					janus_mutex_unlock(&component->dtls->srtp_mutex);
+ 				}
+-				//~ JANUS_LOG(LOG_VERB, "[%"SCNu64"] ... SRTCP protect %s (len=%d-->%d)...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected);
+ 				if(res != srtp_err_status_ok) {
+-					JANUS_LOG(LOG_ERR, "[%"SCNu64"] ... SRTCP protect error... %s (len=%d-->%d)...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected);
++					/* We don't spam the logs for every SRTP error: just take note of this, and print a summary later */
++					handle->srtp_errors_count++;
++					handle->last_srtp_error = res;
++					/* If we're debugging, though, print every occurrence */
++					JANUS_LOG(LOG_DBG, "[%"SCNu64"] ... SRTCP protect error... %s (len=%d-->%d)...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected);
+ 				} else {
+ 					/* Shoot! */
+-					//~ JANUS_LOG(LOG_VERB, "[%"SCNu64"] ... Sending SRTCP packet (pt=%u, seq=%u, ts=%u)...\n", handle->handle_id,
+-						//~ header->paytype, ntohs(header->seq_number), ntohl(header->timestamp));
+ 					int sent = nice_agent_send(handle->agent, stream->stream_id, component->component_id, protected, sbuf);
+ 					if(sent < protected) {
+ 						JANUS_LOG(LOG_ERR, "[%"SCNu64"] ... only sent %d bytes? (was %d)\n", handle->handle_id, sent, protected);
+@@ -3563,7 +3579,7 @@
+ 				if(!stream->cdone) {
+ 					if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !stream->noerrorlog) {
+ 						JANUS_LOG(LOG_ERR, "[%"SCNu64"]     %s candidates not gathered yet for stream??\n", handle->handle_id, video ? "video" : "audio");
+-						stream->noerrorlog = 1;	/* Don't flood with the same error all over again */
++						stream->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 					}
+ 					g_free(pkt->data);
+ 					pkt->data = NULL;
+@@ -3571,11 +3587,11 @@
+ 					pkt = NULL;
+ 					continue;
+ 				}
+-				stream->noerrorlog = 0;
++				stream->noerrorlog = FALSE;
+ 				if(!component->dtls || !component->dtls->srtp_valid || !component->dtls->srtp_out) {
+ 					if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !component->noerrorlog) {
+ 						JANUS_LOG(LOG_WARN, "[%"SCNu64"]     %s stream component has no valid SRTP session (yet?)\n", handle->handle_id, video ? "video" : "audio");
+-						component->noerrorlog = 1;	/* Don't flood with the same error all over again */
++						component->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 					}
+ 					g_free(pkt->data);
+ 					pkt->data = NULL;
+@@ -3583,7 +3599,7 @@
+ 					pkt = NULL;
+ 					continue;
+ 				}
+-				component->noerrorlog = 0;
++				component->noerrorlog = FALSE;
+ 				if(pkt->encrypted) {
+ 					/* Already RTP (probably a retransmission?) */
+ 					rtp_header *header = (rtp_header *)pkt->data;
+@@ -3603,16 +3619,17 @@
+ 					}
+ 					int protected = pkt->length;
+ 					int res = srtp_protect(component->dtls->srtp_out, sbuf, &protected);
+-					//~ JANUS_LOG(LOG_VERB, "[%"SCNu64"] ... SRTP protect %s (len=%d-->%d)...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected);
+ 					if(res != srtp_err_status_ok) {
++						/* We don't spam the logs for every SRTP error: just take note of this, and print a summary later */
++						handle->srtp_errors_count++;
++						handle->last_srtp_error = res;
++						/* If we're debugging, though, print every occurrence */
+ 						rtp_header *header = (rtp_header *)sbuf;
+ 						guint32 timestamp = ntohl(header->timestamp);
+ 						guint16 seq = ntohs(header->seq_number);
+-						JANUS_LOG(LOG_ERR, "[%"SCNu64"] ... SRTP protect error... %s (len=%d-->%d, ts=%"SCNu32", seq=%"SCNu16")...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected, timestamp, seq);
++						JANUS_LOG(LOG_DBG, "[%"SCNu64"] ... SRTP protect error... %s (len=%d-->%d, ts=%"SCNu32", seq=%"SCNu16")...\n", handle->handle_id, janus_srtp_error_str(res), pkt->length, protected, timestamp, seq);
+ 					} else {
+ 						/* Shoot! */
+-						//~ JANUS_LOG(LOG_VERB, "[%"SCNu64"] ... Sending SRTP packet (pt=%u, ssrc=%u, seq=%u, ts=%u)...\n", handle->handle_id,
+-							//~ header->type, ntohl(header->ssrc), ntohs(header->seq_number), ntohl(header->timestamp));
+ 						int sent = nice_agent_send(handle->agent, stream->stream_id, component->component_id, protected, sbuf);
+ 						if(sent < protected) {
+ 							JANUS_LOG(LOG_ERR, "[%"SCNu64"] ... only sent %d bytes? (was %d)\n", handle->handle_id, sent, protected);
+@@ -3680,7 +3697,7 @@
+ 				if(!stream->cdone) {
+ 					if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !stream->noerrorlog) {
+ 						JANUS_LOG(LOG_ERR, "[%"SCNu64"]     SCTP candidates not gathered yet for stream??\n", handle->handle_id);
+-						stream->noerrorlog = 1;	/* Don't flood with the same error all over again */
++						stream->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 					}
+ 					g_free(pkt->data);
+ 					pkt->data = NULL;
+@@ -3688,11 +3705,11 @@
+ 					pkt = NULL;
+ 					continue;
+ 				}
+-				stream->noerrorlog = 0;
++				stream->noerrorlog = FALSE;
+ 				if(!component->dtls) {
+ 					if(!janus_flags_is_set(&handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_ALERT) && !component->noerrorlog) {
+ 						JANUS_LOG(LOG_WARN, "[%"SCNu64"]     SCTP stream component has no valid DTLS session (yet?)\n", handle->handle_id);
+-						component->noerrorlog = 1;	/* Don't flood with the same error all over again */
++						component->noerrorlog = TRUE;	/* Don't flood with the same error all over again */
+ 					}
+ 					g_free(pkt->data);
+ 					pkt->data = NULL;
+@@ -3700,7 +3717,7 @@
+ 					pkt = NULL;
+ 					continue;
+ 				}
+-				component->noerrorlog = 0;
++				component->noerrorlog = FALSE;
+ 				janus_dtls_wrap_sctp_data(component->dtls, pkt->data, pkt->length);
+ #endif
+ 			}
+--- a/ice.h
++++ b/ice.h
+@@ -320,6 +320,10 @@
+ 	GThread *send_thread;
+ 	/*! \brief Atomic flag to make sure we only create the thread once */
+ 	volatile gint send_thread_created;
++	/*! \brief Count of the recent SRTP replay errors, in order to avoid spamming the logs */
++	guint srtp_errors_count;
++	/*! \brief Count of the recent SRTP replay errors, in order to avoid spamming the logs */
++	gint last_srtp_error;
+ 	/*! \brief Mutex to lock/unlock the ICE session */
+ 	janus_mutex mutex;
+ };
+@@ -375,7 +379,7 @@
+ 	/*! \brief RTCP component */
+ 	janus_ice_component *rtcp_component;
+ 	/*! \brief Helper flag to avoid flooding the console with the same error all over again */
+-	gint noerrorlog:1;
++	gboolean noerrorlog;
+ 	/*! \brief Mutex to lock/unlock this stream */
+ 	janus_mutex mutex;
+ };
+@@ -426,7 +430,7 @@
+ 	/*! \brief Stats for outgoing data (audio/video/data) */
+ 	janus_ice_stats out_stats;
+ 	/*! \brief Helper flag to avoid flooding the console with the same error all over again */
+-	gint noerrorlog:1;
++	gboolean noerrorlog;
+ 	/*! \brief Mutex to lock/unlock this component */
+ 	janus_mutex mutex;
+ };
diff --git a/debian/patches/020170309~f13d55d.patch b/debian/patches/020170309~f13d55d.patch
new file mode 100644
index 0000000..15acfff
--- /dev/null
+++ b/debian/patches/020170309~f13d55d.patch
@@ -0,0 +1,16 @@
+Description: Removed leak in AudioBridge plugin
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/f13d55d
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_audiobridge.c
++++ b/plugins/janus_audiobridge.c
+@@ -3282,6 +3282,7 @@
+ 			JANUS_LOG(LOG_VERB, "  >> Pushing event: %d (took %"SCNu64" us)\n", res, janus_get_monotonic_time()-start);
+ 			json_decref(event);
+ 			json_decref(jsep);
++			g_free(sdp);
+ 			if(res != JANUS_OK) {
+ 				/* TODO Failed to negotiate? We should remove this participant */
+ 			} else {
diff --git a/debian/patches/020170310~70043a5.patch b/debian/patches/020170310~70043a5.patch
new file mode 100644
index 0000000..33af318
--- /dev/null
+++ b/debian/patches/020170310~70043a5.patch
@@ -0,0 +1,27 @@
+Description:.Fix missing directory (full path) when renaming from temp extension
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/70043a5
+Author: Neil Kinnish <hello at neilkinnish.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/record.c
++++ b/record.c
+@@ -248,8 +248,16 @@
+ 		/* We need to rename the file, to remove the temporary extension */
+ 		char newname[1024];
+ 		memset(newname, 0, 1024);
+-		g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s", recorder->filename);
+-		if(rename(recorder->filename, newname) != 0) {
++		char tmpname[1024];
++		memset(tmpname, 0, 1024);
++		if(recorder->dir) {
++			g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s/%s", recorder->dir, recorder->filename);
++			g_snprintf(tmpname, strlen(recorder->filename), "%s/%s", recorder->dir, recorder->filename);
++		}else{
++			g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s", recorder->filename);
++			g_snprintf(tmpname, strlen(recorder->filename), "%s", recorder->filename);
++		}
++		if(rename(tmpname, newname) != 0) {
+ 			JANUS_LOG(LOG_ERR, "Error renaming %s to %s...\n", recorder->filename, newname);
+ 		} else {
+ 			JANUS_LOG(LOG_INFO, "Recording renamed: %s\n", newname);
diff --git a/debian/patches/020170313headers1~7fc815c.patch b/debian/patches/020170313headers1~7fc815c.patch
new file mode 100644
index 0000000..24f942f
--- /dev/null
+++ b/debian/patches/020170313headers1~7fc815c.patch
@@ -0,0 +1,32 @@
+Description:.Install only headers needed by third party components (plugins)
+ Also, add proper subdirectories for API headers (plugins, transports, events).
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/811
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -28,10 +28,17 @@
+ bin_PROGRAMS = janus
+ 
+ headerdir = $(includedir)/janus
+-header_HEADERS = \
+-	plugins/plugin.h transports/transport.h events/eventhandler.h \
+-	apierror.h config.h debug.h dtls.h events.h janus.h ice.h mutex.h \
+-	record.h rtcp.h rtp.h sctp.h sdp.h sdp-utils.h turnrest.h utils.h log.h
++header_HEADERS = log.h debug.h mutex.h record.h rtcp.h rtp.h \
++	sdp-utils.h ip-utils.h utils.h
++
++pluginsheaderdir = $(includedir)/janus/plugins
++pluginsheader_HEADERS = plugins/plugin.h
++
++transportsheaderdir = $(includedir)/janus/transports
++transportsheader_HEADERS = transports/transport.h
++
++eventsheaderdir = $(includedir)/janus/events
++eventsheader_HEADERS = events/eventhandler.h
+ 
+ confdir = $(sysconfdir)/janus
+ conf_DATA = conf/janus.cfg.sample
diff --git a/debian/patches/020170313headers2~ba16db3.patch b/debian/patches/020170313headers2~ba16db3.patch
new file mode 100644
index 0000000..deaad7c
--- /dev/null
+++ b/debian/patches/020170313headers2~ba16db3.patch
@@ -0,0 +1,19 @@
+Description:.Make sure apierror.h is installed with the headers
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/ba16db3
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -28,8 +28,8 @@
+ bin_PROGRAMS = janus
+ 
+ headerdir = $(includedir)/janus
+-header_HEADERS = log.h debug.h mutex.h record.h rtcp.h rtp.h \
+-	sdp-utils.h ip-utils.h utils.h
++header_HEADERS = apierror.h log.h debug.h mutex.h record.h \
++	rtcp.h rtp.h sdp-utils.h ip-utils.h utils.h
+ 
+ pluginsheaderdir = $(includedir)/janus/plugins
+ pluginsheader_HEADERS = plugins/plugin.h
diff --git a/debian/patches/020170313headers3~3a9a43f.patch b/debian/patches/020170313headers3~3a9a43f.patch
new file mode 100644
index 0000000..1799b1a
--- /dev/null
+++ b/debian/patches/020170313headers3~3a9a43f.patch
@@ -0,0 +1,17 @@
+Description:.Make sure config.h is installed with the headers
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/3a9a43f
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -28,7 +28,7 @@
+ bin_PROGRAMS = janus
+ 
+ headerdir = $(includedir)/janus
+-header_HEADERS = apierror.h log.h debug.h mutex.h record.h \
++header_HEADERS = apierror.h config.h log.h debug.h mutex.h record.h \
+ 	rtcp.h rtp.h sdp-utils.h ip-utils.h utils.h
+ 
+ pluginsheaderdir = $(includedir)/janus/plugins
diff --git a/debian/patches/020170313~1fa9d73.patch b/debian/patches/020170313~1fa9d73.patch
new file mode 100644
index 0000000..f26f69b
--- /dev/null
+++ b/debian/patches/020170313~1fa9d73.patch
@@ -0,0 +1,18 @@
+Description:.Fix typo
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/1fa9d73
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/810
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/record.c
++++ b/record.c
+@@ -257,7 +257,7 @@
+ 			g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s", recorder->filename);
+ 			g_snprintf(tmpname, strlen(recorder->filename), "%s", recorder->filename);
+ 		}
+-		if(rename(tmpname, newname) != 0) {
++		if(rename(oldpath, newpath) != 0) {
+ 			JANUS_LOG(LOG_ERR, "Error renaming %s to %s...\n", recorder->filename, newname);
+ 		} else {
+ 			JANUS_LOG(LOG_INFO, "Recording renamed: %s\n", newname);
diff --git a/debian/patches/020170313~2a6903c.patch b/debian/patches/020170313~2a6903c.patch
new file mode 100644
index 0000000..fef4ee6
--- /dev/null
+++ b/debian/patches/020170313~2a6903c.patch
@@ -0,0 +1,33 @@
+Description:.Fix issues around original commit
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/2a6903c
+Author: Neil Kinnish <hello at neilkinnish.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/record.c
++++ b/record.c
+@@ -248,14 +248,17 @@
+ 		/* We need to rename the file, to remove the temporary extension */
+ 		char newname[1024];
+ 		memset(newname, 0, 1024);
+-		char tmpname[1024];
+-		memset(tmpname, 0, 1024);
++		g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s", recorder->filename);
++		char oldpath[1024];
++		memset(oldpath, 0, 1024);
++		char newpath[1024];
++		memset(newpath, 0, 1024);
+ 		if(recorder->dir) {
+-			g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s/%s", recorder->dir, recorder->filename);
+-			g_snprintf(tmpname, strlen(recorder->filename), "%s/%s", recorder->dir, recorder->filename);
+-		}else{
+-			g_snprintf(newname, strlen(recorder->filename)-strlen(rec_tempext), "%s", recorder->filename);
+-			g_snprintf(tmpname, strlen(recorder->filename), "%s", recorder->filename);
++			g_snprintf(newpath, 1024, "%s/%s", recorder->dir, newname);
++			g_snprintf(oldpath, 1024, "%s/%s", recorder->dir, recorder->filename);
++		} else {
++			g_snprintf(newpath, 1024, "%s", newname);
++			g_snprintf(oldpath, 1024, "%s", recorder->filename);
+ 		}
+ 		if(rename(oldpath, newpath) != 0) {
+ 			JANUS_LOG(LOG_ERR, "Error renaming %s to %s...\n", recorder->filename, newname);
diff --git a/debian/patches/020170313~d7bfb68.patch b/debian/patches/020170313~d7bfb68.patch
new file mode 100644
index 0000000..1a4c1bf
--- /dev/null
+++ b/debian/patches/020170313~d7bfb68.patch
@@ -0,0 +1,19 @@
+Description:.Update Janus manpage to addres recent cmdline argument addition
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/d7bfb68
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/812
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/janus.1
++++ b/janus.1
+@@ -80,6 +80,9 @@
+ .BR \-q ", " \-\-max-nack-queue=\fInumber\fR
+ Maximum size of the NACK queue per user for retransmissions
+ .TP
++.BR \-t ", " \-\-no-media-timer=\fInumber\fR
++Time (in s) that should pass with no media (audio or video) being received before Janus notifies you about this
++.TP
+ .BR \-r ", " \-\-rtp-port-range=\fImin\-max\fR
+ Port range to use for RTP/RTCP
+ .TP
diff --git a/debian/patches/020170314~d905174.patch b/debian/patches/020170314~d905174.patch
new file mode 100644
index 0000000..4a3ed21
--- /dev/null
+++ b/debian/patches/020170314~d905174.patch
@@ -0,0 +1,17 @@
+Description:.Make sure cur_seq is a valid pointer
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/d905174
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/ice.c
++++ b/ice.c
+@@ -2024,7 +2024,7 @@
+ 				}
+ 				if(cur_seq) {
+ 					/* Scan old seq objs backwards */
+-					for (;;) {
++					while(cur_seq != NULL) {
+ 						last_seqs_len++;
+ 						if(cur_seq->seq == new_seqn) {
+ 							JANUS_LOG(LOG_HUGE, "[%"SCNu64"] Received missed sequence number %"SCNu16"\n", handle->handle_id, cur_seq->seq);
diff --git a/debian/patches/020170315~67b1d5a.patch b/debian/patches/020170315~67b1d5a.patch
new file mode 100644
index 0000000..207a4dd
--- /dev/null
+++ b/debian/patches/020170315~67b1d5a.patch
@@ -0,0 +1,24 @@
+Description:.Return a valid event after an AudioBridge leave
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/67b1d5a
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/816
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_audiobridge.c
++++ b/plugins/janus_audiobridge.c
+@@ -3205,8 +3205,13 @@
+ 				gateway->notify_event(&janus_audiobridge_plugin, session->handle, info);
+ 			}
+ 			/* Done */
+-			if(audiobridge != NULL)
++			event = json_object();
++			json_object_set_new(event, "audiobridge", json_string("left"));
++			if(audiobridge != NULL) {
++				json_object_set_new(event, "room", json_integer(audiobridge->room_id));
+ 				janus_mutex_unlock(&audiobridge->mutex);
++			}
++			json_object_set_new(event, "id", json_integer(participant->user_id));
+ 			janus_mutex_unlock(&rooms_mutex);
+ 		} else {
+ 			JANUS_LOG(LOG_ERR, "Unknown request '%s'\n", request_text);
diff --git a/debian/patches/020170315~6dfa794.patch b/debian/patches/020170315~6dfa794.patch
new file mode 100644
index 0000000..dd77458
--- /dev/null
+++ b/debian/patches/020170315~6dfa794.patch
@@ -0,0 +1,44 @@
+Description:.Fix typos in docs
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/6dfa794
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/mainpage.dox
++++ b/mainpage.dox
+@@ -41,7 +41,7 @@
+  * makes available in your web application can be found in the \ref JS
+  * and \ref rest pages. New API transports can be created referring to
+  * the \ref transportapi page. If you're interested in monitoring Janus
+- * resources, you can refer to the \ref admin page. Event handler plugins
++ * resources, you can refer to the \ref admin page. Event handler
+  * plugins can also be used for the purpose: refer to the \ref eventhandlerapi
+  * page if you're interested in creating your own.
+  *
+@@ -55,15 +55,13 @@
+  *
+  * This is only the first version of the gateway, and as such it is a bit
+  * rough at the edges: there is definitely room for improvement, there are
+- * bugs, limitations, and things that need to be done. For a quick glance
+- * on the most relevant pending stuff check our \ref todo (and, if you're
+- * willing to help on any of those, get in touch with us!). Make also
++ * bugs, limitations, and things that need to be done. Make also
+  * sure you read the \ref debug page for info on how you can help us
+  * fixing issues you might encounter along the road.
+  *
+  * \section copyright Copyright and author
+  *
+- * Janus WebRTC Gateway © 2014-2016 <a href="http://www.meetecho.com/">Meetecho</a> (http://www.meetecho.com/)
++ * Janus WebRTC Gateway © 2014-2017 <a href="http://www.meetecho.com/">Meetecho</a> (http://www.meetecho.com/)
+  *
+  * \author Lorenzo Miniero <lorenzo at meetecho.com> ( \ref CREDITS )
+  *
+@@ -2598,7 +2596,7 @@
+ 
+ /*! \page CREDITS Credits
+  *
+- * Janus WebRTC Gateway © 2014-2016 <a href="http://www.meetecho.com/">Meetecho</a> (http://www.meetecho.com/)
++ * Janus WebRTC Gateway © 2014-2017 <a href="http://www.meetecho.com/">Meetecho</a> (http://www.meetecho.com/)
+  *
+  * \b Author:
+  *         Lorenzo Miniero <lorenzo at meetecho.com>
diff --git a/debian/patches/020170315~a83f3cd.patch b/debian/patches/020170315~a83f3cd.patch
new file mode 100644
index 0000000..e89487a
--- /dev/null
+++ b/debian/patches/020170315~a83f3cd.patch
@@ -0,0 +1,55 @@
+Description:.Fix typo when matching user agent
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/a83f3cd
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/808
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/html/janus.js
++++ b/html/janus.js
+@@ -143,10 +143,9 @@
+ 				} else {
+ 					Janus.error("Error attaching stream to element");
+ 				}
+-			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.match(/iPad/i) || window.navigator.match(/iPhone/i)) {
++			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.userAgent.match(/iPad/i) || window.navigator.userAgent.match(/iPhone/i)) {
+ 				element.src = URL.createObjectURL(stream);
+-			}
+-			else {
++			} else {
+ 				element.srcObject = stream;
+ 			}
+ 		};
+@@ -158,10 +157,9 @@
+ 				} else if(typeof to.src !== 'undefined') {
+ 					to.src = from.src;
+ 				}
+-			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.match(/iPad/i) || window.navigator.match(/iPhone/i)) {
++			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.userAgent.match(/iPad/i) || window.navigator.userAgent.match(/iPhone/i)) {
+ 				to.src = from.src;
+-			}
+-			else {
++			} else {
+ 				to.srcObject = from.srcObject;
+ 			}
+ 		};
+--- a/html/janus.nojquery.js
++++ b/html/janus.nojquery.js
+@@ -143,7 +143,7 @@
+ 				} else {
+ 					Janus.error("Error attaching stream to element");
+ 				}
+-			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.match(/iPad/i) || window.navigator.match(/iPhone/i)) {
++			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.userAgent.match(/iPad/i) || window.navigator.userAgent.match(/iPhone/i)) {
+ 				element.src = URL.createObjectURL(stream);
+ 			}
+ 			else {
+@@ -158,7 +158,7 @@
+ 				} else if(typeof to.src !== 'undefined') {
+ 					to.src = from.src;
+ 				}
+-			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.match(/iPad/i) || window.navigator.match(/iPhone/i)) {
++			} else if(adapter.browserDetails.browser === 'safari' || window.navigator.userAgent.match(/iPad/i) || window.navigator.userAgent.match(/iPhone/i)) {
+ 				to.src = from.src;
+ 			}
+ 			else {
diff --git a/debian/patches/020170315~f947fbe.patch b/debian/patches/020170315~f947fbe.patch
new file mode 100644
index 0000000..284fa78
--- /dev/null
+++ b/debian/patches/020170315~f947fbe.patch
@@ -0,0 +1,42 @@
+Description:.Fix broken re-INVITE management in SIP plugin
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/f947fbe
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_sip.c
++++ b/plugins/janus_sip.c
+@@ -3200,7 +3200,7 @@
+ 	struct sockaddr_in server_addr;
+ 	memset(&server_addr, 0, sizeof(server_addr));
+ 	server_addr.sin_family = AF_INET;
+-	if((inet_aton(session->media.remote_ip, &server_addr.sin_addr)) <= 0) {	/* Not a numeric IP... */
++	if(inet_aton(session->media.remote_ip, &server_addr.sin_addr) == 0) {	/* Not a numeric IP... */
+ 		struct hostent *host = gethostbyname(session->media.remote_ip);	/* ...resolve name */
+ 		if(!host) {
+ 			JANUS_LOG(LOG_ERR, "[SIP-%s] Couldn't get host (%s)\n", session->account.username, session->media.remote_ip);
+@@ -3236,10 +3236,11 @@
+ 
+ 		if(session->media.updated) {
+ 			/* Apparently there was a session update */
+-			if(have_server_ip && (inet_aton(session->media.remote_ip, &server_addr.sin_addr)) <= 0) {
++			if(session->media.remote_ip != NULL && (inet_aton(session->media.remote_ip, &server_addr.sin_addr) != 0)) {
+ 				janus_sip_connect_sockets(session, &server_addr);
+ 			} else {
+-				JANUS_LOG(LOG_ERR, "[SIP-%s] Couldn't update session details (missing or invalid remote IP address)\n", session->account.username);
++				JANUS_LOG(LOG_ERR, "[SIP-%p] Couldn't update session details: missing or invalid remote IP address? (%s)\n",
++					session->account.username, session->media.remote_ip);
+ 			}
+ 			session->media.updated = FALSE;
+ 		}
+@@ -3297,6 +3298,10 @@
+ 				JANUS_LOG(LOG_ERR, "[SIP-%s] Error polling: %s...\n", session->account.username,
+ 					fds[i].revents & POLLERR ? "POLLERR" : "POLLHUP");
+ 				JANUS_LOG(LOG_ERR, "[SIP-%s]   -- %d (%s)\n", session->account.username, errno, strerror(errno));
++				if(errno == 0) {
++					/* Maybe not a breaking error? */
++					continue;
++				}
+ 				if(session->media.updated)
+ 					break;
+ 				goon = FALSE;	/* Can we assume it's pretty much over, after a POLLERR? */
diff --git a/debian/patches/020170315~fc72d3a.patch b/debian/patches/020170315~fc72d3a.patch
new file mode 100644
index 0000000..ada627f
--- /dev/null
+++ b/debian/patches/020170315~fc72d3a.patch
@@ -0,0 +1,108 @@
+Description:.Return error ifStreaming recorder fails
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/fc72d3a
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_streaming.c
++++ b/plugins/janus_streaming.c
+@@ -513,6 +513,7 @@
+ #define JANUS_STREAMING_ERROR_CANT_CREATE			456
+ #define JANUS_STREAMING_ERROR_UNAUTHORIZED			457
+ #define JANUS_STREAMING_ERROR_CANT_SWITCH			458
++#define JANUS_STREAMING_ERROR_CANT_RECORD			459
+ #define JANUS_STREAMING_ERROR_UNKNOWN_ERROR			470
+ 
+ 
+@@ -1980,6 +1981,7 @@
+ 			json_t *audio = json_object_get(root, "audio");
+ 			json_t *video = json_object_get(root, "video");
+ 			json_t *data = json_object_get(root, "data");
++			janus_recorder *arc = NULL, *vrc = NULL, *drc = NULL;
+ 			if((audio && source->arc) || (video && source->vrc) || (data && source->drc)) {
+ 				janus_mutex_unlock(&mountpoints_mutex);
+ 				JANUS_LOG(LOG_ERR, "Recording for audio, video and/or data already started for this stream\n");
+@@ -2000,13 +2002,18 @@
+ 					codec = "opus";
+ 				else if(strstr(mp->codecs.audio_rtpmap, "pcm") || strstr(mp->codecs.audio_rtpmap, "PCM"))
+ 					codec = "g711";
++				else if(strstr(mp->codecs.audio_rtpmap, "g722") || strstr(mp->codecs.audio_rtpmap, "G722"))
++					codec = "g722";
+ 				const char *audiofile = json_string_value(audio);
+-				source->arc = janus_recorder_create(NULL, codec, (char *)audiofile);
+-				if(source->arc == NULL) {
+-					JANUS_LOG(LOG_ERR, "Error starting recorder for audio\n");
+-				} else {
+-					JANUS_LOG(LOG_INFO, "[%s] Audio recording started\n", mp->name);
++				arc = janus_recorder_create(NULL, codec, (char *)audiofile);
++				if(arc == NULL) {
++					JANUS_LOG(LOG_ERR, "[%s] Error starting recorder for audio\n", mp->name);
++					janus_mutex_unlock(&mountpoints_mutex);
++					error_code = JANUS_STREAMING_ERROR_CANT_RECORD;
++					g_snprintf(error_cause, 512, "Error starting recorder for audio");
++					goto plugin_response;
+ 				}
++				JANUS_LOG(LOG_INFO, "[%s] Audio recording started\n", mp->name);
+ 			}
+ 			if(video) {
+ 				const char *codec = NULL;
+@@ -2017,22 +2024,49 @@
+ 				else if(strstr(mp->codecs.video_rtpmap, "h264") || strstr(mp->codecs.video_rtpmap, "H264"))
+ 					codec = "h264";
+ 				const char *videofile = json_string_value(video);
+-				source->vrc = janus_recorder_create(NULL, codec, (char *)videofile);
+-				if(source->vrc == NULL) {
+-					JANUS_LOG(LOG_ERR, "Error starting recorder for video\n");
+-				} else {
+-					JANUS_LOG(LOG_INFO, "[%s] Video recording started\n", mp->name);
++				vrc = janus_recorder_create(NULL, codec, (char *)videofile);
++				if(vrc == NULL) {
++					if(arc != NULL) {
++						janus_recorder_close(arc);
++						janus_recorder_free(arc);
++						arc = NULL;
++					}
++					JANUS_LOG(LOG_ERR, "[%s] Error starting recorder for video\n", mp->name);
++					janus_mutex_unlock(&mountpoints_mutex);
++					error_code = JANUS_STREAMING_ERROR_CANT_RECORD;
++					g_snprintf(error_cause, 512, "Error starting recorder for video");
++					goto plugin_response;
+ 				}
++				JANUS_LOG(LOG_INFO, "[%s] Video recording started\n", mp->name);
+ 			}
+ 			if(data) {
+ 				const char *datafile = json_string_value(data);
+-				source->drc = janus_recorder_create(NULL, "text", (char *)datafile);
+-				if(source->drc == NULL) {
+-					JANUS_LOG(LOG_ERR, "Error starting recorder for data\n");
+-				} else {
+-					JANUS_LOG(LOG_INFO, "[%s] Data recording started\n", mp->name);
++				drc = janus_recorder_create(NULL, "text", (char *)datafile);
++				if(drc == NULL) {
++					if(arc != NULL) {
++						janus_recorder_close(arc);
++						janus_recorder_free(arc);
++						arc = NULL;
++					}
++					if(vrc != NULL) {
++						janus_recorder_close(vrc);
++						janus_recorder_free(vrc);
++						vrc = NULL;
++					}
++					JANUS_LOG(LOG_ERR, "[%s] Error starting recorder for data\n", mp->name);
++					janus_mutex_unlock(&mountpoints_mutex);
++					error_code = JANUS_STREAMING_ERROR_CANT_RECORD;
++					g_snprintf(error_cause, 512, "Error starting recorder for data");
++					goto plugin_response;
+ 				}
++				JANUS_LOG(LOG_INFO, "[%s] Data recording started\n", mp->name);
+ 			}
++			if(arc != NULL)
++				source->arc = arc;
++			if(vrc != NULL)
++				source->vrc = vrc;
++			if(drc != NULL)
++				source->drc = drc;
+ 			janus_mutex_unlock(&mountpoints_mutex);
+ 			/* Send a success response back */
+ 			response = json_object();
diff --git a/debian/patches/020170317~5b868e3.patch b/debian/patches/020170317~5b868e3.patch
new file mode 100644
index 0000000..2009a2a
--- /dev/null
+++ b/debian/patches/020170317~5b868e3.patch
@@ -0,0 +1,17 @@
+Description:.Fix compilation warning in ice.c
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/5b868e3
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/818
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/ice.c
++++ b/ice.c
+@@ -17,6 +17,7 @@
+ #include <ifaddrs.h>
+ #include <net/if.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <netdb.h>
+ #include <fcntl.h>
+ #include <stun/usages/bind.h>
diff --git a/debian/patches/020170317~7f82f31.patch b/debian/patches/020170317~7f82f31.patch
new file mode 100644
index 0000000..94c0a84
--- /dev/null
+++ b/debian/patches/020170317~7f82f31.patch
@@ -0,0 +1,41 @@
+Description:.Unlink UnixSockets when shutting down
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/7f82f31
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/819
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/transports/janus_pfunix.c
++++ b/transports/janus_pfunix.c
+@@ -727,12 +727,29 @@
+ 		}
+ 	}
+ 
+-	if(pfd > -1)
++	socklen_t addrlen = sizeof(struct sockaddr_un);
++	void *addr = g_malloc0(addrlen+1);
++	if(pfd > -1) {
++		/* Unlink the path name first */
++		if(getsockname(pfd, (struct sockaddr *)addr, &addrlen) != -1) {
++			JANUS_LOG(LOG_INFO, "Unlinking %s\n", ((struct sockaddr_un *)addr)->sun_path);
++			unlink(((struct sockaddr_un *)addr)->sun_path);
++		}
++		/* Close the socket */
+ 		close(pfd);
++	}
+ 	pfd = -1;
+-	if(admin_pfd > -1)
++	if(admin_pfd > -1) {
++		/* Unlink the path name first */
++		if(getsockname(admin_pfd, (struct sockaddr *)addr, &addrlen) != -1) {
++			JANUS_LOG(LOG_INFO, "Unlinking %s\n", ((struct sockaddr_un *)addr)->sun_path);
++			unlink(((struct sockaddr_un *)addr)->sun_path);
++		}
++		/* Close the socket */
+ 		close(admin_pfd);
++	}
+ 	admin_pfd = -1;
++	g_free(addr);
+ 
+ 	g_hash_table_destroy(clients_by_path);
+ 	g_hash_table_destroy(clients_by_fd);
diff --git a/debian/patches/020170317~81d6156.patch b/debian/patches/020170317~81d6156.patch
new file mode 100644
index 0000000..65bb18c
--- /dev/null
+++ b/debian/patches/020170317~81d6156.patch
@@ -0,0 +1,48 @@
+Description:.Fix Username/Password
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/81d6156
+Author: StormBkk87 <rich at vfrglobal.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/transports/janus_mqtt.c
++++ b/transports/janus_mqtt.c
+@@ -104,6 +104,8 @@
+ 	struct {
+ 		int keep_alive_interval;
+ 		int cleansession;
++		char *username;
++		char *password;
+ 	} connect;
+ 	struct {
+ 		int timeout;
+@@ -184,10 +186,10 @@
+ 	const char *client_id = g_strdup((client_id_item && client_id_item->value) ? client_id_item->value : "guest");
+ 
+ 	janus_config_item *username_item = janus_config_get_item_drilldown(config, "general", "username");
+-	const char *username = g_strdup((username_item && username_item->value) ? username_item->value : "guest");
++	ctx->connect.username = g_strdup((username_item && username_item->value) ? username_item->value : "guest");
+ 	
+ 	janus_config_item *password_item = janus_config_get_item_drilldown(config, "general", "password");
+-	const char *password = g_strdup((password_item && password_item->value) ? password_item->value : "guest");
++	ctx->connect.password = g_strdup((password_item && password_item->value) ? password_item->value : "guest");
+ 
+ 	janus_config_item *json_item = janus_config_get_item_drilldown(config, "general", "json");
+ 	if(json_item && json_item->value) {
+@@ -338,8 +340,6 @@
+ 	janus_mqtt_client_destroy_context(&ctx);
+ 	g_free((char *)url);
+ 	g_free((char *)client_id);
+-	g_free((char *)username);
+-	g_free((char *)password);
+ 	g_free(config);
+ 
+ 	return -1;
+@@ -457,6 +457,8 @@
+ 	MQTTAsync_connectOptions options = MQTTAsync_connectOptions_initializer;
+ 	options.keepAliveInterval = ctx->connect.keep_alive_interval;
+ 	options.cleansession = ctx->connect.cleansession;
++	options.username = ctx->connect.username;
++	options.password = ctx->connect.password;
+ 	options.automaticReconnect = TRUE;
+ 	options.onSuccess = janus_mqtt_client_connect_success;
+ 	options.onFailure = janus_mqtt_client_connect_failure;
diff --git a/debian/patches/020170317~9380393.patch b/debian/patches/020170317~9380393.patch
new file mode 100644
index 0000000..4f2634b
--- /dev/null
+++ b/debian/patches/020170317~9380393.patch
@@ -0,0 +1,242 @@
+Description:.Remove usages of /tmp, and used placeholders where relevant
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/9380393
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/814
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -64,6 +64,9 @@
+ recordingsdir = $(datadir)/janus/recordings
+ recordings_DATA = $(NULL)
+ 
++demosdir = $(datadir)/janus/demos
++demos_DATA = $(NULL)
++
+ %.sample: %.sample.in
+ 	$(MKDIR_P) $(@D)
+ 	$(AM_V_GEN) sed -e "\
+@@ -73,6 +76,7 @@
+ 	    s|[@]transportdir[@]|$(transportdir)|;\
+ 	    s|[@]eventdir[@]|$(eventdir)|;\
+ 	    s|[@]recordingsdir[@]|$(recordingsdir)|;\
++	    s|[@]demosdir[@]|$(demosdir)|;\
+ 	    s|[@]streamdir[@]|$(streamdir)|" \
+ 	$< > $@ || rm $@
+ 
+@@ -349,7 +353,7 @@
+ plugins_libjanus_voicemail_la_LDFLAGS = $(plugins_ldflags) -logg
+ plugins_libjanus_voicemail_la_LIBADD = $(plugins_libadd)
+ conf_DATA += conf/janus.plugin.voicemail.cfg.sample
+-EXTRA_DIST += conf/janus.plugin.voicemail.cfg.sample
++EXTRA_DIST += conf/janus.plugin.voicemail.cfg.sample.in
+ endif
+ 
+ if ENABLE_PLUGIN_TEXTROOM
+--- a/conf/janus.cfg.sample.in
++++ b/conf/janus.cfg.sample.in
+@@ -4,17 +4,17 @@
+ ; and, if needed, shared apisecret and/or token authentication mechanism
+ ; between application(s) and Janus.
+ [general]
+-configs_folder = @confdir@		; Configuration files folder
++configs_folder = @confdir@			; Configuration files folder
+ plugins_folder = @plugindir@		; Plugins folder
+ transports_folder = @transportdir@	; Transports folder
+-events_folder = @eventdir@		; Event handlers folder
+-;log_to_stdout = false			; Whether the Janus output should be written
+-								; to stdout or not (default=true)
+-;log_to_file = /tmp/janus.log	; Whether to use a log file or not
+-;daemonize = true				; Whether Janus should run as a daemon
+-								; or not (default=run in foreground)
+-;pid_file = /tmp/janus.pid		; PID file to create when Janus has been
+-								; started, and to destroy at shutdown
++events_folder = @eventdir@			; Event handlers folder
++;log_to_stdout = false				; Whether the Janus output should be written
++									; to stdout or not (default=true)
++;log_to_file = /path/to/janus.log	; Whether to use a log file or not
++;daemonize = true					; Whether Janus should run as a daemon
++									; or not (default=run in foreground)
++;pid_file = /path/to/janus.pid		; PID file to create when Janus has been
++									; started, and to destroy at shutdown
+ ;interface = 1.2.3.4		; Interface to use (will be used in SDP)
+ debug_level = 4				; Debug/logging level, valid values are 0-7
+ ;debug_timestamps = yes		; Whether to show a timestamp for each log line
+--- a/conf/janus.plugin.audiobridge.cfg.sample
++++ b/conf/janus.plugin.audiobridge.cfg.sample
+@@ -20,4 +20,4 @@
+ secret = adminpwd
+ sampling_rate = 16000
+ record = false
+-;record_file = /tmp/janus-audioroom-1234.wav
++;record_file = /path/to/recording.wav
+--- a/conf/janus.plugin.videoroom.cfg.sample
++++ b/conf/janus.plugin.videoroom.cfg.sample
+@@ -33,4 +33,4 @@
+ ;audiocodec = opus
+ ;videocodec = vp8
+ record = false
+-;rec_dir = /tmp/janus-videoroom
++;rec_dir = /path/to/recordings-folder
+--- a/conf/janus.plugin.voicemail.cfg.sample
++++ /dev/null
+@@ -1,10 +0,0 @@
+-; path = where to place recordings in the file system (should be in a
+-;	properly configured web server, if you want the demo to work)
+-; base = base path to use when returning the recording URI (use this
+-;	to make sure the file in the path you chose is reachable via HTTP)
+-; events = yes|no, whether events should be sent to event handlers
+-
+-[general]
+-path = /tmp/voicemail/
+-base = /voicemail/
+-events = yes
+--- /dev/null
++++ b/conf/janus.plugin.voicemail.cfg.sample.in
+@@ -0,0 +1,10 @@
++; path = where to place recordings in the file system (should be in a
++;	properly configured web server, if you want the demo to work)
++; base = base path to use when returning the recording URI (use this
++;	to make sure the file in the path you chose is reachable via HTTP)
++; events = yes|no, whether events should be sent to event handlers
++
++[general]
++path = @demosdir@/voicemail/
++base = /voicemail/
++events = yes
+--- a/conf/janus.transport.pfunix.cfg.sample
++++ b/conf/janus.transport.pfunix.cfg.sample
+@@ -1,12 +1,13 @@
+ ; You can also control a Janus instance using Unix Sockets. The only
+ ; aspect you need to configure here is the path of the Unix Sockets
+-; server.
++; server. Notice that by default the interface is disabled, as you need
++; to specify the path(s) to bind to for the API(s).
+ [general]
+-enabled = yes					; Whether to enable the Unix Sockets interface
++enabled = no					; Whether to enable the Unix Sockets interface
+ 								; for Janus API clients
+ json = indented					; Whether the JSON messages should be indented (default),
+ 								; plain (no indentation) or compact (no indentation and no spaces)
+-path = /tmp/ux-janusapi			; Path to bind to (Janus API)
++;path = /path/to/ux-janusapi	; Path to bind to (Janus API)
+ ;type = SOCK_SEQPACKET			; SOCK_SEQPACKET (default) or SOCK_DGRAM?
+ 
+ ; As with other transport plugins, you can use Unix Sockets to interact
+@@ -15,5 +16,5 @@
+ [admin]
+ admin_enabled = no				; Whether to enable the Unix Sockets interface
+ 								; for Admin API clients
+-admin_path = /tmp/ux-janusadmin	; Path to bind to (Admin API)
++;admin_path = /path/to/ux-janusadmin	; Path to bind to (Admin API)
+ ;admin_type = SOCK_SEQPACKET	; SOCK_SEQPACKET (default) or SOCK_DGRAM?
+--- a/plugins/janus_audiobridge.c
++++ b/plugins/janus_audiobridge.c
+@@ -3360,10 +3360,11 @@
+ 	/* Do we need to record the mix? */
+ 	if(audiobridge->record) {
+ 		char filename[255];
+-		if(audiobridge->record_file)
++		if(audiobridge->record_file) {
+ 			g_snprintf(filename, 255, "%s", audiobridge->record_file);
+-		else
+-			g_snprintf(filename, 255, "/tmp/janus-audioroom-%"SCNu64".wav", audiobridge->room_id);
++		} else {
++			g_snprintf(filename, 255, "janus-audioroom-%"SCNu64".wav", audiobridge->room_id);
++		}
+ 		audiobridge->recording = fopen(filename, "wb");
+ 		if(audiobridge->recording == NULL) {
+ 			JANUS_LOG(LOG_WARN, "Recording requested, but could NOT open file %s for writing...\n", filename);
+--- a/plugins/janus_recordplay.c
++++ b/plugins/janus_recordplay.c
+@@ -548,8 +548,8 @@
+ 		config = NULL;
+ 	}
+ 	if(recordings_path == NULL) {
+-		recordings_path = g_strdup("/tmp");
+-		JANUS_LOG(LOG_WARN, "No recordings path specified, using /tmp...\n");
++		JANUS_LOG(LOG_FATAL, "No recordings path specified, giving up...\n");
++		return -1;
+ 	}
+ 	/* Create the folder, if needed */
+ 	struct stat st = {0};
+--- a/sctp.c
++++ b/sctp.c
+@@ -15,13 +15,13 @@
+  * \note If you want/need to debug SCTP messages for any reason, you can
+  * do so by uncommenting the definition of \c DEBUG_SCTP in sctp.h. This
+  * will force this code to save all the SCTP messages being exchanged to
+- * a separate file for each session. You can choose what folder to save
++ * a separate file for each session. You must choose what folder to save
+  * these files in by modifying the \c debug_folder variable. Once a file
+  * has been saved, you need to process it using the \c text2pcap tool
+  * that is usually shipped with Wireshark, e.g.:
+  * 
+ \verbatim
+-cd /tmp/sctp
++cd /path/to/sctp
+ /usr/sbin/text2pcap -n -l 248 -D -t '%H:%M:%S.' sctp-debug-XYZ.txt sctp-debug-XYZ.pcapng
+ /usr/sbin/wireshark sctp-debug-XYZ.pcapng
+ \endverbatim
+@@ -39,8 +39,8 @@
+ #include "debug.h"
+ 
+ #ifdef DEBUG_SCTP
+-/* If we're debugging the SCTP messaging, save the files here */
+-const char *debug_folder = "/tmp/sctp";
++/* If we're debugging the SCTP messaging, save the files here (edit path) */
++const char *debug_folder = "/path/to/sctp";
+ #endif
+ 
+ 
+--- a/transports/janus_pfunix.c
++++ b/transports/janus_pfunix.c
+@@ -232,7 +232,7 @@
+ 			JANUS_LOG(LOG_WARN, "Unix Sockets server disabled (Janus API)\n");
+ 		} else {
+ 			item = janus_config_get_item_drilldown(config, "general", "path");
+-			char *pfname = (char *)(item && item->value ? item->value : "/tmp/ux-janusapi");
++			char *pfname = (char *)(item && item->value ? item->value : NULL);
+ 			item = janus_config_get_item_drilldown(config, "general", "type");
+ 			const char *type = item && item->value ? item->value : "SOCK_SEQPACKET";
+ 			dgram = FALSE;
+@@ -244,8 +244,12 @@
+ 				JANUS_LOG(LOG_WARN, "Unknown type %s, assuming SOCK_SEQPACKET\n", type);
+ 				type = "SOCK_SEQPACKET";
+ 			}
+-			JANUS_LOG(LOG_INFO, "Configuring %s Unix Sockets server (Janus API)\n", type);
+-			pfd = janus_pfunix_create_socket(pfname, dgram);
++			if(pfname == NULL) {
++				JANUS_LOG(LOG_WARN, "No path configured, skipping Unix Sockets server (Janus API)\n");
++			} else {
++				JANUS_LOG(LOG_INFO, "Configuring %s Unix Sockets server (Janus API)\n", type);
++				pfd = janus_pfunix_create_socket(pfname, dgram);
++			}
+ 		}
+ 		/* Do the same for the Admin API, if enabled */
+ 		item = janus_config_get_item_drilldown(config, "admin", "admin_enabled");
+@@ -253,7 +257,7 @@
+ 			JANUS_LOG(LOG_WARN, "Unix Sockets server disabled (Admin API)\n");
+ 		} else {
+ 			item = janus_config_get_item_drilldown(config, "admin", "admin_path");
+-			char *pfname = (char *)(item && item->value ? item->value : "/tmp/ux-janusadmin");
++			char *pfname = (char *)(item && item->value ? item->value : NULL);
+ 			item = janus_config_get_item_drilldown(config, "admin", "admin_type");
+ 			const char *type = item && item->value ? item->value : "SOCK_SEQPACKET";
+ 			if(!strcasecmp(type, "SOCK_SEQPACKET")) {
+@@ -264,8 +268,12 @@
+ 				JANUS_LOG(LOG_WARN, "Unknown type %s, assuming SOCK_SEQPACKET\n", type);
+ 				type = "SOCK_SEQPACKET";
+ 			}
+-			JANUS_LOG(LOG_INFO, "Configuring %s Unix Sockets server (Admin API)\n", type);
+-			admin_pfd = janus_pfunix_create_socket(pfname, admin_dgram);
++			if(pfname == NULL) {
++				JANUS_LOG(LOG_WARN, "No path configured, skipping Unix Sockets server (Admin API)\n");
++			} else {
++				JANUS_LOG(LOG_INFO, "Configuring %s Unix Sockets server (Admin API)\n", type);
++				admin_pfd = janus_pfunix_create_socket(pfname, admin_dgram);
++			}
+ 		}
+ 	}
+ 	janus_config_destroy(config);
diff --git a/debian/patches/020170318~dbd48d7.patch b/debian/patches/020170318~dbd48d7.patch
new file mode 100644
index 0000000..28c22c9
--- /dev/null
+++ b/debian/patches/020170318~dbd48d7.patch
@@ -0,0 +1,17 @@
+Description:.Fix memory leak not releasing username/password
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/dbd48d7
+Author: StormBkk87 <rich at vfrglobal.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/transports/janus_mqtt.c
++++ b/transports/janus_mqtt.c
+@@ -671,6 +671,8 @@
+ 		MQTTAsync_destroy(&ctx->client);
+ 		g_free(ctx->subscribe.topic);
+ 		g_free(ctx->publish.topic);
++		g_free(ctx->connect.username);
++		g_free(ctx->connect.password);
+ 		g_free(ctx->admin.subscribe.topic);
+ 		g_free(ctx->admin.publish.topic);
+ 		g_free(ctx);
diff --git a/debian/patches/020170320~cdd6c44.patch b/debian/patches/020170320~cdd6c44.patch
new file mode 100644
index 0000000..5471ce3
--- /dev/null
+++ b/debian/patches/020170320~cdd6c44.patch
@@ -0,0 +1,64 @@
+Description:.Fix crash when disabling non-RTP mountpoints
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/cdd6c44
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/plugins/janus_streaming.c
++++ b/plugins/janus_streaming.c
+@@ -2158,30 +2158,32 @@
+ 			JANUS_LOG(LOG_INFO, "[%s] Stream disabled\n", mp->name);
+ 			mp->enabled = FALSE;
+ 			/* Any recording to close? */
+-			janus_streaming_rtp_source *source = mp->source;
+-			janus_mutex_lock(&source->rec_mutex);
+-			if(source->arc) {
+-				janus_recorder_close(source->arc);
+-				JANUS_LOG(LOG_INFO, "[%s] Closed audio recording %s\n", mp->name, source->arc->filename ? source->arc->filename : "??");
+-				janus_recorder *tmp = source->arc;
+-				source->arc = NULL;
+-				janus_recorder_free(tmp);
++			if(mp->streaming_source == janus_streaming_source_rtp) {
++				janus_streaming_rtp_source *source = mp->source;
++				janus_mutex_lock(&source->rec_mutex);
++				if(source->arc) {
++					janus_recorder_close(source->arc);
++					JANUS_LOG(LOG_INFO, "[%s] Closed audio recording %s\n", mp->name, source->arc->filename ? source->arc->filename : "??");
++					janus_recorder *tmp = source->arc;
++					source->arc = NULL;
++					janus_recorder_free(tmp);
++				}
++				if(source->vrc) {
++					janus_recorder_close(source->vrc);
++					JANUS_LOG(LOG_INFO, "[%s] Closed video recording %s\n", mp->name, source->vrc->filename ? source->vrc->filename : "??");
++					janus_recorder *tmp = source->vrc;
++					source->vrc = NULL;
++					janus_recorder_free(tmp);
++				}
++				if(source->drc) {
++					janus_recorder_close(source->drc);
++					JANUS_LOG(LOG_INFO, "[%s] Closed data recording %s\n", mp->name, source->drc->filename ? source->drc->filename : "??");
++					janus_recorder *tmp = source->drc;
++					source->drc = NULL;
++					janus_recorder_free(tmp);
++				}
++				janus_mutex_unlock(&source->rec_mutex);
+ 			}
+-			if(source->vrc) {
+-				janus_recorder_close(source->vrc);
+-				JANUS_LOG(LOG_INFO, "[%s] Closed video recording %s\n", mp->name, source->vrc->filename ? source->vrc->filename : "??");
+-				janus_recorder *tmp = source->vrc;
+-				source->vrc = NULL;
+-				janus_recorder_free(tmp);
+-			}
+-			if(source->drc) {
+-				janus_recorder_close(source->drc);
+-				JANUS_LOG(LOG_INFO, "[%s] Closed data recording %s\n", mp->name, source->drc->filename ? source->drc->filename : "??");
+-				janus_recorder *tmp = source->drc;
+-				source->drc = NULL;
+-				janus_recorder_free(tmp);
+-			}
+-			janus_mutex_unlock(&source->rec_mutex);
+ 			/* FIXME: Should we notify the listeners, or is this up to the controller application? */
+ 		}
+ 		janus_mutex_unlock(&mountpoints_mutex);
diff --git a/debian/patches/020170321~fcec9a1.patch b/debian/patches/020170321~fcec9a1.patch
new file mode 100644
index 0000000..c22c370
--- /dev/null
+++ b/debian/patches/020170321~fcec9a1.patch
@@ -0,0 +1,39 @@
+Description:.Don't print errors if transports are simply disabled by configuration
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/fcec9a1
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/transports/janus_http.c
++++ b/transports/janus_http.c
+@@ -802,7 +802,7 @@
+ 	janus_config_destroy(config);
+ 	config = NULL;
+ 	if(!ws && !sws && !admin_ws && !admin_sws) {
+-		JANUS_LOG(LOG_FATAL, "No HTTP/HTTPS server started, giving up...\n"); 
++		JANUS_LOG(LOG_WARN, "No HTTP/HTTPS server started, giving up...\n");
+ 		return -1;	/* No point in keeping the plugin loaded */
+ 	}
+ 	http_janus_api_enabled = ws || sws;
+--- a/transports/janus_pfunix.c
++++ b/transports/janus_pfunix.c
+@@ -279,7 +279,7 @@
+ 	janus_config_destroy(config);
+ 	config = NULL;
+ 	if(pfd < 0 && admin_pfd < 0) {
+-		JANUS_LOG(LOG_FATAL, "No Unix Sockets server started, giving up...\n");
++		JANUS_LOG(LOG_WARN, "No Unix Sockets server started, giving up...\n");
+ 		return -1;	/* No point in keeping the plugin loaded */
+ 	}
+ 
+--- a/transports/janus_websockets.c
++++ b/transports/janus_websockets.c
+@@ -708,7 +708,7 @@
+ 	janus_config_destroy(config);
+ 	config = NULL;
+ 	if(!wss && !swss && !admin_wss && !admin_swss) {
+-		JANUS_LOG(LOG_FATAL, "No WebSockets server started, giving up...\n");
++		JANUS_LOG(LOG_WARN, "No WebSockets server started, giving up...\n");
+ 		return -1;	/* No point in keeping the plugin loaded */
+ 	}
+ 	wss_janus_api_enabled = wss || swss;
diff --git a/debian/patches/020170324~938e723.patch b/debian/patches/020170324~938e723.patch
new file mode 100644
index 0000000..88de33b
--- /dev/null
+++ b/debian/patches/020170324~938e723.patch
@@ -0,0 +1,25 @@
+Description:.Fix error in HTTP module (reported on group)
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/938e723
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/transports/janus_http.c
++++ b/transports/janus_http.c
+@@ -386,7 +386,7 @@
+ 			fseek(pem, 0L, SEEK_END);
+ 			size_t size = ftell(pem);
+ 			fseek(pem, 0L, SEEK_SET);
+-			cert_pem_bytes = g_malloc0(size);
++			cert_pem_bytes = g_malloc0(size+1);
+ 			char *index = cert_pem_bytes;
+ 			int read = 0, tot = size;
+ 			while((read = fread(index, sizeof(char), tot, pem)) > 0) {
+@@ -394,6 +394,7 @@
+ 				index += read;
+ 			}
+ 			fclose(pem);
++			cert_pem_bytes[size] = '\0';
+ 		}
+ 		FILE *key = fopen(server_key, "rb");
+ 		if(key) {
diff --git a/debian/patches/020170324~9df683d.patch b/debian/patches/020170324~9df683d.patch
new file mode 100644
index 0000000..305d42d
--- /dev/null
+++ b/debian/patches/020170324~9df683d.patch
@@ -0,0 +1,18 @@
+Description:.Fix broken link in EchoTest demo
+Origin: upstream, https://github.com/meetecho/janus-gateway/commit/9df683d
+Author: Lorenzo Miniero <lminiero at gmail.com>
+Bug: https://github.com/unbit/uwsgi/issues/827
+Forwarded: yes
+Last-Update: 2017-03-25
+
+--- a/html/echotest.html
++++ b/html/echotest.html
+@@ -63,7 +63,7 @@
+ 						sake of simplicity accesses the default devices you have available on
+ 						your machine. If you're interested in a demo that shows you how you
+ 						can select specific devices with <code>janus.js</code>, open the
+-						<a class="alert-link" href="devices.html">Devices</a> demo instead.</div>
++						<a class="alert-link" href="devicetest.html">Devices</a> demo instead.</div>
+ 						<p>Press the <code>Start</code> button above to launch the demo.</p>
+ 					</div>
+ 				</div>
diff --git a/debian/patches/2002_avoid_tmp.patch b/debian/patches/2002_avoid_tmp.patch
deleted file mode 100644
index 114eecf..0000000
--- a/debian/patches/2002_avoid_tmp.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-Description: Avoid static paths below /tmp
-Author: Jonas Smedegaard <dr at jones.dk>
-Last-Update: 2017-03-13
-
---- a/conf/janus.cfg.sample.in
-+++ b/conf/janus.cfg.sample.in
-@@ -10,10 +10,10 @@
- events_folder = @eventdir@		; Event handlers folder
- ;log_to_stdout = false			; Whether the Janus output should be written
- 								; to stdout or not (default=true)
--;log_to_file = /tmp/janus.log	; Whether to use a log file or not
-+;log_to_file = /var/log/janus/janus.log	; Whether to use a log file or not
- ;daemonize = true				; Whether Janus should run as a daemon
- 								; or not (default=run in foreground)
--;pid_file = /tmp/janus.pid		; PID file to create when Janus has been
-+;pid_file = /var/run/janus/janus.pid	; PID file to create when Janus has been
- 								; started, and to destroy at shutdown
- ;interface = 1.2.3.4		; Interface to use (will be used in SDP)
- debug_level = 4				; Debug/logging level, valid values are 0-7
---- a/conf/janus.plugin.audiobridge.cfg.sample
-+++ /dev/null
-@@ -1,23 +0,0 @@
--; [<unique room ID>]
--; description = This is my awesome room
--; is_private = yes|no (whether this room should be in the public list, default=yes)
--; secret = <optional password needed for manipulating (e.g. destroying) the room>
--; pin = <optional password needed for joining the room>
--; sampling_rate = <sampling rate> (e.g., 16000 for wideband mixing)
--; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must
--;		be negotiated/used or not for new joins, default=yes)
--; record = true|false (whether this room should be recorded, default=false)
--; record_file = /path/to/recording.wav (where to save the recording)
--
--[general]
--;admin_key = supersecret		; If set, rooms can be created via API only
--								; if this key is provided in the request
--;events = no					; Whether events should be sent to event
--								; handlers (default is yes)
--
--[1234]
--description = Demo Room
--secret = adminpwd
--sampling_rate = 16000
--record = false
--;record_file = /tmp/janus-audioroom-1234.wav
---- a/conf/janus.plugin.videoroom.cfg.sample
-+++ /dev/null
-@@ -1,36 +0,0 @@
--; [<unique room ID>]
--; description = This is my awesome room
--; is_private = yes|no (whether this room should be in the public list, default=yes)
--; secret = <optional password needed for manipulating (e.g. destroying) the room>
--; pin = <optional password needed for joining the room>
--; publishers = <max number of concurrent senders> (e.g., 6 for a video
--;              conference or 1 for a webinar)
--; bitrate = <max video bitrate for senders> (e.g., 128000)
--; fir_freq = <send a FIR to publishers every fir_freq seconds> (0=disable)
--; audiocodec = opus|isac32|isac16|pcmu|pcma (audio codec to force on publishers, default=opus)
--; videocodec = vp8|vp9|h264 (video codec to force on publishers, default=vp8)
--; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must
--;		be negotiated/used or not for new publishers, default=yes)
--; videoorient_ext = yes|no (whether the video-orientation RTP extension must
--;		be negotiated/used or not for new publishers, default=yes)
--; playoutdelay_ext = yes|no (whether the playout-delay RTP extension must
--;		be negotiated/used or not for new publishers, default=yes)
--; record = true|false (whether this room should be recorded, default=false)
--; rec_dir = <folder where recordings should be stored, when enabled>
--
--[general]
--;admin_key = supersecret		; If set, rooms can be created via API only
--								; if this key is provided in the request
--;events = no					; Whether events should be sent to event
--								; handlers (default is yes)
--
--[1234]
--description = Demo Room
--secret = adminpwd
--publishers = 6
--bitrate = 128000
--fir_freq = 10
--;audiocodec = opus
--;videocodec = vp8
--record = false
--;rec_dir = /tmp/janus-videoroom
---- a/conf/janus.plugin.voicemail.cfg.sample
-+++ /dev/null
-@@ -1,10 +0,0 @@
--; path = where to place recordings in the file system (should be in a
--;	properly configured web server, if you want the demo to work)
--; base = base path to use when returning the recording URI (use this
--;	to make sure the file in the path you chose is reachable via HTTP)
--; events = yes|no, whether events should be sent to event handlers
--
--[general]
--path = /tmp/voicemail/
--base = /voicemail/
--events = yes
---- a/conf/janus.transport.pfunix.cfg.sample
-+++ b/conf/janus.transport.pfunix.cfg.sample
-@@ -6,7 +6,7 @@
- 								; for Janus API clients
- json = indented					; Whether the JSON messages should be indented (default),
- 								; plain (no indentation) or compact (no indentation and no spaces)
--path = /tmp/ux-janusapi			; Path to bind to (Janus API)
-+path = /var/run/janus/ux-janusapi		; Path to bind to (Janus API)
- ;type = SOCK_SEQPACKET			; SOCK_SEQPACKET (default) or SOCK_DGRAM?
- 
- ; As with other transport plugins, you can use Unix Sockets to interact
---- a/janus.1
-+++ b/janus.1
-@@ -106,7 +106,7 @@
- .SH EXAMPLES
- \fBjanus\fR \- Launch Janus with all options from configurations files
- .TP
--\fBjanus \-b \-L /tmp/januslog\fR \- Launch Janus as a daemon and log to the specified file
-+\fBjanus \-b \-L /var/log/janus/januslog\fR \- Launch Janus as a daemon and log to the specified file
- .TP
- \fBjanus \-6\fR \- Launch Janus with IPv6 support enabled
- .TP
---- a/plugins/janus_audiobridge.c
-+++ b/plugins/janus_audiobridge.c
-@@ -3357,7 +3357,7 @@
- 		if(audiobridge->record_file)
- 			g_snprintf(filename, 255, "%s", audiobridge->record_file);
- 		else
--			g_snprintf(filename, 255, "/tmp/janus-audioroom-%"SCNu64".wav", audiobridge->room_id);
-+			g_snprintf(filename, 255, "/var/lib/janus/recordings/audioroom-%"SCNu64".wav", audiobridge->room_id);
- 		audiobridge->recording = fopen(filename, "wb");
- 		if(audiobridge->recording == NULL) {
- 			JANUS_LOG(LOG_WARN, "Recording requested, but could NOT open file %s for writing...\n", filename);
---- a/transports/janus_pfunix.c
-+++ b/transports/janus_pfunix.c
-@@ -232,7 +232,7 @@
- 			JANUS_LOG(LOG_WARN, "Unix Sockets server disabled (Janus API)\n");
- 		} else {
- 			item = janus_config_get_item_drilldown(config, "general", "path");
--			char *pfname = (char *)(item && item->value ? item->value : "/tmp/ux-janusapi");
-+			char *pfname = (char *)(item && item->value ? item->value : "/var/run/janus/ux-janusapi");
- 			item = janus_config_get_item_drilldown(config, "general", "type");
- 			const char *type = item && item->value ? item->value : "SOCK_SEQPACKET";
- 			dgram = FALSE;
-@@ -253,7 +253,7 @@
- 			JANUS_LOG(LOG_WARN, "Unix Sockets server disabled (Admin API)\n");
- 		} else {
- 			item = janus_config_get_item_drilldown(config, "admin", "admin_path");
--			char *pfname = (char *)(item && item->value ? item->value : "/tmp/ux-janusadmin");
-+			char *pfname = (char *)(item && item->value ? item->value : "/var/run/janus/ux-janusadmin");
- 			item = janus_config_get_item_drilldown(config, "admin", "admin_type");
- 			const char *type = item && item->value ? item->value : "SOCK_SEQPACKET";
- 			if(!strcasecmp(type, "SOCK_SEQPACKET")) {
---- /dev/null
-+++ b/conf/janus.plugin.audiobridge.cfg.sample.in
-@@ -0,0 +1,23 @@
-+; [<unique room ID>]
-+; description = This is my awesome room
-+; is_private = yes|no (whether this room should be in the public list, default=yes)
-+; secret = <optional password needed for manipulating (e.g. destroying) the room>
-+; pin = <optional password needed for joining the room>
-+; sampling_rate = <sampling rate> (e.g., 16000 for wideband mixing)
-+; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must
-+;		be negotiated/used or not for new joins, default=yes)
-+; record = true|false (whether this room should be recorded, default=false)
-+; record_file = /path/to/recording.wav (where to save the recording)
-+
-+[general]
-+;admin_key = supersecret		; If set, rooms can be created via API only
-+								; if this key is provided in the request
-+;events = no					; Whether events should be sent to event
-+								; handlers (default is yes)
-+
-+[1234]
-+description = Demo Room
-+secret = adminpwd
-+sampling_rate = 16000
-+record = false
-+;record_file = @recordingsdir@/audioroom-1234.wav
---- /dev/null
-+++ b/conf/janus.plugin.videoroom.cfg.sample.in
-@@ -0,0 +1,36 @@
-+; [<unique room ID>]
-+; description = This is my awesome room
-+; is_private = yes|no (whether this room should be in the public list, default=yes)
-+; secret = <optional password needed for manipulating (e.g. destroying) the room>
-+; pin = <optional password needed for joining the room>
-+; publishers = <max number of concurrent senders> (e.g., 6 for a video
-+;              conference or 1 for a webinar)
-+; bitrate = <max video bitrate for senders> (e.g., 128000)
-+; fir_freq = <send a FIR to publishers every fir_freq seconds> (0=disable)
-+; audiocodec = opus|isac32|isac16|pcmu|pcma (audio codec to force on publishers, default=opus)
-+; videocodec = vp8|vp9|h264 (video codec to force on publishers, default=vp8)
-+; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must
-+;		be negotiated/used or not for new publishers, default=yes)
-+; videoorient_ext = yes|no (whether the video-orientation RTP extension must
-+;		be negotiated/used or not for new publishers, default=yes)
-+; playoutdelay_ext = yes|no (whether the playout-delay RTP extension must
-+;		be negotiated/used or not for new publishers, default=yes)
-+; record = true|false (whether this room should be recorded, default=false)
-+; rec_dir = <folder where recordings should be stored, when enabled>
-+
-+[general]
-+;admin_key = supersecret		; If set, rooms can be created via API only
-+								; if this key is provided in the request
-+;events = no					; Whether events should be sent to event
-+								; handlers (default is yes)
-+
-+[1234]
-+description = Demo Room
-+secret = adminpwd
-+publishers = 6
-+bitrate = 128000
-+fir_freq = 10
-+;audiocodec = opus
-+;videocodec = vp8
-+record = false
-+;rec_dir = @recordingsdir@/janus-videoroom
---- /dev/null
-+++ b/conf/janus.plugin.voicemail.cfg.sample.in
-@@ -0,0 +1,10 @@
-+; path = where to place recordings in the file system (should be in a
-+;	properly configured web server, if you want the demo to work)
-+; base = base path to use when returning the recording URI (use this
-+;	to make sure the file in the path you chose is reachable via HTTP)
-+; events = yes|no, whether events should be sent to event handlers
-+
-+[general]
-+path = @recordingsdir@/voicemail/
-+base = /voicemail/
-+events = yes
diff --git a/debian/patches/series b/debian/patches/series
index a6ae120..2b6e2da 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,28 @@
+020170308~462023e.patch
+020170309~3d11cb0.patch
+020170309~f13d55d.patch
+020170310~70043a5.patch
+020170313headers1~7fc815c.patch
+020170313headers2~ba16db3.patch
+020170313headers3~3a9a43f.patch
+020170313~1fa9d73.patch
+020170313~2a6903c.patch
+020170313~d7bfb68.patch
+020170314~d905174.patch
+020170315~67b1d5a.patch
+020170315~6dfa794.patch
+020170315~a83f3cd.patch
+020170315~f947fbe.patch
+020170315~fc72d3a.patch
+020170317~5b868e3.patch
+020170317~7f82f31.patch
+020170317~81d6156.patch
+020170317~9380393.patch
+020170318~dbd48d7.patch
+020170320~cdd6c44.patch
+020170321~fcec9a1.patch
+020170324~938e723.patch
+020170324~9df683d.patch
 1001_try_enable_docs_by_default.patch
 2001_use_snakeoil_cert.patch
-2002_avoid_tmp.patch
 2003_use_packaged_javascript.patch

-- 
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