From e114c6382e68824d4498f62562714860d20804e2 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 14 Apr 2019 19:11:58 +0200 Subject: [PATCH 01/16] FS-11783: [core] quiet gcc truncation warning With -Wstringop-truncation gcc warns about calls to bounded string manipulation function "strncpy" that may either truncate the copied string or leave the destination unchanged. To avoid the warning when the result is not expected to be NUL-terminated, it is suggested to call "memcpy" instead. src/switch_core_media.c: In function 'switch_core_media_patch_sdp': src/switch_core_media.c:11854:4: error: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This commit follows gcc's recommendation. Signed-off-by: Sebastian Kemper --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index b3209eea54..ce04e5642e 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -11858,7 +11858,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session) strncpy(q, p, 7); p += 7; q += 7; - strncpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2); + memcpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2); p +=2; q +=2; strncpy(q, a_engine->adv_sdp_ip, strlen(a_engine->adv_sdp_ip)); From 3ca75eb8efa4e50ebe083a269b75fcb1762daa91 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 14 Apr 2019 19:23:41 +0200 Subject: [PATCH 02/16] FS-11783: [mod_say_ja] quiet overflow warning With -Wformat-overflow gcc warns about calls to formatted input/output function "sprintf" that might overflow the destination buffer. In this case gcc does not know the upper bound of tm_min and assumes that up to 11 bytes might be written to buffer (3 bytes). But we know that tm_min can only be within the range 0 to 59. mod_say_ja.c: In function 'ja_say_time': mod_say_ja.c:376:35: error: '%d' directive writing between 2 and 10 bytes into a region of size 3 [-Werror=format-overflow=] sprintf(buffer, "%d", tm.tm_min); ^~ mod_say_ja.c:376:34: note: directive argument in the range [11, 2147483647] sprintf(buffer, "%d", tm.tm_min); ^~~~ mod_say_ja.c:376:18: note: 'sprintf' output between 3 and 11 bytes into a destination of size 3 sprintf(buffer, "%d", tm.tm_min); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This commits adds a hint for gcc, which silences the warning. Signed-off-by: Sebastian Kemper --- src/mod/say/mod_say_ja/mod_say_ja.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/say/mod_say_ja/mod_say_ja.c b/src/mod/say/mod_say_ja/mod_say_ja.c index 72c7c38131..d8e0692fd0 100644 --- a/src/mod/say/mod_say_ja/mod_say_ja.c +++ b/src/mod/say/mod_say_ja/mod_say_ja.c @@ -367,7 +367,8 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay, say_file("time/pm.wav"); } say_file("time/hour-%d.wav", tm.tm_hour); - if (tm.tm_min > 10) { + /* tm_min is always < 60 - this is just to silence gcc 8 warning */ + if (tm.tm_min > 10 && tm.tm_min < 60) { int temp; char tch[1+1]; mod_min = tm.tm_min % 10; From 69f3dfe779a25b699025f10a689996bce92d9822 Mon Sep 17 00:00:00 2001 From: Konstantin Molchanov Date: Tue, 18 Jun 2019 12:47:39 +0300 Subject: [PATCH 03/16] FS-11892 [switch_console] fix stream write_function --- src/switch_console.c | 4 +- tests/unit/Makefile.am | 2 +- tests/unit/switch_console.c | 82 +++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 tests/unit/switch_console.c diff --git a/src/switch_console.c b/src/switch_console.c index 876b77434e..ec891d44b4 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -150,7 +150,6 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_raw_write(switch_st SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt, ...) { va_list ap; - char *buf = handle->data; char *end = handle->end; int ret = 0; char *data = NULL; @@ -178,7 +177,6 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream if ((new_data = realloc(handle->data, new_len))) { handle->data_size = handle->alloc_len = new_len; handle->data = new_data; - buf = handle->data; remaining = handle->data_size - handle->data_len; handle->end = (uint8_t *) (handle->data) + handle->data_len; end = handle->end; @@ -194,7 +192,7 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream } else { ret = 0; switch_snprintf(end, remaining, "%s", data); - handle->data_len = strlen(buf); + handle->data_len += strlen(data); handle->end = (uint8_t *) (handle->data) + handle->data_len; } free(data); diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 76f757ed82..d30299e169 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/build/modmake.rulesam -bin_PROGRAMS = switch_event switch_hash switch_ivr_originate switch_utils switch_core +bin_PROGRAMS = switch_event switch_hash switch_ivr_originate switch_utils switch_core switch_console AM_LDFLAGS = -avoid-version -no-undefined $(SWITCH_AM_LDFLAGS) $(openssl_LIBS) AM_LDFLAGS += $(FREESWITCH_LIBS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) AM_CFLAGS = $(SWITCH_AM_CPPFLAGS) diff --git a/tests/unit/switch_console.c b/tests/unit/switch_console.c new file mode 100644 index 0000000000..547b6f01ee --- /dev/null +++ b/tests/unit/switch_console.c @@ -0,0 +1,82 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2018, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Konstantin Molchanov + * + * + * switch_utils.c -- tests switch_utils + * + */ + +#include +#include +#include + +FST_MINCORE_BEGIN() + +FST_SUITE_BEGIN(SWITCH_STANDARD_STREAM) + +FST_SETUP_BEGIN() +{ +} +FST_SETUP_END() + +FST_TEARDOWN_BEGIN() +{ +} +FST_TEARDOWN_END() + +FST_TEST_BEGIN(benchmark) +{ + switch_stream_handle_t stream = { 0 }; + SWITCH_STANDARD_STREAM(stream); + + char expected_result[] = {'A', 0x00, 0x01, 0x02, 'B'}; + char raw_data[] = {0x00, 0x01, 0x02}; + + stream.write_function(&stream, "%s", "A"); + stream.raw_write_function(&stream, (uint8_t *) raw_data, sizeof(raw_data)); + stream.write_function(&stream, "B"); + + fst_requires(stream.data_len == sizeof(expected_result)); + fst_requires(memcmp(stream.data, expected_result, sizeof(expected_result)) == 0); + + switch_safe_free(stream.data); +} +FST_TEST_END() + +FST_SUITE_END() + +FST_MINCORE_END() + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet: + */ From 0d895c50f5a01389bfe1af60b45450bf98df9e71 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 21 Jun 2019 20:58:12 +0400 Subject: [PATCH 04/16] FS-11421: [mod_sofia] Cleanup. --- src/mod/endpoints/mod_sofia/mod_sofia.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c2900cf515..0da976608d 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2183,7 +2183,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi break; case SWITCH_MESSAGE_INDICATE_RESPOND: { - printf("WHAT THE FUCKING HELL? %d\n", switch_channel_test_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE)); if (switch_channel_test_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE)) { switch_channel_clear_flag(tech_pvt->channel, CF_AWAITING_STREAM_CHANGE); From ad7db399999b647bfb18a25a622069f31c3dd730 Mon Sep 17 00:00:00 2001 From: lazedo Date: Tue, 25 Jun 2019 14:54:47 +0000 Subject: [PATCH 05/16] FS-11732 [mod_kazoo] ei_init added in OTP 21.3 --- src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c index 7a2e62c925..c1b792f490 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c @@ -519,8 +519,8 @@ switch_status_t create_acceptor() { char ipbuf[48]; const char *ip_addr; -#if ERLANG_MAJOR >= 10 - ei_init(); +#if (ERLANG_MAJOR == 10 && ERLANG_MINOR >= 3) || ERLANG_MAJOR >= 11 + ei_init(); #endif /* if the config has specified an erlang release compatibility then pass that along to the erlang interface */ From 42e4016f27cfc6aed00e3499fd67d96696525e49 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 13:02:51 -0400 Subject: [PATCH 06/16] FS-11895: [osx] fix finding of ffmpeg/libav on OSx --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index be354f41bf..1c58ae167e 100644 --- a/configure.ac +++ b/configure.ac @@ -1247,6 +1247,7 @@ case $host in path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/ path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/ path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/ + path_push_unique PKG_CONFIG_PATH /usr/local/opt/ffmpeg/lib/pkgconfig/ ;; esac From 03077d313321ca09655e7d9d9289cb261928f619 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 14:20:14 -0400 Subject: [PATCH 07/16] FS-11895: [osx] fix mod_av osx test build --- configure.ac | 1 - src/mod/applications/mod_av/Makefile.am | 19 +++++++++++++++---- src/mod/applications/mod_av/test/Makefile.am | 4 ---- .../applications/mod_av/test/test_avformat.c | 6 +++--- 4 files changed, 18 insertions(+), 12 deletions(-) delete mode 100644 src/mod/applications/mod_av/test/Makefile.am diff --git a/configure.ac b/configure.ac index 1c58ae167e..8cab4a889d 100644 --- a/configure.ac +++ b/configure.ac @@ -2003,7 +2003,6 @@ AC_CONFIG_FILES([Makefile src/mod/xml_int/mod_xml_rpc/Makefile src/mod/xml_int/mod_xml_scgi/Makefile src/mod/applications/mod_av/Makefile - src/mod/applications/mod_av/test/Makefile src/mod/applications/mod_video_filter/Makefile src/include/switch_am_config.h build/getsounds.sh diff --git a/src/mod/applications/mod_av/Makefile.am b/src/mod/applications/mod_av/Makefile.am index cefcdcf113..675eb514b0 100644 --- a/src/mod/applications/mod_av/Makefile.am +++ b/src/mod/applications/mod_av/Makefile.am @@ -3,13 +3,24 @@ MODNAME=mod_av if HAVE_AVFORMAT +noinst_LTLIBRARIES = libavmod.la + +libavmod_la_SOURCES = mod_av.c avformat.c avcodec.c +libavmod_la_CFLAGS = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(AVRESAMPLE_CFALGS) + mod_LTLIBRARIES = mod_av.la -mod_av_la_SOURCES = mod_av.c avformat.c avcodec.c -mod_av_la_CFLAGS = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(AVRESAMPLE_CFALGS) -mod_av_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(AVFORMAT_LIBS) $(AVCODEC_LIBS) $(SWSCALE_LIBS) $(AVUTIL_LIBS) $(AVRESAMPLE_LIBS) +mod_av_la_SOURCES = +mod_av_la_LIBADD = libavmod.la $(switch_builddir)/libfreeswitch.la $(AVFORMAT_LIBS) $(AVCODEC_LIBS) $(SWSCALE_LIBS) $(AVUTIL_LIBS) $(AVRESAMPLE_LIBS) mod_av_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lm -lz -SUBDIRS=. test + +bin_PROGRAMS = test/test_mod_av test/test_avformat +AM_CFLAGS = $(SWITCH_AM_CFLAGS) -I../ $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(AVRESAMPLE_CFALGS) +AM_LDFLAGS = $(AVFORMAT_LIBS) $(AVCODEC_LIBS) $(SWSCALE_LIBS) $(AVUTIL_LIBS) $(AVRESAMPLE_LIBS) -avoid-version -no-undefined $(SWITCH_AM_LDFLAGS) +TESTS = $(bin_PROGRAMS) + +test_test_mod_av_LDADD = libavmod.la $(switch_builddir)/libfreeswitch.la +test_test_avformat_LDADD = libavmod.la $(switch_builddir)/libfreeswitch.la else install: error diff --git a/src/mod/applications/mod_av/test/Makefile.am b/src/mod/applications/mod_av/test/Makefile.am deleted file mode 100644 index b7111a2275..0000000000 --- a/src/mod/applications/mod_av/test/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = test_mod_av test_avformat -AM_CFLAGS = $(SWITCH_AM_CFLAGS) -I../ $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(AVRESAMPLE_CFALGS) -AM_LDFLAGS = $(switch_builddir)/libfreeswitch.la $(AVFORMAT_LIBS) $(AVCODEC_LIBS) $(SWSCALE_LIBS) $(AVUTIL_LIBS) $(AVRESAMPLE_LIBS) -avoid-version -no-undefined $(SWITCH_AM_LDFLAGS) ../mod_av.la -TESTS = $(bin_PROGRAMS) diff --git a/src/mod/applications/mod_av/test/test_avformat.c b/src/mod/applications/mod_av/test/test_avformat.c index fed0264d34..a9484d9058 100644 --- a/src/mod/applications/mod_av/test/test_avformat.c +++ b/src/mod/applications/mod_av/test/test_avformat.c @@ -156,9 +156,9 @@ FST_CORE_BEGIN("conf") FST_TEARDOWN_BEGIN() { - const char *err = NULL; - switch_sleep(1000000); - //fst_check(switch_loadable_module_unload_module(SWITCH_GLOBAL_dirs.mod_dir, (char *)"mod_av", SWITCH_TRUE, &err) == SWITCH_STATUS_SUCCESS); + //const char *err = NULL; + switch_sleep(1000000); + //fst_check(switch_loadable_module_unload_module(SWITCH_GLOBAL_dirs.mod_dir, (char *)"mod_av", SWITCH_TRUE, &err) == SWITCH_STATUS_SUCCESS); } FST_TEARDOWN_END() } From 8e129b913d32822e42019588f2bddc9030b8455f Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 15:30:21 -0400 Subject: [PATCH 08/16] FS-11906: [mod_sofia] fix NDLB-allow-bad-iananame profile param --- src/mod/endpoints/mod_sofia/sofia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index d1e32a096f..739a7d7078 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5389,9 +5389,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } } else if (!strcasecmp(var, "NDLB-allow-bad-iananame")) { if (switch_true(val)) { - profile->mndlb |= SM_NDLB_ALLOW_BAD_IANANAME; + profile->ndlb |= SM_NDLB_ALLOW_BAD_IANANAME; } else { - profile->mndlb &= ~SM_NDLB_ALLOW_BAD_IANANAME; + profile->ndlb &= ~SM_NDLB_ALLOW_BAD_IANANAME; } } else if (!strcasecmp(var, "NDLB-expires-in-register-response")) { if (switch_true(val)) { From 25192d7d24dfefa9696ca3598150d4a58e70a3ff Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 15:55:46 -0400 Subject: [PATCH 09/16] FS-11895: [build] fix test build --- src/mod/applications/mod_av/test/test_avformat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_av/test/test_avformat.c b/src/mod/applications/mod_av/test/test_avformat.c index a9484d9058..b03cae80cc 100644 --- a/src/mod/applications/mod_av/test/test_avformat.c +++ b/src/mod/applications/mod_av/test/test_avformat.c @@ -52,6 +52,7 @@ FST_CORE_BEGIN("conf") switch_size_t len = SAMPLES; uint32_t flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO; int i = 0; + switch_image_t *ccimg; fst_requires(img); @@ -68,7 +69,7 @@ FST_CORE_BEGIN("conf") status = switch_core_file_write_video(&fh, &frame); fst_check(status == SWITCH_STATUS_SUCCESS); - switch_image_t *ccimg = switch_img_read_png("./cluecon.png", SWITCH_IMG_FMT_ARGB); + ccimg = switch_img_read_png("./cluecon.png", SWITCH_IMG_FMT_ARGB); fst_requires(ccimg); switch_rgb_color_t color = {0}; From 69af7afd4d3ed5ccc580853bef1f5c58ec7f9bd5 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 16:42:33 -0400 Subject: [PATCH 10/16] FS-11895: [build] fix test build --- src/mod/applications/mod_av/test/test_mod_av.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mod/applications/mod_av/test/test_mod_av.c b/src/mod/applications/mod_av/test/test_mod_av.c index 51e594f344..14ee022dab 100644 --- a/src/mod/applications/mod_av/test/test_mod_av.c +++ b/src/mod/applications/mod_av/test/test_mod_av.c @@ -50,9 +50,10 @@ static fctcl_init_t my_cl_options[] = { FST_CORE_BEGIN("conf") { + const char *loop_; fctcl_install(my_cl_options); - const char *loop_ = fctcl_val("--loop"); + loop_ = fctcl_val("--loop"); if (loop_) loop = atoi(loop_); FST_MODULE_BEGIN(mod_av, mod_av_test) @@ -68,6 +69,11 @@ FST_CORE_BEGIN("conf") switch_status_t status; switch_codec_t codec = { 0 }; switch_codec_settings_t codec_settings = { 0 }; + switch_image_t *img; + uint8_t buf[SWITCH_DEFAULT_VIDEO_SIZE + 12]; + switch_frame_t frame = { 0 }; + int packets = 0; + switch_status_t encode_status; // switch_set_string(codec_settings.video.config_profile_name, "conference"); @@ -85,11 +91,9 @@ FST_CORE_BEGIN("conf") &codec_settings, fst_pool); fst_check(status == SWITCH_STATUS_SUCCESS); - switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 1280, 720, 1); + img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 1280, 720, 1); fst_requires(img); - uint8_t buf[SWITCH_DEFAULT_VIDEO_SIZE + 12]; - switch_frame_t frame = { 0 }; frame.packet = buf; frame.packetlen = SWITCH_DEFAULT_VIDEO_SIZE + 12; @@ -101,9 +105,6 @@ FST_CORE_BEGIN("conf") frame.timestamp = 0; frame.img = img; - int packets = 0; - switch_status_t encode_status; - do { frame.datalen = SWITCH_DEFAULT_VIDEO_SIZE; encode_status = switch_core_codec_encode_video(&codec, &frame); From 4816af2f56695dca85d08c2cda8ff18c94290d14 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 27 Jun 2019 17:52:27 -0400 Subject: [PATCH 11/16] FS-11895: [build] fix test build --- src/mod/applications/mod_av/test/test_avformat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_av/test/test_avformat.c b/src/mod/applications/mod_av/test/test_avformat.c index b03cae80cc..de7150e3c9 100644 --- a/src/mod/applications/mod_av/test/test_avformat.c +++ b/src/mod/applications/mod_av/test/test_avformat.c @@ -53,6 +53,7 @@ FST_CORE_BEGIN("conf") uint32_t flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO; int i = 0; switch_image_t *ccimg; + switch_rgb_color_t color = {0}; fst_requires(img); @@ -72,7 +73,6 @@ FST_CORE_BEGIN("conf") ccimg = switch_img_read_png("./cluecon.png", SWITCH_IMG_FMT_ARGB); fst_requires(ccimg); - switch_rgb_color_t color = {0}; color.a = 255; for (i = 0; i < 30; i++) { @@ -109,6 +109,8 @@ FST_CORE_BEGIN("conf") switch_size_t len = SAMPLES; uint32_t flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO; int i = 0; + switch_rgb_color_t color = {0}; + switch_image_t *ccimg; fst_requires(img); @@ -125,10 +127,9 @@ FST_CORE_BEGIN("conf") status = switch_core_file_write_video(&fh, &frame); fst_check(status == SWITCH_STATUS_SUCCESS); - switch_image_t *ccimg = switch_img_read_png("./cluecon.png", SWITCH_IMG_FMT_ARGB); + ccimg = switch_img_read_png("./cluecon.png", SWITCH_IMG_FMT_ARGB); fst_requires(ccimg); - switch_rgb_color_t color = {0}; color.a = 255; for (i = 0; i < 30; i++) { From 4306efffbe4dd3910b04ce90a00fcc4234a016ba Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 29 Jun 2019 01:02:36 +0400 Subject: [PATCH 12/16] FS-11895: [build] fix test build --- src/mod/applications/mod_av/test/test_mod_av.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_av/test/test_mod_av.c b/src/mod/applications/mod_av/test/test_mod_av.c index 14ee022dab..18d3dfa225 100644 --- a/src/mod/applications/mod_av/test/test_mod_av.c +++ b/src/mod/applications/mod_av/test/test_mod_av.c @@ -68,7 +68,7 @@ FST_CORE_BEGIN("conf") { switch_status_t status; switch_codec_t codec = { 0 }; - switch_codec_settings_t codec_settings = { 0 }; + switch_codec_settings_t codec_settings = {{ 0 }}; switch_image_t *img; uint8_t buf[SWITCH_DEFAULT_VIDEO_SIZE + 12]; switch_frame_t frame = { 0 }; From cc61f11427bbad8b302407c902fe04cd10fa4f91 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 29 Jun 2019 02:13:34 +0400 Subject: [PATCH 13/16] Revert "FS-11417: [mod_conference] Unbounded memory growth during screen share #resolve" This reverts commit 143323e6ef466f51ed3aa3f1e6b7cd938ccba06e. --- .../mod_conference/conference_loop.c | 6 +----- .../mod_conference/mod_conference.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 78024f10de..49377312c6 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -939,10 +939,6 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob goto do_continue; } - if (!switch_channel_test_app_flag(channel, CF_AUDIO)) { - goto do_continue; - } - /* if the member can speak, compute the audio energy level and */ /* generate events when the level crosses the threshold */ if (((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) || @@ -1232,7 +1228,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob if (datalen) { switch_size_t ok = 1; - + /* Write the audio into the input buffer */ switch_mutex_lock(member->audio_in_mutex); if (switch_buffer_inuse(member->audio_buffer) > flush_len) { diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 86be4911a8..5562272309 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -611,7 +611,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob for (omember = conference->members; omember; omember = omember->next) { switch_size_t ok = 1; - if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) { + if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) { continue; } @@ -667,14 +667,13 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob write_frame[x] = (int16_t) z; } - if (switch_channel_test_flag(omember->channel, CF_AUDIO)) { - switch_mutex_lock(omember->audio_out_mutex); - ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes); - switch_mutex_unlock(omember->audio_out_mutex); - if (!ok) { - switch_mutex_unlock(conference->mutex); - goto end; - } + switch_mutex_lock(omember->audio_out_mutex); + ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes); + switch_mutex_unlock(omember->audio_out_mutex); + + if (!ok) { + switch_mutex_unlock(conference->mutex); + goto end; } } } else { /* There is no source audio. Push silence into all of the buffers */ @@ -689,7 +688,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob for (omember = conference->members; omember; omember = omember->next) { switch_size_t ok = 1; - if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) { + if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) { continue; } From 359287ffe257fc9130bbb5c761e72109ae5a52e4 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 29 Jun 2019 03:17:41 +0400 Subject: [PATCH 14/16] FS-11902: [Core] Remove duplicate database indexes. --- src/switch_core_sqldb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 02e6897778..feb69d6b8e 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -3583,8 +3583,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_create_schema(sql_manager.dbh, "create index complete10 on complete (a10,hostname)", NULL); switch_cache_db_create_schema(sql_manager.dbh, "create index complete11 on complete (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,hostname)", NULL); switch_cache_db_create_schema(sql_manager.dbh, "create index nat_map_port_proto on nat (port,proto,hostname)", NULL); - switch_cache_db_create_schema(sql_manager.dbh, "create index channels1 on channels(hostname)", NULL); - switch_cache_db_create_schema(sql_manager.dbh, "create index calls1 on calls(hostname)", NULL); switch_cache_db_create_schema(sql_manager.dbh, "create index chidx1 on channels (hostname)", NULL); switch_cache_db_create_schema(sql_manager.dbh, "create index uuindex on channels (uuid, hostname)", NULL); switch_cache_db_create_schema(sql_manager.dbh, "create index uuindex2 on channels (call_uuid)", NULL); From 488d3725ff742ff3601dc2da4dcbfa2768458821 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 29 Jun 2019 20:50:30 +0400 Subject: [PATCH 15/16] FS-11795: Bump sound versions, add es-ar-mario metadata --- build/sounds_upgradecode.txt | 1 + build/sounds_version.txt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build/sounds_upgradecode.txt b/build/sounds_upgradecode.txt index ec5ec47e48..538707e241 100644 --- a/build/sounds_upgradecode.txt +++ b/build/sounds_upgradecode.txt @@ -3,6 +3,7 @@ en-us-callie deb95334-fcd2-4b8a-91e7-a7828b99389d 249bfdc8-cb08-4ad5-9e38-06094e en-us-allison 61179bb5-2289-4ae1-8a74-4e3d2821b691 2754130e-8896-4180-9227-a4ca2102c7c3 5b78a401-7244-438d-b83e-c944073842fd 13b50511-6f6d-43cf-a8b1-515c83708527 ru-RU-elena 9e0697a5-57b5-4f79-b95a-c85957f2a327 e52ebf36-ef86-41a5-8adf-1fcff6c42366 bfa6fdd6-fd24-4c9e-889d-88bcbbd173aa c088aedf-45ee-4cd5-8bfb-a64834affa9f en-ca-june 649e7650-8298-4eba-ad59-2e0c49c0f79d f3134354-4b8e-4838-a2b6-62d8ffc2e877 e84dbde6-272c-472b-ab67-307c4b4ca0d0 79fb31f3-1f2f-4f5c-983b-1fe98b56af11 +es-ar-mario 68968243-6083-43d1-b259-d5f6e52805dc 9c5ba2ef-4b98-465a-b520-b7a85f83cacf f9e18881-412d-433f-807e-538ff339e043 cd298723-2987-484c-86a5-9e5512f12881 fr-ca-june 5ad7d0be-5164-416a-a86c-8d04eed94612 ed777145-13bd-44b1-bdbb-475f90ddfcb0 d98b2cfb-2a16-49de-8bda-10aa20845c0a 5c8a40ea-f2fa-463a-8e80-fbb2be65d7b4 pt-BR-karina 967a03cd-0df7-42ff-a396-8fe03c2c2fa3 79e264fb-0515-442d-900e-b7b979957faa 8801315b-5f27-4088-8b66-44d1fc4b1584 5152ae5e-bf0e-4f86-abf4-ecc8f0887932 sv-se-jakob ee23c4fa-63c9-4ab5-a11c-ec9d124664b9 d2af540d-6544-45e0-8443-f3c39d983cbd f8130d60-6cce-4cac-a2d1-dd046691accd f404fbe3-13c7-4cff-96a0-14634b7f8543 diff --git a/build/sounds_version.txt b/build/sounds_version.txt index 4c4f290b82..cb49a43745 100644 --- a/build/sounds_version.txt +++ b/build/sounds_version.txt @@ -1,7 +1,8 @@ -en-us-callie 1.0.51 -en-us-allison 1.0.0 +en-us-callie 1.0.52 +en-us-allison 1.0.1 ru-RU-elena 1.0.51 en-ca-june 1.0.51 +es-ar-mario 1.0.0 fr-ca-june 1.0.51 pt-BR-karina 1.0.51 sv-se-jakob 1.0.50 From 1d68ab18f4cac5e72addd97e885e567bac6ed206 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 29 Jun 2019 20:54:32 +0400 Subject: [PATCH 16/16] FS-11797: Add metadata for two new Russian sound sets: ru/RU/kirill and ru/RU/vika --- build/sounds_upgradecode.txt | 2 ++ build/sounds_version.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build/sounds_upgradecode.txt b/build/sounds_upgradecode.txt index 538707e241..1ba75c4b9c 100644 --- a/build/sounds_upgradecode.txt +++ b/build/sounds_upgradecode.txt @@ -2,6 +2,8 @@ music c0dcf85a-d07d-4c73-97ca-c327d9755830 85f85500-b86d-4f51-abf5-3cd63a2cc52d en-us-callie deb95334-fcd2-4b8a-91e7-a7828b99389d 249bfdc8-cb08-4ad5-9e38-06094e231d35 ef6db7d9-df8d-43e2-a3ec-16dd3fe1ac1b d515dc88-08df-4499-a6af-434cc5f68f86 en-us-allison 61179bb5-2289-4ae1-8a74-4e3d2821b691 2754130e-8896-4180-9227-a4ca2102c7c3 5b78a401-7244-438d-b83e-c944073842fd 13b50511-6f6d-43cf-a8b1-515c83708527 ru-RU-elena 9e0697a5-57b5-4f79-b95a-c85957f2a327 e52ebf36-ef86-41a5-8adf-1fcff6c42366 bfa6fdd6-fd24-4c9e-889d-88bcbbd173aa c088aedf-45ee-4cd5-8bfb-a64834affa9f +ru-RU-kirill a6eaa704-213c-41fe-9de6-d762e02d5a63 ab3ead40-330e-4a9b-836d-08a59b5b17a3 e8cbfbf9-f280-43fb-b0cd-3b5b35d21d57 30b7d223-d0ed-406e-b4bc-5e83afcfe3ce +ru-RU-vika a14d6d84-3d40-4b84-9183-5c5d79a50d80 98dda84e-5818-4c6d-9e5e-2f9bfa9fefb3 897e2415-1043-44df-963c-5e887e0132b0 e4e843ac-0ab7-4f9f-9b79-267e45c01554 en-ca-june 649e7650-8298-4eba-ad59-2e0c49c0f79d f3134354-4b8e-4838-a2b6-62d8ffc2e877 e84dbde6-272c-472b-ab67-307c4b4ca0d0 79fb31f3-1f2f-4f5c-983b-1fe98b56af11 es-ar-mario 68968243-6083-43d1-b259-d5f6e52805dc 9c5ba2ef-4b98-465a-b520-b7a85f83cacf f9e18881-412d-433f-807e-538ff339e043 cd298723-2987-484c-86a5-9e5512f12881 fr-ca-june 5ad7d0be-5164-416a-a86c-8d04eed94612 ed777145-13bd-44b1-bdbb-475f90ddfcb0 d98b2cfb-2a16-49de-8bda-10aa20845c0a 5c8a40ea-f2fa-463a-8e80-fbb2be65d7b4 diff --git a/build/sounds_version.txt b/build/sounds_version.txt index cb49a43745..b0b46ff4e2 100644 --- a/build/sounds_version.txt +++ b/build/sounds_version.txt @@ -1,6 +1,8 @@ en-us-callie 1.0.52 en-us-allison 1.0.1 ru-RU-elena 1.0.51 +ru-RU-kirill 1.0.0 +ru-RU-vika 1.0.0 en-ca-june 1.0.51 es-ar-mario 1.0.0 fr-ca-june 1.0.51