From cf04dd3e75d325348767b65cdefdf122795d6121 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Sun, 9 Mar 2014 11:31:00 -0400 Subject: [PATCH 01/28] FS-6326 --resolve switch_core_hash_init_nocase changed and mod_http_cache wasn't updated --- src/mod/applications/mod_http_cache/mod_http_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.c b/src/mod/applications/mod_http_cache/mod_http_cache.c index fd003ade80..625fe236bb 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -1633,7 +1633,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load) gcache.pool = pool; switch_core_hash_init(&gcache.map); switch_core_hash_init(&gcache.profiles); - switch_core_hash_init_nocase(&gcache.fqdn_profiles, gcache.pool); + switch_core_hash_init_nocase(&gcache.fqdn_profiles); switch_mutex_init(&gcache.mutex, SWITCH_MUTEX_UNNESTED, gcache.pool); switch_thread_rwlock_create(&gcache.shutdown_lock, gcache.pool); From 598ff02b2ba280f075b5b47b0d517cbe11d5f615 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Sun, 9 Mar 2014 11:34:47 -0400 Subject: [PATCH 02/28] mod_unimrcp - switch_core_hash_init_nocase was changed --- src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index 90faa63057..ece3025579 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -2047,11 +2047,11 @@ static switch_status_t synth_load(switch_loadable_module_interface_t *module_int mrcp_client_application_register(globals.mrcp_client, globals.synth.app, "synth"); /* map FreeSWITCH params to MRCP param */ - switch_core_hash_init_nocase(&globals.synth.fs_param_map, pool); + switch_core_hash_init_nocase(&globals.synth.fs_param_map); switch_core_hash_insert(globals.synth.fs_param_map, "voice", "voice-name"); /* map MRCP params to UniMRCP ID */ - switch_core_hash_init_nocase(&globals.synth.param_id_map, pool); + switch_core_hash_init_nocase(&globals.synth.param_id_map); switch_core_hash_insert(globals.synth.param_id_map, "jump-size", unimrcp_param_id_create(SYNTHESIZER_HEADER_JUMP_SIZE, pool)); switch_core_hash_insert(globals.synth.param_id_map, "kill-on-barge-in", unimrcp_param_id_create(SYNTHESIZER_HEADER_KILL_ON_BARGE_IN, pool)); switch_core_hash_insert(globals.synth.param_id_map, "speaker-profile", unimrcp_param_id_create(SYNTHESIZER_HEADER_SPEAKER_PROFILE, pool)); @@ -3794,12 +3794,12 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int mrcp_client_application_register(globals.mrcp_client, globals.recog.app, "recog"); /* map FreeSWITCH params or old params to MRCPv2 param */ - switch_core_hash_init_nocase(&globals.recog.fs_param_map, pool); + switch_core_hash_init_nocase(&globals.recog.fs_param_map); /* MRCPv1 param */ switch_core_hash_insert(globals.recog.fs_param_map, "recognizer-start-timers", "start-input-timers"); /* map MRCP params to UniMRCP ID */ - switch_core_hash_init_nocase(&globals.recog.param_id_map, pool); + switch_core_hash_init_nocase(&globals.recog.param_id_map); switch_core_hash_insert(globals.recog.param_id_map, "Confidence-Threshold", unimrcp_param_id_create(RECOGNIZER_HEADER_CONFIDENCE_THRESHOLD, pool)); switch_core_hash_insert(globals.recog.param_id_map, "Sensitivity-Level", unimrcp_param_id_create(RECOGNIZER_HEADER_SENSITIVITY_LEVEL, pool)); switch_core_hash_insert(globals.recog.param_id_map, "Speed-Vs-Accuracy", unimrcp_param_id_create(RECOGNIZER_HEADER_SPEED_VS_ACCURACY, pool)); @@ -4332,7 +4332,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_unimrcp_load) memset(&globals, 0, sizeof(globals)); switch_mutex_init(&globals.mutex, SWITCH_MUTEX_UNNESTED, pool); globals.speech_channel_number = 0; - switch_core_hash_init_nocase(&globals.profiles, pool); + switch_core_hash_init_nocase(&globals.profiles); /* get MRCP module configuration */ mod_unimrcp_do_config(); From 15b76f8ee87f72770c3b2300d6b0a6c56bd61984 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 9 Mar 2014 14:15:16 -0400 Subject: [PATCH 03/28] fix typo --- libs/unimrcp/libs/mrcpv2-transport/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/unimrcp/libs/mrcpv2-transport/Makefile.am b/libs/unimrcp/libs/mrcpv2-transport/Makefile.am index 9fd54323fc..f70441e402 100644 --- a/libs/unimrcp/libs/mrcpv2-transport/Makefile.am +++ b/libs/unimrcp/libs/mrcpv2-transport/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -AM_CPPFLAG = -I$(top_srcdir)/libs/mrcpv2-transport/include \ +AM_CPPFLAGS = -I$(top_srcdir)/libs/mrcpv2-transport/include \ -I$(top_srcdir)/libs/mrcp/include \ -I$(top_srcdir)/libs/mrcp/message/include \ -I$(top_srcdir)/libs/mrcp/control/include \ From 87af4d3278e5e86bd37231ca5b008facd886cfb9 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 9 Mar 2014 14:44:41 -0400 Subject: [PATCH 04/28] fix mod_enum install --- src/mod/applications/mod_enum/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_enum/Makefile.am b/src/mod/applications/mod_enum/Makefile.am index 7a6b10df99..648cc6fcc6 100644 --- a/src/mod/applications/mod_enum/Makefile.am +++ b/src/mod/applications/mod_enum/Makefile.am @@ -16,7 +16,7 @@ BUILT_SOURCES=$(LDNS_BUILDDIR)/ldns/util.h $(LDNS_BUILDDIR)/ldns/util.h $(LDNS_BUILDDIR)/Makefile: $(LDNS_DIR)/Makefile.in mkdir -p $(LDNS_BUILDDIR) - cd $(LDNS_BUILDDIR) && $(DEFAULT_VARS) $(LDNS_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(LDNS_DIR) --disable-gost --without-ssl --disable-sha2 + cd $(LDNS_BUILDDIR) && $(DEFAULT_VARS) $(LDNS_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(LDNS_DIR) --disable-gost --without-ssl --disable-sha2 --disable-shared --with-pic $(TOUCH_TARGET) $(LDNS_LA): $(LDNS_BUILDDIR)/Makefile From 27a3682dc00395340c80c8e604d8315d2d9b381b Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 9 Mar 2014 14:46:06 -0400 Subject: [PATCH 05/28] put this back for now to test --- libs/apr-util/configure.gnu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/apr-util/configure.gnu b/libs/apr-util/configure.gnu index 525c42f37f..72f3dccb09 100644 --- a/libs/apr-util/configure.gnu +++ b/libs/apr-util/configure.gnu @@ -1,4 +1,4 @@ #! /bin/sh srcpath=$(dirname $0 2>/dev/null ) || srcpath="." -$srcpath/configure "$@" --with-apr=../apr --without-sqlite2 --without-sqlite3 --with-expat=builtin +$srcpath/configure "$@" --with-apr=../apr --disable-shared --with-pic --without-sqlite2 --without-sqlite3 --with-expat=builtin From ce78c1434c7b91f67d4ad67a0466a98377679a94 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 9 Mar 2014 16:01:11 -0400 Subject: [PATCH 06/28] fix mod_dingaling build --- src/mod/endpoints/mod_dingaling/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_dingaling/Makefile.am b/src/mod/endpoints/mod_dingaling/Makefile.am index 32dc19d0a3..dbfed5e34f 100644 --- a/src/mod/endpoints/mod_dingaling/Makefile.am +++ b/src/mod/endpoints/mod_dingaling/Makefile.am @@ -6,7 +6,7 @@ IKS_LA=$(IKS_BUILDDIR)/src/libiksemel.la DING_DIR=$(switch_srcdir)/libs/libdingaling mod_LTLIBRARIES = mod_dingaling.la -mod_dingaling_la_SOURCES = mod_dingaling.c $(DING_DIR)/src/libdingaling.c $(DING_DIR)/src/sha1.c +mod_dingaling_la_SOURCES = mod_dingaling.c ../../../../libs/libdingaling/src/libdingaling.c ../../../../libs/libdingaling/src/sha1.c mod_dingaling_la_CFLAGS = $(AM_CFLAGS) mod_dingaling_la_CFLAGS += `$(switch_srcdir)/libs/apr/apr-1-config --cflags --cppflags --includes` mod_dingaling_la_CFLAGS += `$(switch_srcdir)/libs/apr-util/apu-1-config --includes` From beae3aedc3f4cacc0896e367baf660d7f06d54ff Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 9 Mar 2014 16:06:02 -0400 Subject: [PATCH 07/28] fix file refrences that subdir-objects doesn't like --- src/mod/codecs/mod_silk/Makefile.am | 2 +- src/mod/event_handlers/mod_cdr_mongodb/Makefile.am | 2 +- src/mod/formats/mod_portaudio_stream/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/codecs/mod_silk/Makefile.am b/src/mod/codecs/mod_silk/Makefile.am index b73a8d1947..b1e1062f8a 100644 --- a/src/mod/codecs/mod_silk/Makefile.am +++ b/src/mod/codecs/mod_silk/Makefile.am @@ -6,7 +6,7 @@ SILK_BUILDDIR=$(switch_builddir)/libs/silk SILK_LA=$(SILK_BUILDDIR)/.libs/libSKP_SILK_SDK.la mod_LTLIBRARIES = mod_silk.la -mod_silk_la_SOURCES = mod_silk.c $(switch_srcdir)/libs/stfu/stfu.c +mod_silk_la_SOURCES = mod_silk.c ../../../../libs/stfu/stfu.c mod_silk_la_CFLAGS = $(AM_CFLAGS) -I$(SILK_DIR)/src -I$(SILK_DIR)/interface mod_silk_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SILK_LA) mod_silk_la_LDFLAGS = -avoid-version -module -no-undefined -shared diff --git a/src/mod/event_handlers/mod_cdr_mongodb/Makefile.am b/src/mod/event_handlers/mod_cdr_mongodb/Makefile.am index 87cb8d4d6c..68f5d3814b 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/Makefile.am +++ b/src/mod/event_handlers/mod_cdr_mongodb/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/build/modmake.rulesam MODNAME=mod_cdr_mongodb MONGODB_DRIVER=./driver/src mod_LTLIBRARIES = mod_cdr_mongodb.la -mod_cdr_mongodb_la_SOURCES = mod_cdr_mongodb.c $(MONGODB_DRIVER)/encoding.c $(MONGODB_DRIVER)/env_posix.c $(MONGODB_DRIVER)/bson.c $(MONGODB_DRIVER)/md5.c $(MONGODB_DRIVER)/mongo.c $(MONGODB_DRIVER)/numbers.c +mod_cdr_mongodb_la_SOURCES = mod_cdr_mongodb.c ./driver/src/encoding.c ./driver/src/env_posix.c ./driver/src/bson.c ./driver/src/md5.c ./driver/src/mongo.c ./driver/src/numbers.c mod_cdr_mongodb_la_CFLAGS = $(AM_CFLAGS) mod_cdr_mongodb_la_CPPFLAGS = -I$(MONGODB_DRIVER) -I$(switch_srcdir)/libs/stfu/ -I$(switch_srcdir)/libs/libteletone/src/ -D_GNU_SOURCE mod_cdr_mongodb_la_LIBADD = $(switch_builddir)/libfreeswitch.la diff --git a/src/mod/formats/mod_portaudio_stream/Makefile.am b/src/mod/formats/mod_portaudio_stream/Makefile.am index ae9896a7b0..4ca5d80757 100644 --- a/src/mod/formats/mod_portaudio_stream/Makefile.am +++ b/src/mod/formats/mod_portaudio_stream/Makefile.am @@ -6,7 +6,7 @@ PALA=$(switch_builddir)/libs/portaudio/lib/libportaudio.la MODPA_DIR=$(switch_srcdir)/src/mod/endpoints/mod_portaudio mod_LTLIBRARIES = mod_portaudio_stream.la -mod_portaudio_stream_la_SOURCES = mod_portaudio_stream.c $(MODPA_DIR)/pablio.c $(MODPA_DIR)/pa_ringbuffer.c +mod_portaudio_stream_la_SOURCES = mod_portaudio_stream.c ../../endpoints/mod_portaudio/pablio.c ../../endpoints/mod_portaudio/pa_ringbuffer.c mod_portaudio_stream_la_CFLAGS = -I. -I$(PA_DIR)/include -D__EXTENSION__=1 -I$(MODPA_DIR) $(AM_CFLAGS) mod_portaudio_stream_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(PALA) mod_portaudio_stream_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PA_LIBS) From 5b2dc5b90af4cbae8afdf9dda57dd72f1628ef58 Mon Sep 17 00:00:00 2001 From: Tamas Cseke Date: Mon, 10 Mar 2014 11:44:56 +0100 Subject: [PATCH 08/28] lot of event can cause api timeout FS-3347 make event and log bulk configurable --- .../mod_erlang_event/mod_erlang_event.c | 13 ++++++++++--- .../mod_erlang_event/mod_erlang_event.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c index 12c5fe2b48..d211fc7e7a 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c @@ -755,7 +755,7 @@ static int check_log_queue(listener_t *listener) /* send out any pending crap in the log queue */ if (switch_test_flag(listener, LFLAG_LOG)) { - while (msgs_sent < 100 && switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) { + while (msgs_sent < prefs.max_log_bulk && switch_queue_trypop(listener->log_queue, &pop) == SWITCH_STATUS_SUCCESS) { switch_log_node_t *dnode = (switch_log_node_t *) pop; if (dnode->data) { @@ -817,7 +817,7 @@ static int check_event_queue(listener_t *listener) /* send out any pending crap in the event queue */ if (switch_test_flag(listener, LFLAG_EVENTS)) { - while (msgs_sent < 100 && switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) { + while (msgs_sent < prefs.max_event_bulk && switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) { switch_event_t *pevent = (switch_event_t *) pop; @@ -998,7 +998,7 @@ static void listener_main_loop(listener_t *listener) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%d messages sent in a loop\n", msgs_sent); #endif } else { /* no more messages right now, relax */ - switch_yield(100000); + switch_yield(10000); } } if (prefs.done) { @@ -1157,6 +1157,9 @@ static int config(void) prefs.shortname = SWITCH_TRUE; prefs.encoding = ERLANG_STRING; prefs.compat_rel = 0; + prefs.max_event_bulk = 1; + prefs.max_log_bulk = 1; + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf); @@ -1199,6 +1202,10 @@ static int config(void) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", MAX_ACL); } + } else if (!strcasecmp(var, "max-event-bulk") && !zstr(val)) { + prefs.max_event_bulk = atoi(val); + } else if (!strcasecmp(var, "max-log-bulk") && !zstr(val)) { + prefs.max_log_bulk = atoi(val); } } } diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h index d84fd0f505..719210dca8 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h @@ -216,6 +216,8 @@ struct prefs_struct { uint32_t id; erlang_encoding_t encoding; int compat_rel; + int max_event_bulk; + int max_log_bulk; }; typedef struct prefs_struct prefs_t; From 35020541cc0ecefb3f31da121bdf8a06d4f9613c Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 10 Mar 2014 09:57:09 -0400 Subject: [PATCH 09/28] fix mod_shout build --- src/mod/formats/mod_shout/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/formats/mod_shout/Makefile.am b/src/mod/formats/mod_shout/Makefile.am index fe1bcdece5..fb2cb5e4f7 100644 --- a/src/mod/formats/mod_shout/Makefile.am +++ b/src/mod/formats/mod_shout/Makefile.am @@ -31,7 +31,7 @@ $(MPG123_DIR): $(MPG123_BUILDDIR)/Makefile: $(MPG123_DIR) mkdir -p $(MPG123_BUILDDIR) - cd $(MPG123_BUILDDIR) && $(DEFAULT_VARS) $(MPG123_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(MPG123_DIR) CPPFLAGS= LDFLAGS= + cd $(MPG123_BUILDDIR) && $(DEFAULT_VARS) $(MPG123_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(MPG123_DIR) CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(MPG123LA): $(MPG123_BUILDDIR)/Makefile @@ -43,7 +43,7 @@ $(LAME_DIR): $(LAME_BUILDDIR)/Makefile: $(LAME_DIR) mkdir -p $(LAME_BUILDDIR) - cd $(LAME_BUILDDIR) && $(DEFAULT_VARS) $(LAME_DIR)/configure $(DEFAULT_ARGS) --disable-decoder --srcdir=$(LAME_DIR) CPPFLAGS= LDFLAGS= + cd $(LAME_BUILDDIR) && $(DEFAULT_VARS) $(LAME_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --disable-decoder --srcdir=$(LAME_DIR) CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(LAMELA): $(LAME_BUILDDIR)/Makefile @@ -56,7 +56,7 @@ $(SHOUT_DIR): $(SHOUT_BUILDDIR)/Makefile: $(SHOUT_DIR) mkdir -p $(SHOUT_BUILDDIR) - cd $(SHOUT_BUILDDIR) && $(DEFAULT_VARS) $(SHOUT_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(SHOUT_DIR) --without-speex --without-vorbis --without-ogg CPPFLAGS= LDFLAGS= + cd $(SHOUT_BUILDDIR) && $(DEFAULT_VARS) $(SHOUT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(SHOUT_DIR) --without-speex --without-vorbis --without-ogg CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(SHOUTLA): $(SHOUT_BUILDDIR)/Makefile From 6a7805ba27ab8abd97b83c393beb0454e3b10bfb Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Mon, 10 Mar 2014 09:07:41 -0500 Subject: [PATCH 10/28] add a few more generated files to .gitignore --- .gitignore | 3 +++ libs/.gitignore | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index da9e275130..51edfbf0f1 100644 --- a/.gitignore +++ b/.gitignore @@ -214,6 +214,9 @@ ipch/ /src/mod/languages/mod_managed/Win32/Debug_CLR/mod_managed.*.log /src/mod/languages/mod_managed/Win32/Release_CLR/mod_managed.*.log +/src/.dirstamp +/src/mod/languages/mod_v8/src/.dirstamp + libs/libsndfile/Scripts/build-test-tarball.mk libs/libsndfile/doc/libsndfile.css libs/libsndfile/echo-install-dirs diff --git a/libs/.gitignore b/libs/.gitignore index 4f048d2620..0370074fb0 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -19,6 +19,11 @@ opal *_manifest.rc *.pc +*/.dirstamp +*/*/.dirstamp +*/*/*/.dirstamp +*/*/*/*/.dirstamp + /*.tar.* /*/*.dSYM/ @@ -978,6 +983,8 @@ opal /yaml/tests/run-parser /yaml/tests/run-scanner +/broadvoice/broadvoice.spec + /zeromq-*/ /jpeg-8d/ /v8-*/ From 48d668cd0a9b0dc0d2a57f3c3b33fdc85bd19b48 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 10 Mar 2014 10:15:31 -0400 Subject: [PATCH 11/28] FS-6331: --resolve fix install of mod_celt --- src/mod/codecs/mod_celt/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/codecs/mod_celt/Makefile.am b/src/mod/codecs/mod_celt/Makefile.am index 472b96032c..e9611bd575 100644 --- a/src/mod/codecs/mod_celt/Makefile.am +++ b/src/mod/codecs/mod_celt/Makefile.am @@ -19,7 +19,7 @@ $(CELT_DIR): $(CELT_BUILDDIR)/Makefile: $(CELT_DIR) mkdir -p $(CELT_BUILDDIR) - cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(CELT_DIR) + cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(CELT_DIR) $(TOUCH_TARGET) $(CELT_LA): $(CELT_BUILDDIR)/Makefile From d9767711c859e48bed08af0915a89d8072c4f0e5 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 10 Mar 2014 10:20:56 -0400 Subject: [PATCH 12/28] add back missing vars from Makefile.am's --- build/modmake.rulesam | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/modmake.rulesam b/build/modmake.rulesam index aa36997bd8..386fd41e06 100644 --- a/build/modmake.rulesam +++ b/build/modmake.rulesam @@ -2,6 +2,9 @@ AUTOMAKE_OPTIONS = foreign subdir-objects AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS) AM_LDFLAGS = $(SWITCH_AM_LDFLAGS) +DEFAULT_VARS = CFLAGS="$(CFLAGS)" CPPFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" CXX="$(CXX)" +DEFAULT_ARGS = --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" --disable-shared --with-pic + #we should set all these vars from configure, no reason to have these in each Makefile.am LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \ then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi` From 6a5005d419c998ed92c05b288462bd89568e6def Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 10 Mar 2014 13:05:40 -0400 Subject: [PATCH 13/28] try to fix the make -j in the debs build with forcing the dep target --- src/mod/xml_int/mod_xml_rpc/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/xml_int/mod_xml_rpc/Makefile.am b/src/mod/xml_int/mod_xml_rpc/Makefile.am index cf9299ee94..58ecf6d21c 100644 --- a/src/mod/xml_int/mod_xml_rpc/Makefile.am +++ b/src/mod/xml_int/mod_xml_rpc/Makefile.am @@ -78,6 +78,7 @@ BUILT_SOURCES=$(XMLRPC_DIR)/version.h $(XMLRPC_DIR)/lib/expat/xmltok/nametab.h $(XMLRPC_DIR)/lib/expat/xmltok/xmltok.o: $(XMLRPC_DIR)/lib/expat/xmltok/nametab.h $(XMLRPC_DIR)/lib/expat/xmltok/nametab.h: + cd $(XMLRPC_DIR)/lib/expat/gennmtab && $(MAKE) dep cd $(XMLRPC_DIR)/lib/expat/gennmtab && $(MAKE) cd $(XMLRPC_DIR)/lib/expat/xmltok && ../gennmtab/gennmtab > nametab.h From bc709003352e04827a36bd90c661450beef00ac5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 10 Mar 2014 12:20:08 -0500 Subject: [PATCH 14/28] PLIV-5 --resolve httpapi cache not working for some urls --- src/mod/applications/mod_httapi/mod_httapi.c | 67 ++++++++++++++------ 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index b0f84737e4..954d4b31aa 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -2317,9 +2317,23 @@ SWITCH_STANDARD_APP(httapi_function) /* HTTP FILE INTERFACE */ +static const char *find_ext(const char *in) +{ + const char *p = in + (strlen(in) - 1); + + while(p >= in && *p) { + if (*p == '/') return NULL; + if (*p == '.') return (p+1); + p--; + } + + return NULL; +} + static char *load_cache_data(http_file_context_t *context, const char *url) { - char *ext = NULL, *dext = NULL, *p; + const char *ext = NULL; + char *dext = NULL, *p; char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 }; char meta_buffer[1024] = ""; int fd; @@ -2332,11 +2346,7 @@ static char *load_cache_data(http_file_context_t *context, const char *url) } if (zstr(ext)) { - if ((ext = strrchr(url, '.'))) { - ext++; - } else { - ext = "wav"; - } + ext = find_ext(url); } if (ext && (p = strchr(ext, '?'))) { @@ -2348,9 +2358,8 @@ static char *load_cache_data(http_file_context_t *context, const char *url) } context->cache_file_base = switch_core_sprintf(context->pool, "%s%s%s", globals.cache_path, SWITCH_PATH_SEPARATOR, digest); - context->cache_file = switch_core_sprintf(context->pool, "%s%s%s.%s", globals.cache_path, SWITCH_PATH_SEPARATOR, digest, ext); - context->meta_file = switch_core_sprintf(context->pool, "%s.meta", context->cache_file); - context->lock_file = switch_core_sprintf(context->pool, "%s.lock", context->cache_file); + context->meta_file = switch_core_sprintf(context->pool, "%s%s%s.meta", globals.cache_path, SWITCH_PATH_SEPARATOR, digest); + context->lock_file = switch_core_sprintf(context->pool, "%s%s%s.lock", globals.cache_path, SWITCH_PATH_SEPARATOR, digest); if (switch_file_exists(context->meta_file, context->pool) == SWITCH_STATUS_SUCCESS && ((fd = open(context->meta_file, O_RDONLY, 0)) > -1)) { if ((bytes = read(fd, meta_buffer, sizeof(meta_buffer))) > 0) { @@ -2363,10 +2372,20 @@ static char *load_cache_data(http_file_context_t *context, const char *url) } context->metadata = switch_core_strdup(context->pool, p); } + + if ((p = strrchr(context->metadata, ':'))) { + p++; + if (!zstr(p)) { + ext = p; + } + } + } close(fd); } + context->cache_file = switch_core_sprintf(context->pool, "%s%s%s%s%s", globals.cache_path, SWITCH_PATH_SEPARATOR, digest, ext ? "." : "", ext ? ext : ""); + switch_safe_free(dext); return context->cache_file; @@ -2626,6 +2645,7 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char switch_status_t status = SWITCH_STATUS_FALSE; time_t now = switch_epoch_time_now(NULL); char *metadata; + const char *ext = NULL; load_cache_data(context, url); @@ -2635,6 +2655,10 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char lock_file(context, SWITCH_TRUE); + if (context->url_params) { + ext = switch_event_get_header(context->url_params, "ext"); + } + if (!context->url_params || !switch_true(switch_event_get_header(context->url_params, "nohead"))) { const char *ct = NULL; const char *newext = NULL; @@ -2650,8 +2674,7 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char } } - if ((!context->url_params || !switch_event_get_header(context->url_params, "ext")) - && headers && (ct = switch_event_get_header(headers, "content-type"))) { + if (zstr(ext) && headers && (ct = switch_event_get_header(headers, "content-type"))) { if (switch_strcasecmp_any(ct, "audio/mpeg", "audio/x-mpeg", "audio/mp3", "audio/x-mp3", "audio/mpeg3", "audio/x-mpeg3", "audio/mpg", "audio/x-mpg", "audio/x-mpegaudio", NULL)) { newext = "mp3"; @@ -2660,14 +2683,14 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char } } + if (newext) { + ext = newext; + } else if (zstr(ext)) { + ext = find_ext(context->cache_file); + } + if (newext) { - char *p; - - if ((p = strrchr(context->cache_file, '.'))) { - *p = '\0'; - } - context->cache_file = switch_core_sprintf(context->pool, "%s.%s", context->cache_file, newext); } @@ -2678,11 +2701,12 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char } if (!unreachable && !zstr(context->metadata)) { - metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", url, switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), - switch_event_get_header_nil(headers, "content-length") + switch_event_get_header_nil(headers, "content-length"), + ext ); if (!strcmp(metadata, context->metadata)) { @@ -2701,11 +2725,12 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char } - metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", url, switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), - switch_event_get_header_nil(headers, "content-length") + switch_event_get_header_nil(headers, "content-length"), + ext ); write_meta_file(context, metadata, headers); From 087b2e4f30bcaab2591f177b978ad9203962c74b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 10 Mar 2014 14:42:52 -0500 Subject: [PATCH 15/28] revert part of 390e6713cce81e6dcc8e94726d34e089aa3d883a --- src/switch_rtp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 3fac018e19..aac2399471 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -660,10 +660,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.in_digit_ts = 0; rtp_session->dtmf_data.in_digit_sanity = 0; rtp_session->dtmf_data.in_digit_queued = 0; - - if (!switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { - *do_cng = 1; - } + *do_cng = 1; } else { if (!switch_rtp_ready(rtp_session)) { return RESULT_GOTO_END; @@ -708,9 +705,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ return RESULT_GOTO_RECVFROM; } } else { - if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { - *do_cng = 1; - } + *do_cng = 1; return RESULT_GOTO_TIMERCHECK; } } From db22d28e211d674503a05365fabd90642402d591 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Mon, 10 Mar 2014 15:53:26 -0400 Subject: [PATCH 16/28] FS-6334 --resolve mod_rayo: deadlock when creating input voice component --- src/mod/event_handlers/mod_rayo/rayo_input_component.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/event_handlers/mod_rayo/rayo_input_component.c b/src/mod/event_handlers/mod_rayo/rayo_input_component.c index 7941c124fb..f9cae65e50 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_input_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_input_component.c @@ -514,9 +514,13 @@ static iks *start_call_voice_input(struct input_component *component, switch_cor /* start speech detection */ switch_channel_set_variable(switch_core_session_get_channel(session), "fire_asr_events", "true"); + switch_mutex_unlock(handler->mutex); /* unlock handler mutex, otherwise deadlock will happen when switch_ivr_detect_speech adds a new media bug */ if (switch_ivr_detect_speech(session, component->recognizer, grammar.data, "mod_rayo_grammar", "", NULL) != SWITCH_STATUS_SUCCESS) { + switch_mutex_lock(handler->mutex); handler->voice_component = NULL; rayo_component_send_complete(RAYO_COMPONENT(component), COMPONENT_COMPLETE_ERROR); + } else { + switch_mutex_lock(handler->mutex); } switch_safe_free(grammar.data); From 1727213bb8edf1c2a6d6d05f09a9c9d5b555caba Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 13:59:31 +0100 Subject: [PATCH 17/28] mod_skinny: make 7925g work Cisco 7925G seem to work only with the correct conference_id2 and rtptimeout set, so add protocol 11 definition fields and set conference_id2 correctly. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/skinny_protocol.c | 1 + src/mod/endpoints/mod_skinny/skinny_protocol.h | 4 +++- src/mod/endpoints/mod_skinny/skinny_server.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.c b/src/mod/endpoints/mod_skinny/skinny_protocol.c index 5498e5ebee..ee8c8b73e3 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -911,6 +911,7 @@ switch_status_t perform_send_open_receive_channel(listener_t *listener, message->data.open_receive_channel.echo_cancel_type = echo_cancel_type; message->data.open_receive_channel.g723_bitrate = g723_bitrate; message->data.open_receive_channel.conference_id2 = conference_id2; + message->data.open_receive_channel.rtptimeout = htonl(0x0a); /* message->data.open_receive_channel.reserved[0] = reserved[0]; message->data.open_receive_channel.reserved[1] = reserved[1]; diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index 870b4c578a..efa4282f27 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -683,7 +683,9 @@ struct PACKED open_receive_channel_message { uint32_t echo_cancel_type; uint32_t g723_bitrate; uint32_t conference_id2; - uint32_t reserved[10]; + uint32_t reserved[14]; + uint32_t rtpdtmfpayload; + uint32_t rtptimeout; }; /* CloseReceiveChannelMessage */ diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index e6efd6a110..8af25fa96a 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -802,7 +802,7 @@ switch_status_t skinny_session_start_media(switch_core_session_t *session, liste SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */ 0, /* uint32_t echo_cancel_type, */ 0, /* uint32_t g723_bitrate, */ - 0, /* uint32_t conference_id2, */ + tech_pvt->call_id, /* uint32_t conference_id2, */ 0 /* uint32_t reserved[10] */ ); } @@ -868,7 +868,7 @@ switch_status_t skinny_session_unhold_line(switch_core_session_t *session, liste SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */ 0, /* uint32_t echo_cancel_type, */ 0, /* uint32_t g723_bitrate, */ - 0, /* uint32_t conference_id2, */ + tech_pvt->call_id, /* uint32_t conference_id2, */ 0 /* uint32_t reserved[10] */ ); From 305543814da4452338cb3abaee12071685dfb9e2 Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 14:06:22 +0100 Subject: [PATCH 18/28] mod_skinny: wait up to 5 seconds for OpenRecvChannelAck WiFi phones like the 7925g may take longer than just one second to acknowledge the open receive message. Increase the timeout to 5 seconds. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/mod_skinny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 2d243fdc02..dfda8ad63a 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -1142,7 +1142,7 @@ switch_status_t channel_answer_channel(switch_core_session_t *session) /* Wait for media */ while(!switch_test_flag(tech_pvt, TFLAG_IO)) { switch_cond_next(); - if (++x > 1000) { + if (++x > 5000) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Wait tooo long to answer %s:%s\n", switch_channel_get_variable(channel, "skinny_device_name"), switch_channel_get_variable(channel, "skinny_device_instance")); return SWITCH_STATUS_FALSE; From 9f804d2d955a5ab7f7191ce6ba81bc08d92c374a Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 14:21:39 +0100 Subject: [PATCH 19/28] mod_skinny: remove unknown field from access_status Cisco 7925g send access status message with just 8 byte of payload data. Since we don't interpret the unknown 3rd field anyway, remove it. This will prevent the first register to fail. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/skinny_protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index efa4282f27..4ea82ec057 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -458,7 +458,7 @@ struct PACKED dialed_phone_book_message { struct PACKED accessory_status_message { uint32_t accessory_id; uint32_t accessory_status; - uint32_t unknown; + /* uint32_t unknown; */ /* this field is missing in 7925G */ }; /* RegisterAckMessage */ From 0c0a4867aa11261025efa1502ff75518e1c7e262 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Mon, 10 Mar 2014 17:15:31 -0400 Subject: [PATCH 20/28] mod_rayo: improve error messages when joining to b-leg that is missing --- src/mod/event_handlers/mod_rayo/mod_rayo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index f6ea6b717b..0787d51afa 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -1973,7 +1973,7 @@ static iks *join_call(struct rayo_call *call, switch_core_session_t *session, st struct rayo_call *b_call = RAYO_CALL_LOCATE(call_uri); if (!b_call) { /* not a rayo call */ - response = iks_new_error_detailed(node, STANZA_ERROR_SERVICE_UNAVAILABLE, "b-leg is not a rayo call"); + response = iks_new_error_detailed(node, STANZA_ERROR_SERVICE_UNAVAILABLE, "b-leg is gone"); } else if (!has_call_control(b_call, msg)) { /* not allowed to join to this call */ response = iks_new_error(node, STANZA_ERROR_NOT_ALLOWED); @@ -1990,7 +1990,7 @@ static iks *join_call(struct rayo_call *call, switch_core_session_t *session, st call->pending_join_request = iks_copy(node); if (switch_ivr_uuid_bridge(rayo_call_get_uuid(call), rayo_call_get_uuid(b_call)) != SWITCH_STATUS_SUCCESS) { iks *request = call->pending_join_request; - iks *result = iks_new_error_detailed(request, STANZA_ERROR_ITEM_NOT_FOUND, "failed to bridge call"); + iks *result = iks_new_error(request, STANZA_ERROR_SERVICE_UNAVAILABLE); call->pending_join_request = NULL; RAYO_SEND_REPLY(call, iks_find_attrib_soft(request, "from"), result); iks_delete(call->pending_join_request); From f9337a6a7080150bfb4a8662d7eb72843faa84b6 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Mon, 10 Mar 2014 20:10:18 -0400 Subject: [PATCH 21/28] FS-6281 --resolve mod_rayo timestamp presence events --- src/mod/event_handlers/mod_rayo/mod_rayo.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 0787d51afa..12e13c3b54 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -763,6 +763,7 @@ static void stop_deliver_message_threads(void) */ void rayo_message_send(struct rayo_actor *from, const char *to, iks *payload, int dup, int reply, const char *file, int line) { + const char *msg_name; struct rayo_message *msg = malloc(sizeof(*msg)); if (dup) { msg->payload = iks_copy(payload); @@ -783,6 +784,21 @@ void rayo_message_send(struct rayo_actor *from, const char *to, iks *payload, in msg->file = strdup(file); msg->line = line; + /* add timestamp to presence events */ + msg_name = iks_name(msg->payload); + if (!zstr(msg_name) && !strcmp("presence", msg_name)) { + iks *delay = iks_insert(msg->payload, "delay"); + switch_time_exp_t tm; + char timestamp[80]; + switch_size_t retsize; + + iks_insert_attrib(delay, "xmlns", "urn:xmpp:delay"); + + switch_time_exp_tz(&tm, switch_time_now(), 0); + switch_strftime_nocheck(timestamp, &retsize, sizeof(timestamp), "%Y-%m-%dT%TZ", &tm); + iks_insert_attrib_printf(delay, "stamp", "%s", timestamp); + } + if (switch_queue_trypush(globals.msg_queue, msg) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "failed to queue message!\n"); rayo_message_destroy(msg); From 4a7e3ebc314d73457b16cb47156a70ab3b5ea151 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 10 Mar 2014 23:19:03 -0400 Subject: [PATCH 22/28] BNPH-353: avoid adding linker flags as make targets --- Makefile.am | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 3d948a80fb..50f05dcfa2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,7 +139,7 @@ endif if HAVE_LIBEDIT CORE_CFLAGS += -I$(switch_srcdir)/libs/libedit/src -DSWITCH_HAVE_LIBEDIT -CORE_LIBS += libs/libedit/src/.libs/libedit.a $(TINFO_LIBS) +CORE_LIBS += libs/libedit/src/.libs/libedit.a endif if ENABLE_TIMERFD_WRAPPER @@ -159,6 +159,10 @@ libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDF libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(PLATFORM_CORE_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) +if HAVE_LIBEDIT +libfreeswitch_la_LIBADD += $(TINFO_LIBS) +endif + if HAVE_ODBC libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) endif From 0fa6cc6f017a5db8c17866dba1e675217d62e8cf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Mar 2014 11:38:31 -0500 Subject: [PATCH 23/28] FS-6340 --resolve --- src/switch_core_media.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index e7c19aed67..778bd2ff8a 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -2797,7 +2797,7 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_ } if (engine->ice_in.cands[engine->ice_in.chosen[1]][1].ready) { - if (!strcmp(engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr, engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr) + if (engine->rtcp_mux > 0 && !strcmp(engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr, engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr) && engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port == engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_port) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_INFO, "Skipping %s RTCP ICE (Same as RTP)\n", type2str(type)); } else { @@ -5058,7 +5058,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi } if (a_engine->ice_in.cands[a_engine->ice_in.chosen[1]][1].ready) { - if (!strcmp(a_engine->ice_in.cands[a_engine->ice_in.chosen[1]][1].con_addr, a_engine->ice_in.cands[a_engine->ice_in.chosen[0]][0].con_addr) + if (a_engine->rtcp_mux > 0 && !strcmp(a_engine->ice_in.cands[a_engine->ice_in.chosen[1]][1].con_addr, a_engine->ice_in.cands[a_engine->ice_in.chosen[0]][0].con_addr) && a_engine->ice_in.cands[a_engine->ice_in.chosen[1]][1].con_port == a_engine->ice_in.cands[a_engine->ice_in.chosen[0]][0].con_port) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Skipping RTCP ICE (Same as RTP)\n"); } else { @@ -5475,7 +5475,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi if (v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].ready) { - if (!strcmp(v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_addr, v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_addr) + if (v_engine->rtcp_mux > 0 && !strcmp(v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_addr, v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_addr) && v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_port == v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_port) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Skipping VIDEO RTCP ICE (Same as VIDEO RTP)\n"); } else { From 5c8a3b12fd3709aec2d37fc7a9eb5518252c0457 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Mar 2014 15:17:02 -0500 Subject: [PATCH 24/28] Convert some behaviors to optional. These all were set before but now are disabled by default because they are not proper to have enabled without a good reason. tcp-unreg-on-socket-close If registration is TCP or TLS and socket connection is interrupted, unregister the client. tcp-always-nat Treat all TCP connections as NATTED, this causes all traffic back to the phone to reuse the existing TCP socket but may cause problems when not used with TCP keepalive. tls-always-nat Same as tcp-always-nat but only for TLS connections. --- src/mod/endpoints/mod_sofia/mod_sofia.h | 3 +++ src/mod/endpoints/mod_sofia/sofia.c | 18 ++++++++++++++++++ src/mod/endpoints/mod_sofia/sofia_glue.c | 4 ++-- src/mod/endpoints/mod_sofia/sofia_reg.c | 23 +++++++++++++---------- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 8c0fe09bf2..016b48989a 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -270,6 +270,9 @@ typedef enum { PFLAG_MESSAGES_RESPOND_200_OK, PFLAG_SUBSCRIBE_RESPOND_200_OK, PFLAG_PARSE_ALL_INVITE_HEADERS, + PFLAG_TCP_UNREG_ON_SOCKET_CLOSE, + PFLAG_TLS_ALWAYS_NAT, + PFLAG_TCP_ALWAYS_NAT, /* No new flags below this line */ PFLAG_MAX } PFLAGS; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index fe3dd14463..9a83370261 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4103,6 +4103,24 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_MWI_USE_REG_CALLID); } + } else if (!strcasecmp(var, "tcp-unreg-on-socket-close")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_TCP_UNREG_ON_SOCKET_CLOSE); + } else { + sofia_clear_pflag(profile, PFLAG_TCP_UNREG_ON_SOCKET_CLOSE); + } + } else if (!strcasecmp(var, "tcp-always-nat")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_TCP_ALWAYS_NAT); + } else { + sofia_clear_pflag(profile, PFLAG_TCP_ALWAYS_NAT); + } + } else if (!strcasecmp(var, "tls-always-nat")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_TCP_ALWAYS_NAT); + } else { + sofia_clear_pflag(profile, PFLAG_TCP_ALWAYS_NAT); + } } else if (!strcasecmp(var, "presence-proto-lookup")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_PRESENCE_MAP); diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index f2fec6254a..ba9c8cf2f8 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2180,8 +2180,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile) } - test_sql = switch_mprintf("delete from sip_registrations where (sub_host is null or contact like '%%TCP%%' " - "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' " + test_sql = switch_mprintf("delete from sip_registrations where sub_host is null " + "and hostname='%q' " "and network_ip like '%%' and network_port like '%%' and sip_username " "like '%%' and mwi_user like '%%' and mwi_host like '%%' " "and orig_server_host like '%%' and orig_hostname like '%%'", mod_sofia_globals.hostname); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 4ebb4055b4..e2447f45a1 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1187,10 +1187,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if (sip && sip->sip_via && (vproto = sip->sip_via->v_protocol)) { if (!strcasecmp(vproto, "sip/2.0/ws")) { is_ws = 1; - is_nat++; + is_nat = "ws"; } else if (!strcasecmp(vproto, "sip/2.0/wss")) { is_wss = 1; - is_nat++; + is_nat = "wss"; if (uparams && (p = switch_stristr("transport=ws", uparams))) { if (p[12] != 's') { @@ -1269,24 +1269,29 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if (uparams && switch_stristr("transport=tls", uparams)) { is_tls += 1; - is_nat++; + if (sofia_test_pflag(profile, PFLAG_TLS_ALWAYS_NAT)) { + is_nat = "tls"; + } } if (!is_wss && !is_ws && uparams && switch_stristr("transport=ws", uparams)) { - is_nat++; + is_nat = "ws"; is_ws += 1; } if (sip->sip_contact->m_url->url_type == url_sips) { proto = "sips"; is_tls += 2; - is_nat++; + if (sofia_test_pflag(profile, PFLAG_TLS_ALWAYS_NAT)) { + is_nat = "tls"; + } } - if (uparams && switch_stristr("transport=tcp", uparams)) { is_tcp = 1; - is_nat++; + if (sofia_test_pflag(profile, PFLAG_TCP_ALWAYS_NAT)) { + is_nat = "tcp"; + } } display = contact->m_display; @@ -1737,9 +1742,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_safe_free(url); switch_safe_free(contact); - - - if ((is_wss || is_ws || is_tcp || is_tls) && !sofia_private && call_id) { + if ((is_wss || is_ws || (sofia_test_pflag(profile, PFLAG_TCP_UNREG_ON_SOCKET_CLOSE) && (is_tcp || is_tls))) && !sofia_private && call_id) { char key[256] = ""; nua_handle_t *hnh; switch_snprintf(key, sizeof(key), "%s%s%s", call_id, network_ip, network_port_c); From 70f29089767d7e2584da53082d6019fc6def38fe Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Mar 2014 16:12:43 -0500 Subject: [PATCH 25/28] more nat fix --- src/mod/endpoints/mod_sofia/sofia.c | 34 ++++++++++++++++++------- src/mod/endpoints/mod_sofia/sofia_reg.c | 3 ++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 9a83370261..d395810616 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8213,7 +8213,24 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia char *sql = NULL; char *acl_context = NULL; const char *r_sdp = NULL; - int broken_device = 0; + int is_tcp = 0, is_tls = 0; + const char *uparams = NULL; + + + if (sip && sip->sip_contact && sip->sip_contact->m_url && sip->sip_contact->m_url->url_params) { + uparams = sip->sip_contact->m_url->url_params; + } else { + uparams = NULL; + } + + + if (uparams) { + if (switch_stristr("transport=tcp", uparams)) { + is_tcp = 1; + } else if (switch_stristr("transport=tls", uparams)) { + is_tls = 1; + } + } profile->ib_calls++; @@ -8257,14 +8274,13 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia } - if (!switch_check_network_list_ip(network_ip, profile->local_network) && - profile->server_rport_level >= 2 && sip->sip_user_agent && sip->sip_user_agent->g_string && - (!strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || - !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) )) { - broken_device = 1; - } - - if (sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) || broken_device) { + if (sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) || + (sofia_test_pflag(profile, PFLAG_TLS_ALWAYS_NAT) && (is_tcp || is_tls)) || + (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) && + profile->server_rport_level >= 2 && sip->sip_user_agent && + sip->sip_user_agent->g_string && + (!strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20))) + ) { if (sip && sip->sip_via) { const char *port = sip->sip_via->v_port; const char *host = sip->sip_via->v_host; diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index e2447f45a1..cecde4986e 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1469,7 +1469,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand to_user = force_user; } - if (profile->server_rport_level >= 2 && sip->sip_user_agent && + if (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) && + profile->server_rport_level >= 2 && sip->sip_user_agent && sip->sip_user_agent->g_string && ( !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) )) { if (sip && sip->sip_via) { From 98c2a3b992fe326625afe7bedef803202f71d401 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Mar 2014 16:25:51 -0500 Subject: [PATCH 26/28] don't nuke tcp and tls reg on restart --- src/switch_core_sqldb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 6687f296f2..054cfad2f5 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -3158,7 +3158,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from aliases", "DROP TABLE aliases", create_alias_sql); switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from complete", "DROP TABLE complete", create_complete_sql); switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from nat", "DROP TABLE nat", create_nat_sql); - switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'", + switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user=''", "DROP TABLE registrations", create_registrations_sql); switch_cache_db_test_reactive(sql_manager.dbh, "select metadata from registrations", NULL, "ALTER TABLE registrations ADD COLUMN metadata VARCHAR(256)"); @@ -3185,11 +3185,11 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_test_reactive(sql_manager.dbh, "select * from basic_calls where sent_callee_name=''", "DROP VIEW basic_calls", basic_calls_sql); switch_cache_db_test_reactive(sql_manager.dbh, "select call_uuid from calls", "DROP TABLE calls", create_calls_sql); if (runtime.odbc_dbtype == DBTYPE_DEFAULT) { - switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'", + switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user=''", "DROP TABLE registrations", create_registrations_sql); } else { char *tmp = switch_string_replace(create_registrations_sql, "url TEXT", "url VARCHAR(max)"); - switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'", + switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user=''", "DROP TABLE registrations", tmp); free(tmp); } From 9fd30a2cd91fe5770aed1616bcb44749404ed119 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Mar 2014 18:16:23 -0500 Subject: [PATCH 27/28] FS-6339 --resolve --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nta/nta.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index c2cc70f57c..94a1965201 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Thu Mar 6 00:30:51 CDT 2014 +Tue Mar 11 18:16:09 CDT 2014 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index 71f742e941..9a357a9249 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -11176,7 +11176,6 @@ nta_reliable_t *reliable_find(nta_agent_t const *agent, if (rel->rel_rseq == rack->ra_response) return (nta_reliable_t *)rel; - return NULL; } } From bcec5e22a27d00171b8120fec928d799a1396149 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Mar 2014 04:50:42 +0500 Subject: [PATCH 28/28] FS-6342 --resolve regression from 804ef7709dbf1ca69b0106578015a78bd2168b70 Missed part of properly implementing the case-insensitive mode on the hash causing the dp lookup xml not to match XML --- src/include/switch_hashtable.h | 5 +++++ src/switch_core_hash.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/include/switch_hashtable.h b/src/include/switch_hashtable.h index 4056064a32..7bf0ea86a0 100644 --- a/src/include/switch_hashtable.h +++ b/src/include/switch_hashtable.h @@ -199,6 +199,11 @@ static inline int switch_hash_equalkeys(void *k1, void *k2) return strcmp((char *) k1, (char *) k2) ? 0 : 1; } +static inline int switch_hash_equalkeys_ci(void *k1, void *k2) +{ + return strcasecmp((char *) k1, (char *) k2) ? 0 : 1; +} + static inline uint32_t switch_hash_default(void *ky) { unsigned char *str = (unsigned char *) ky; diff --git a/src/switch_core_hash.c b/src/switch_core_hash.c index 56aee60620..80be156114 100644 --- a/src/switch_core_hash.c +++ b/src/switch_core_hash.c @@ -38,7 +38,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(switch_hash_t **hash, switch_bool_t case_sensitive) { - return switch_create_hashtable(hash, 16, case_sensitive ? switch_hash_default : switch_hash_default_ci, switch_hash_equalkeys); + if (case_sensitive) { + return switch_create_hashtable(hash, 16, switch_hash_default, switch_hash_equalkeys); + } else { + return switch_create_hashtable(hash, 16, switch_hash_default_ci, switch_hash_equalkeys_ci); + } }