Skip to content

Commit

Permalink
Several changes and fixes
Browse files Browse the repository at this point in the history
Fixed configure.ac for default plugin dependencies;
Renamed configuration files as samples, and added a 'make configs' target to turn them into configuration files (and avoid overwriting them at each 'make install');
Replaced all sprintf with g_snprintf (issue meetecho#60)
Modified freeing of mcu participants/listeners to use a watchdog (attempt to fix issue meetecho#69)
Other fixes here and there
  • Loading branch information
meetecho committed Oct 1, 2014
1 parent ee8a5e0 commit c94052c
Show file tree
Hide file tree
Showing 24 changed files with 730 additions and 430 deletions.
46 changes: 27 additions & 19 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CLEANFILES = $(NULL)
bin_PROGRAMS = janus

confdir = $(sysconfdir)/janus
conf_DATA = conf/janus.cfg
conf_DATA = conf/janus.cfg.sample

certdir = $(datadir)/janus/certs
cert_DATA = certs/mycert.key certs/mycert.pem
Expand All @@ -39,7 +39,7 @@ html_DATA = README.md
streamdir = $(datadir)/janus/streams
stream_DATA = $(NULL)

%.cfg: %.cfg.in
%.sample: %.sample.in
$(MKDIR_P) $(@D)
$(AM_V_GEN) sed -e "\
s|[@]confdir[@]|$(confdir)|;\
Expand All @@ -48,8 +48,8 @@ stream_DATA = $(NULL)
s|[@]streamdir[@]|$(streamdir)|" \
$< > $@ || rm $@

EXTRA_DIST += conf/janus.cfg.in
CLEANFILES += conf/janus.cfg
EXTRA_DIST += conf/janus.cfg.sample.in
CLEANFILES += conf/janus.cfg.sample

##
# Janus
Expand Down Expand Up @@ -132,8 +132,8 @@ plugins_libjanus_audiobridge_la_SOURCES = plugins/janus_audiobridge.c
plugins_libjanus_audiobridge_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_audiobridge_la_LDFLAGS = $(plugins_ldflags) -lopus
plugins_libjanus_audiobridge_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.audiobridge.cfg
EXTRA_DIST += conf/janus.plugin.audiobridge.cfg
conf_DATA += conf/janus.plugin.audiobridge.cfg.sample
EXTRA_DIST += conf/janus.plugin.audiobridge.cfg.sample
endif

if ENABLE_PLUGIN_ECHOTEST
Expand All @@ -142,8 +142,8 @@ plugins_libjanus_echotest_la_SOURCES = plugins/janus_echotest.c
plugins_libjanus_echotest_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_echotest_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_echotest_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.echotest.cfg
EXTRA_DIST += conf/janus.plugin.echotest.cfg
conf_DATA += conf/janus.plugin.echotest.cfg.sample
EXTRA_DIST += conf/janus.plugin.echotest.cfg.sample
endif

if ENABLE_PLUGIN_SIP
Expand All @@ -152,8 +152,8 @@ plugins_libjanus_sip_la_SOURCES = plugins/janus_sip.c
plugins_libjanus_sip_la_CFLAGS = $(plugins_cflags) $(PLUGIN_SIP_CFLAGS)
plugins_libjanus_sip_la_LDFLAGS = $(plugins_ldflags) $(PLUGIN_SIP_LDFLAGS)
plugins_libjanus_sip_la_LIBADD = $(plugins_libadd) $(PLUGIN_SIP_LIBADD)
conf_DATA += conf/janus.plugin.sip.cfg
EXTRA_DIST += conf/janus.plugin.sip.cfg
conf_DATA += conf/janus.plugin.sip.cfg.sample
EXTRA_DIST += conf/janus.plugin.sip.cfg.sample
endif

if ENABLE_PLUGIN_STREAMING
Expand All @@ -162,16 +162,16 @@ plugins_libjanus_streaming_la_SOURCES = plugins/janus_streaming.c
plugins_libjanus_streaming_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_streaming_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_streaming_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.streaming.cfg
conf_DATA += conf/janus.plugin.streaming.cfg.sample
stream_DATA += \
plugins/streams/music.mulaw \
plugins/streams/radio.alaw \
plugins/streams/test_gstreamer.sh \
plugins/streams/test_gstreamer_1.sh
EXTRA_DIST += \
conf/janus.plugin.streaming.cfg.in \
conf/janus.plugin.streaming.cfg.sample.in \
$(stream_DATA)
CLEANFILES += conf/janus.plugin.streaming.cfg
CLEANFILES += conf/janus.plugin.streaming.cfg.sample
endif

if ENABLE_PLUGIN_VIDEOCALL
Expand All @@ -180,8 +180,8 @@ plugins_libjanus_videocall_la_SOURCES = plugins/janus_videocall.c
plugins_libjanus_videocall_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_videocall_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_videocall_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.videocall.cfg
EXTRA_DIST += conf/janus.plugin.videocall.cfg
conf_DATA += conf/janus.plugin.videocall.cfg.sample
EXTRA_DIST += conf/janus.plugin.videocall.cfg.sample
endif

if ENABLE_PLUGIN_VIDEOROOM
Expand All @@ -190,8 +190,8 @@ plugins_libjanus_videoroom_la_SOURCES = plugins/janus_videoroom.c
plugins_libjanus_videoroom_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_videoroom_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_videoroom_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.videoroom.cfg
EXTRA_DIST += conf/janus.plugin.videoroom.cfg
conf_DATA += conf/janus.plugin.videoroom.cfg.sample
EXTRA_DIST += conf/janus.plugin.videoroom.cfg.sample
endif

if ENABLE_PLUGIN_VOICEMAIL
Expand All @@ -200,8 +200,8 @@ plugins_libjanus_voicemail_la_SOURCES = plugins/janus_voicemail.c
plugins_libjanus_voicemail_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_voicemail_la_LDFLAGS = $(plugins_ldflags) -logg
plugins_libjanus_voicemail_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.voicemail.cfg
EXTRA_DIST += conf/janus.plugin.voicemail.cfg
conf_DATA += conf/janus.plugin.voicemail.cfg.sample
EXTRA_DIST += conf/janus.plugin.voicemail.cfg.sample
endif

##
Expand Down Expand Up @@ -237,3 +237,11 @@ endif
if ENABLE_DOCS
SUBDIRS += docs
endif

##
# Configuration
##

configs:
$(MKDIR_P) $(confdir)
$(foreach config,$(conf_DATA),cp "$(CURDIR)/$(config)" "$(confdir)/$(notdir $(basename $(config) .sample))";)
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ usual to start the whole compilation process:
make
make install

* *Note:* please beware that subsequent ```make install``` commands will
likely overwrite any configuration file you may have edited, so make
sure you backup them before updating a Janus installation.
To also automatically install the default configuration files to use,
also do a:

make configs

If you're not interested in Data Channels, WebSockets and/or RabbitMQ
(or you don't care about either of them) you can disable them when
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ PKG_CHECK_MODULES([PLUGINS],
[
glib-2.0 >= glib_version
sofia-sip-ua
jansson
ini_config
])

AC_ARG_ENABLE([plugin-audiobridge],
Expand Down
4 changes: 2 additions & 2 deletions dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ gint janus_dtls_srtp_init(gchar *server_pem, gchar *server_key) {
char *lfp = (char *)&local_fingerprint;
unsigned int i = 0;
for(i = 0; i < size; i++) {
sprintf(lfp, "%.2X:", fingerprint[i]);
g_snprintf(lfp, 4, "%.2X:", fingerprint[i]);
lfp += 3;
}
*(lfp-1) = 0;
Expand Down Expand Up @@ -340,7 +340,7 @@ void janus_dtls_srtp_incoming_msg(janus_dtls_srtp *dtls, char *buf, uint16_t len
rcert = NULL;
unsigned int i = 0;
for(i = 0; i < rsize; i++) {
sprintf(rfp, "%.2X:", rfingerprint[i]);
g_snprintf(rfp, 4, "%.2X:", rfingerprint[i]);
rfp += 3;
}
*(rfp-1) = 0;
Expand Down
8 changes: 4 additions & 4 deletions ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ void janus_ice_candidates_to_sdp(janus_ice_handle *handle, char *sdp, guint stre
gchar buffer[100];
if(c->type == NICE_CANDIDATE_TYPE_HOST) {
/* 'host' candidate */
g_sprintf(buffer,
g_snprintf(buffer, 100,
"a=candidate:%s %d %s %d %s %d typ host\r\n",
c->foundation,
c->component_id,
Expand All @@ -877,7 +877,7 @@ void janus_ice_candidates_to_sdp(janus_ice_handle *handle, char *sdp, guint stre
/* 'srflx' candidate */
nice_address_to_string(&(c->base_addr), (gchar *)&base_address);
gint base_port = nice_address_get_port(&(c->base_addr));
g_sprintf(buffer,
g_snprintf(buffer, 100,
"a=candidate:%s %d %s %d %s %d typ srflx raddr %s rport %d\r\n",
c->foundation,
c->component_id,
Expand All @@ -889,7 +889,7 @@ void janus_ice_candidates_to_sdp(janus_ice_handle *handle, char *sdp, guint stre
base_port);
} else if(c->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE) {
/* 'prflx' candidate */
g_sprintf(buffer,
g_snprintf(buffer, 100,
"a=candidate:%s %d %s %d %s %d typ prflx raddr %s rport %d\r\n",
c->foundation,
c->component_id,
Expand All @@ -901,7 +901,7 @@ void janus_ice_candidates_to_sdp(janus_ice_handle *handle, char *sdp, guint stre
base_port);
} else if(c->type == NICE_CANDIDATE_TYPE_RELAYED) {
/* 'relay' candidate */
g_sprintf(buffer,
g_snprintf(buffer, 100,
"a=candidate:%s %d %s %d %s %d typ relay raddr %s rport %d\r\n",
c->foundation,
c->component_id,
Expand Down
Loading

0 comments on commit c94052c

Please sign in to comment.