diff --git a/cloudformation/jambonz-mini.yaml b/cloudformation/jambonz-mini.yaml index 560bcd5..c799267 100644 --- a/cloudformation/jambonz-mini.yaml +++ b/cloudformation/jambonz-mini.yaml @@ -95,7 +95,7 @@ Conditions: Mappings: AWSRegion2AMI: us-east-1: - Ami: ami-097781c08d5a30385 + Ami: ami-023fcf983fc15eaf8 Resources: IamCloudwatchRole: @@ -183,7 +183,7 @@ Resources: # change the database password to a random id NEW_DB_PASSWD="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" - echo "alter user 'admin'@'%' identified by '$NEW_DB_PASSWD'" | mysql -h localhost -u admin -D jambones -pJambonzR0ck$ + echo "alter user 'admin'@'%' identified by '$NEW_DB_PASSWD'" | mysql -h 127.0.0.1 -u admin -D jambones -pJambonzR0ck$ sudo sed -i -e "s/\(.*\)JAMBONES_MYSQL_PASSWORD.*/\1JAMBONES_MYSQL_PASSWORD: '$NEW_DB_PASSWD',/g" /home/admin/apps/ecosystem.config.js # replace ip addresses in the ecosystem.config.js file @@ -196,7 +196,7 @@ Resources: sudo sed -i -e "s/\(.*\)JWT-SECRET-GOES_HERE\(.*\)/\1$uuid\2/g" /home/admin/apps/ecosystem.config.js # reset the database - JAMBONES_ADMIN_INITIAL_PASSWORD=$INSTANCE_ID JAMBONES_MYSQL_USER=admin JAMBONES_MYSQL_PASSWORD=$NEW_DB_PASSWD JAMBONES_MYSQL_DATABASE=jambones JAMBONES_MYSQL_HOST=localhost /home/admin/apps/jambonz-api-server/db/reset_admin_password.js + JAMBONES_ADMIN_INITIAL_PASSWORD=$INSTANCE_ID JAMBONES_MYSQL_USER=admin JAMBONES_MYSQL_PASSWORD=$NEW_DB_PASSWD JAMBONES_MYSQL_DATABASE=jambones JAMBONES_MYSQL_HOST=127.0.0.1 /home/admin/apps/jambonz-api-server/db/reset_admin_password.js # configure webapp if [[ -z "${URLPortal}" ]]; then @@ -210,7 +210,7 @@ Resources: API_BASE_URL=http://${URLPortal}/api/v1 TAG="" sed -i -e "\@@i\ $TAG" /home/admin/apps/jambonz-webapp/dist/index.html # add row to system information table - mysql -h localhost -u admin -D jambones -p$NEW_DB_PASSWD -e $'insert into system_information (domain_name, sip_domain_name, monitoring_domain_name) values ('\'''"${URLPortal}"''\'', '\''sip.'"${URLPortal}"''\'', '\''grafana.'"${URLPortal}"''\'')' + mysql -h 127.0.0.1 -u admin -D jambones -p$NEW_DB_PASSWD -e $'insert into system_information (domain_name, sip_domain_name, monitoring_domain_name) values ('\'''"${URLPortal}"''\'', '\''sip.'"${URLPortal}"''\'', '\''grafana.'"${URLPortal}"''\'')' sudo cat << EOF > /etc/nginx/sites-available/default server { @@ -218,11 +218,11 @@ Resources: server_name ${URLPortal}; location /api/ { rewrite ^/api/(.*)$ /\$1 break; - proxy_pass http://localhost:3002; + proxy_pass http://127.0.0.1:3002; proxy_set_header Host \$host; } location / { - proxy_pass http://localhost:3001; + proxy_pass http://127.0.0.1:3001; proxy_set_header Host \$host; } } @@ -230,7 +230,7 @@ Resources: listen 80; server_name api.${URLPortal}; location / { - proxy_pass http://localhost:3002; + proxy_pass http://127.0.0.1:3002; proxy_set_header Host \$host; } } @@ -238,7 +238,7 @@ Resources: listen 80; server_name grafana.${URLPortal}; location / { - proxy_pass http://localhost:3010; + proxy_pass http://127.0.0.1:3010; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection 'upgrade'; @@ -250,7 +250,7 @@ Resources: listen 80; server_name homer.${URLPortal}; location / { - proxy_pass http://localhost:9080; + proxy_pass http://127.0.0.1:9080; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection 'upgrade'; diff --git a/packer/jambonz-feature-server/aws/files/Makefile.am.extra b/packer/jambonz-feature-server/aws/files/Makefile.am.extra index 7ba2f2e..7405e94 100644 --- a/packer/jambonz-feature-server/aws/files/Makefile.am.extra +++ b/packer/jambonz-feature-server/aws/files/Makefile.am.extra @@ -15,19 +15,8 @@ AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes) AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags) AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs)) endif -if SYSTEM_APRUTIL -AM_LIBAPU_CPPFLAGS := $(shell apu-1-config --includes) -AM_LIBAPU_LDFLAGS := $(shell apu-1-config --ldflags) -AM_LIBAPU_LIBS := $(shell apu-1-config \--libs) -AM_LIBAPU_LINKLIBTOOL := $(shell apu-1-config \--link-libtool) -else -AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes) -AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags) -AM_LIBAPU_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr-util/apu-1-config \--libs)) -endif - -AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) +AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) AM_CPPFLAGS = AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx AM_CPPFLAGS += $(SWITCH_AM_CXXFLAGS) @@ -141,11 +130,6 @@ CORE_LIBS= if ENABLE_LIBVPX CORE_LIBS += libs/libvpx/libvpx.a endif -if SYSTEM_APRUTIL -CORE_LIBS += $(AM_LIBAPU_LINKLIBTOOL) -else -CORE_LIBS += libs/apr-util/libaprutil-1.la -endif if SYSTEM_APR CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL) else @@ -189,8 +173,8 @@ endif # DH: GRPC if HAVE_GRPC -CORE_CFLAGS += -DSWITCH_HAVE_GRPC $(GRPC_CFLAGS) -GRPC_LIBS += -lgrpc++_reflection -lprotobuf +CORE_CFLAGS += -DSWITCH_HAVE_GRPC +GRPC_LIBS += -lgrpc++_reflection -lprotobuf endif ## @@ -252,7 +236,6 @@ libs/libyuv/source/scale_neon.cc \ libs/libyuv/source/scale_win.cc \ libs/libyuv/source/video_common.cc - libfreeswitch_libyuv_la_CPPFLAGS = -O2 -fomit-frame-pointer -Ilibs/libyuv/include CORE_LIBS+=libfreeswitch_libyuv.la endif @@ -327,6 +310,7 @@ libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.pb.cc \ libs/googleapis/gens/google/api/servicemanagement/v1/resources.pb.cc \ libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.grpc.pb.cc \ libs/googleapis/gens/google/api/billing.grpc.pb.cc \ +libs/googleapis/gens/google/api/policy.pb.cc \ libs/googleapis/gens/google/api/usage.pb.cc \ libs/googleapis/gens/google/api/config_change.pb.cc \ libs/googleapis/gens/google/api/context.grpc.pb.cc \ @@ -347,6 +331,8 @@ libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.grpc.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/resource.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/resource.grpc.pb.cc \ libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.pb.cc \ libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc \ libs/googleapis/gens/google/logging/type/http_request.grpc.pb.cc \ @@ -441,15 +427,24 @@ libs/soniox-asr-grpc-api/stubs/soniox/speech_service.grpc.pb.cc libfreeswitch_libsonioxapis_la_CPPFLAGS = -I/usr/local/include -I$(SONIOX_GENS_PATH) -std=c++17 -pthread -CORE_LIBS+=libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la -noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la +#cobalt asr +COBALT_GENS_PATH = libs/cobalt-asr-grpc-api/stubs/ + +nodist_libfreeswitch_libcobaltapis_la_SOURCES = \ +libs/cobalt-asr-grpc-api/stubs/cobaltspeech/transcribe/v5/transcribe.pb.cc \ +libs/cobalt-asr-grpc-api/stubs/cobaltspeech/transcribe/v5/transcribe.grpc.pb.cc + +libfreeswitch_libcobaltapis_la_CPPFLAGS = -I/usr/local/include -I$(COBALT_GENS_PATH) -I./libs/googleapis/gens -std=c++17 -pthread + +CORE_LIBS+=libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la libfreeswitch_libcobaltapis.la +noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la libfreeswitch_libcobaltapis.la endif lib_LTLIBRARIES = libfreeswitch.la libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) -libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined -libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(GRPC_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS) +libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) $(AWS_LDFLAGS) -no-undefined +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(SYSTEMD_LIBS) $(GRPC_LIBS) $(AWS_SDK_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) if HAVE_PNG @@ -460,19 +455,6 @@ if HAVE_ODBC libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) endif -if ENABLE_ZRTP -CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes -CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib -CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include -ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib -ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp -ZRTP_LIBS = -lbn -lzrtp -libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS) -libfreeswitch_la_LIBADD += $(ZRTP_LIBS) -CORE_LIBS += libs/libzrtp/libzrtp.a -LIBS += libs/libzrtp/third_party/bnlib/libbn.a -endif - library_includetestdir = $(includedir)/test library_includetest_HEADERS = \ src/include/test/switch_fct.h \ @@ -501,6 +483,7 @@ library_include_HEADERS = \ src/include/switch_dso.h \ src/include/switch_loadable_module.h \ src/include/switch_module_interfaces.h \ + src/include/switch_packetizer.h \ src/include/switch_platform.h \ src/include/switch_resample.h \ src/include/switch_regex.h \ @@ -510,6 +493,7 @@ library_include_HEADERS = \ src/include/switch_jitterbuffer.h \ src/include/switch_estimators.h \ src/include/switch_rtcp_frame.h \ + src/include/switch_spandsp.h \ src/include/switch_stun.h \ src/include/switch_nat.h \ src/include/switch_log.h \ @@ -532,6 +516,10 @@ library_include_HEADERS = \ src/include/switch_hashtable.h \ src/include/switch_image.h +#if HAVE_AWS_SDK +# library_include_HEADERS += src/include/aws_wrapper.h +#endif + nodist_libfreeswitch_la_SOURCES = \ src/include/switch_frame.h \ src/include/switch_swigable_cpp.h \ @@ -539,6 +527,7 @@ nodist_libfreeswitch_la_SOURCES = \ libfreeswitch_la_SOURCES = \ src/switch_apr.c \ + src/switch_apr_queue.c \ src/switch_buffer.c \ src/switch_caller.c \ src/switch_channel.c \ @@ -565,6 +554,7 @@ libfreeswitch_la_SOURCES = \ src/switch_version.c \ src/switch_core_media.c \ src/switch_core_video.c \ + src/switch_packetizer.c \ src/switch_sdp.c \ src/switch_scheduler.c \ src/switch_core_db.c \ @@ -584,6 +574,7 @@ libfreeswitch_la_SOURCES = \ src/switch_ivr_say.c \ src/switch_ivr_menu.c \ src/switch_ivr.c \ + src/switch_spandsp.c \ src/switch_stun.c \ src/switch_nat.c \ src/switch_log.c \ @@ -624,6 +615,10 @@ if ENABLE_CPP libfreeswitch_la_SOURCES += src/switch_cpp.cpp endif +#if HAVE_AWS_SDK +# libfreeswitch_la_SOURCES += src/aws_wrapper.cpp +#endif + $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h @@ -656,7 +651,7 @@ endif fs_encode_SOURCES = src/fs_encode.c fs_encode_CFLAGS = $(AM_CFLAGS) fs_encode_LDFLAGS = $(AM_LDFLAGS) -fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) +fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) if HAVE_ODBC fs_encode_LDADD += $(ODBC_LIB_FLAGS) @@ -781,9 +776,6 @@ src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_ libs/libedit/src/.libs/libedit.a: cd libs/libedit && $(MAKE) -libs/libzrtp/libzrtp.a: - cd libs/libzrtp && $(MAKE) - libs/libvpx/Makefile: libs/libvpx/.update cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 @@ -797,17 +789,15 @@ libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr && $(MAKE) $(MFLAGS) && touch libapr-1.la; fi -libs/apr-util/libaprutil-1.la: libs/apr/libapr-1.la libs/apr-util libs/apr-util/.update - @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr-util && $(MAKE) $(MFLAGS) && touch libaprutil-1.la; fi - -SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ +SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \ libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \ libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \ - libs/srtp/crypto/math/datatypes.c libs/srtp/crypto/math/stat.c \ + libs/srtp/crypto/math/datatypes.c \ libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \ libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \ - libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c libs/srtp/crypto/replay/ut_sim.c + libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c \ + libs/srtp/crypto/cipher/cipher_test_cases.c libs/srtp/crypto/hash/auth_test_cases.c libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC) touch $(switch_srcdir)/src/include/switch.h @@ -898,7 +888,7 @@ yesdepends: rm .nodepends iksemel-dep: - make -C src/mod/endpoints/mod_dingaling deps + make -C src/mod/formats/mod_ssml deps core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS) $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la @@ -942,11 +932,11 @@ pristine: git clean -fdx git reset --hard -update-clean: clean python-reconf +update-clean: clean python-reconf python3-reconf cd libs/esl && $(MAKE) clean cd libs/srtp && $(MAKE) clean -swigall: +swigall: src/include/switch_swigable_cpp.h @echo reswigging all sh $(switch_srcdir)/build/swigall.sh @@ -959,6 +949,10 @@ python-reconf: rm -f src/mod/languages/mod_python/Makefile ./config.status +python3-reconf: + rm -f src/mod/languages/mod_python3/Makefile + ./config.status + reconf: rm config.cache sh ./config.status --recheck @@ -974,7 +968,7 @@ iks-reconf: cd libs/iksemel && $(MAKE) clean cd libs/iksemel && autoreconf -fi cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS) - $(MAKE) mod_dingaling-clean + $(MAKE) mod_ssml-clean cluecon: @clear diff --git a/packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.30.0.tar.gz b/packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.32.1.tar.gz similarity index 56% rename from packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.30.0.tar.gz rename to packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.32.1.tar.gz index 5d2e6c6..90fca8a 100644 Binary files a/packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.30.0.tar.gz and b/packer/jambonz-feature-server/aws/files/SpeechSDK-Linux-1.32.1.tar.gz differ diff --git a/packer/jambonz-feature-server/aws/files/configure.ac.extra b/packer/jambonz-feature-server/aws/files/configure.ac.extra index b33c28a..89615bd 100644 --- a/packer/jambonz-feature-server/aws/files/configure.ac.extra +++ b/packer/jambonz-feature-server/aws/files/configure.ac.extra @@ -3,10 +3,10 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.10.5-release], bugs@freeswitch.org) +AC_INIT([freeswitch],[1.10.10-release],[bugs@freeswitch.org]) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [10]) -AC_SUBST(SWITCH_VERSION_MICRO, [5-release]) +AC_SUBST(SWITCH_VERSION_MICRO, [10-release]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) @@ -16,9 +16,9 @@ AC_CONFIG_AUX_DIR(build/config) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR([src/switch.c]) -AC_CONFIG_HEADER([src/include/switch_private.h]) -AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h]) -AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h]) +AC_CONFIG_HEADERS([src/include/switch_private.h]) +AC_CONFIG_HEADERS([libs/esl/src/include/esl_config_auto.h]) +AC_CONFIG_HEADERS([libs/xmlrpc-c/xmlrpc_amconfig.h]) AC_CANONICAL_HOST @@ -36,7 +36,7 @@ AC_SUBST(switch_builddir) # Enable 64 bit build AC_ARG_ENABLE(64, -[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) +[AS_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) if test "${enable_64}" = "yes"; then case "$host" in @@ -223,7 +223,7 @@ AC_ARG_WITH([pkgconfigdir], AC_SUBST([pkgconfigdir]) #Set default language -AC_LANG_C +AC_LANG([C]) # Checks for programs. AC_PROG_CC AC_PROG_CXX @@ -243,12 +243,12 @@ AC_PROG_AWK AC_PROG_MAKE_SET AC_PROG_INSTALL -#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html) +#override some default libtool behavior and invoke LT_INIT (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html) m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) m4_defun([_LT_AC_LANG_RC_CONFIG], [:]) AM_PROG_CC_C_O -AC_PROG_LIBTOOL +LT_INIT([disable-static]) #Check for compiler vendor AX_COMPILER_VENDOR @@ -295,7 +295,7 @@ fi # Optimize AC_ARG_ENABLE(optimization, -[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"]) +[AS_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"]) if test "${enable_optimizer}" = "yes" ; then AC_DEFINE([OPTIMZER],[],[Enable Optimization.]) @@ -341,7 +341,7 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xintel" ; then ;; esac else - AC_ERROR([Please update configure.in with SOLINK values for your compiler]) + AC_MSG_ERROR(Please update configure.in with SOLINK values for your compiler) fi ## @@ -372,9 +372,7 @@ if test "$ax_cv_c_compiler_vendor" = "gnu"; then AC_CACHE_CHECK([whether compiler supports -Wno-unused-result], [ac_cv_gcc_supports_w_no_unused_result], [ CFLAGS="$CFLAGS -Wno-unused-result -Wno-error=unused-result" - AC_TRY_COMPILE([],[return 0;], - [ac_cv_gcc_supports_w_no_unused_result=yes], - [ac_cv_gcc_supports_w_no_unused_result=no])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_supports_w_no_unused_result=yes],[ac_cv_gcc_supports_w_no_unused_result=no])]) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($ac_cv_gcc_supports_w_no_unused_result) @@ -382,9 +380,7 @@ if test "$ax_cv_c_compiler_vendor" = "gnu"; then AC_CACHE_CHECK([whether compiler supports -Wno-misleading-indentation], [ac_cv_gcc_supports_w_no_misleading_indentation], [ CFLAGS="$CFLAGS -Wno-misleading-indentation -Wno-error=misleading-indentation" - AC_TRY_COMPILE([],[return 0;], - [ac_cv_gcc_supports_w_no_misleading_indentation=yes], - [ac_cv_gcc_supports_w_no_misleading_indentation=no])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_supports_w_no_misleading_indentation=yes],[ac_cv_gcc_supports_w_no_misleading_indentation=no])]) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($ac_cv_gcc_supports_w_no_misleading_indentation) fi @@ -532,7 +528,7 @@ fi # Enable debugging (default: on) # (rename option if the default is changed) AC_ARG_ENABLE(debug, -[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"]) +[AS_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"]) if test "${enable_debug}" = "yes"; then AC_DEFINE([DEBUG],[],[Enable extra debugging.]) @@ -553,17 +549,17 @@ if test "${enable_debug}" = "yes"; then fi AC_ARG_ENABLE(libyuv, -[AC_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"]) +[AS_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"]) AM_CONDITIONAL([ENABLE_LIBYUV],[test "${enable_libyuv}" = "yes"]) AC_ARG_ENABLE(libvpx, -[AC_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"]) +[AS_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"]) AM_CONDITIONAL([ENABLE_LIBVPX],[test "${enable_libvpx}" = "yes"]) AC_ARG_ENABLE(cpp, -[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"]) +[AS_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"]) AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"]) @@ -582,7 +578,7 @@ AC_SUBST(SYS_XMLRPC_CFLAGS) AC_SUBST(SYS_XMLRPC_LDFLAGS) AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"]) -for luaversion in luajit lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do +for luaversion in luajit lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no]) if test ${have_lua} = yes; then break @@ -593,21 +589,14 @@ if test x"${LUA_LIBS}" = x"" ; then fi AC_ARG_ENABLE(srtp, -[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"]) +[AS_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"]) AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"]) have_openal=no -AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"]) +AC_CHECK_LIB(openal, alcLoopbackOpenDeviceSOFT, [have_openal="yes"]) AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"]) -AC_ARG_ENABLE(zrtp, - [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) -if test "x$enable_zrtp" = "xyes" ; then - LIBS="-lpthread $LIBS" - APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP) -fi - PA_LIBS= PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) @@ -622,8 +611,6 @@ fi AC_SUBST(PA_LIBS) -AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"]) - AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) AC_ARG_ENABLE(core-odbc-support, @@ -665,12 +652,13 @@ AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) case $host in *-darwin*) path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig + path_push_unique PKG_CONFIG_PATH /usr/local/opt/openssl/lib/pkgconfig ;; esac if test "$PKG_CONFIG" = "no" \ || test x"$enable_core_pgsql_pkgconfig" = x"no" \ - || ! pkg-config libpq; then + || ! pkg-config --modversion libpq > /dev/null; then if test "$PG_CONFIG" != "no"; then AC_MSG_CHECKING([for PostgreSQL libraries via pg_config]) POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" @@ -682,7 +670,6 @@ if test "$PKG_CONFIG" = "no" \ POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'` fi else - AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config]) POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`" POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`" @@ -699,7 +686,13 @@ AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Spe AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against]) AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against]) have_libpq=no +save_LIBS="${LIBS}" +save_CPPFLAGS="${CPPFLAGS}" +LIBS="${POSTGRESQL_LDFLAGS}" +CPPFLAGS="${POSTGRESQL_CFLAGS}" AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"]) +LIBS="${save_LIBS}" +CPPFLAGS="${save_CPPFLAGS}" AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"]) AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS]) AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS]) @@ -719,7 +712,7 @@ PKG_CHECK_MODULES([SPANDSP], [spandsp >= 3.0],[ AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent]) ]) -PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.12.12],[ +PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.13.15],[ AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[ AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent]) ]) @@ -832,10 +825,12 @@ PKG_CHECK_MODULES([AMRWB], [opencore-amrwb >= 0.1.0 vo-amrwbenc >= 0.1.0],[ AM_CONDITIONAL([HAVE_AMRWB],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMRWB],[false])]) +PKG_CHECK_MODULES([STIRSHAKEN], [stirshaken],[ + AM_CONDITIONAL([HAVE_STIRSHAKEN],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_STIRSHAKEN],[false])]) + AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no) AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"]) -AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no) -AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"]) save_LIBS="$LIBS" LIBS= @@ -872,8 +867,14 @@ AC_SUBST(LIBTOOL_LIB_EXTEN) # Checks for header files. AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h]) +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h sys/time.h]) # Solaris 11 privilege management AS_CASE([$host], @@ -917,13 +918,38 @@ AC_SUBST(HAVE_SYS_SELECT_H_DEFINE) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T -AC_HEADER_TIME +m4_warn([obsolete], +[Update your code to rely only on HAVE_SYS_TIME_H, +then remove this warning and the obsolete code below it. +All current systems provide time.h; it need not be checked for. +Not all systems provide sys/time.h, but those that do, all allow +you to include it and time.h simultaneously.])dnl +AC_CHECK_HEADERS_ONCE([sys/time.h]) +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both + and . This macro is obsolete.]) +fi +# End of obsolete code. + AC_STRUCT_TM # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC -AC_TYPE_SIGNAL +m4_warn([obsolete], +[your code may safely assume C89 semantics that RETSIGTYPE is void. +Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl +AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([#include +#include +], + [return *(signal (0, 0)) (0) == 1;])], + [ac_cv_type_signal=int], + [ac_cv_type_signal=void])]) +AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers + (`int' or `void').]) + AC_FUNC_STRFTIME AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll]) AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups getrusage]) @@ -1028,10 +1054,9 @@ AC_SUBST(DIRECTORY_SEPARATOR) va_list_is_array=no AC_MSG_CHECKING(whether va_list is an array) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -], [va_list list1, list2; list1 = list2;], , -va_list_is_array=yes) +]], [[va_list list1, list2; list1 = list2;]])],[],[va_list_is_array=yes]) AC_MSG_RESULT($va_list_is_array) if test x"$va_list_is_array" = xyes; then VA_LIST_IS_ARRAY_DEFINE=1 @@ -1042,9 +1067,7 @@ AC_SUBST(VA_LIST_IS_ARRAY_DEFINE) AC_MSG_CHECKING(whether compiler has __attribute__) -AC_TRY_COMPILE(, [int x __attribute__((__unused__));], -compiler_has_attribute=yes, -compiler_has_attribute=no) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int x __attribute__((__unused__));]])],[compiler_has_attribute=yes],[compiler_has_attribute=no]) AC_MSG_RESULT($compiler_has_attribute) if test x"$compiler_has_attribute" = xyes; then ATTR_UNUSED="__attribute__((__unused__))" @@ -1057,7 +1080,7 @@ AC_SUBST(ATTR_UNUSED) saved_CFLAGS="$CFLAGS" AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [ CFLAGS="$CFLAGS -Wdeclaration-after-statement" -AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no]) ]) AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement) if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then @@ -1070,7 +1093,7 @@ if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [ CFLAGS="$CFLAGS -Wno-extended-offsetof" - AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) ]) AC_MSG_RESULT($ac_cv_clang_extended_offsetof) if test x"$ac_cv_clang_extended_offsetof" = xyes; then @@ -1080,13 +1103,13 @@ if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then fi # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready -# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_h323 mod_khomp -# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed +# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_opal mod_h323 mod_khomp +# mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed # #saved_CFLAGS="$CFLAGS" #AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [ #CFLAGS="$CFLAGS -Wunused-but-set-variable" -#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no]) +#AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no]) #]) #AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable) #if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then @@ -1111,7 +1134,7 @@ AC_CHECK_SIZEOF(void*, 4) if test "x$ac_cv_sizeof_voidp" != "x"; then voidp_size=$ac_cv_sizeof_voidp else - AC_ERROR([Cannot determine size of void*]) + AC_MSG_ERROR(Cannot determine size of void*) fi if test "$ac_cv_sizeof_short" = "2"; then @@ -1156,7 +1179,7 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then int64_value="__int64" long_value="__int64" else - AC_ERROR([could not detect a 64-bit integer type]) + AC_MSG_ERROR(could not detect a 64-bit integer type) fi if test "$ac_cv_type_size_t" = "yes"; then @@ -1353,7 +1376,21 @@ PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])]) PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[ - AM_CONDITIONAL([HAVE_SHOUT],[true])],[ + AM_CONDITIONAL([HAVE_SHOUT],[true]) + SHOUT_VERSION="`$PKG_CONFIG --modversion shout`" + SHOUT_MAJOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f1`" + SHOUT_MINOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f2`" + SHOUT_PATCH_VERSION="`echo $SHOUT_VERSION | cut -d. -f3`" + test -n "$SHOUT_PATCH_VERSION" || SHOUT_PATCH_VERSION=0 + AC_MSG_NOTICE([SHOUT version: $SHOUT_VERSION]) + AC_MSG_NOTICE([SHOUT major version: $SHOUT_MAJOR_VERSION]) + AC_MSG_NOTICE([SHOUT minor version: $SHOUT_MINOR_VERSION]) + AC_MSG_NOTICE([SHOUT patch version: $SHOUT_PATCH_VERSION]) + AC_SUBST([SHOUT_VERSION]) + AC_SUBST([SHOUT_MAJOR_VERSION]) + AC_SUBST([SHOUT_MINOR_VERSION]) + AC_SUBST([SHOUT_PATCH_VERSION]) + ],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])]) mp3lame=false @@ -1398,7 +1435,9 @@ PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[ PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[ AM_CONDITIONAL([HAVE_OPENCV],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])]) + PKG_CHECK_MODULES([OPENCV], [opencv4 >= 2.4.5],[ + AM_CONDITIONAL([HAVE_OPENCV],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])]) PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[ AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[ @@ -1517,13 +1556,33 @@ PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[ ]) ]) -PKG_CHECK_MODULES([KS], [libks >= 1.1.0],[ +PKG_CHECK_MODULES([KS], [libks2 >= 2.0.0],[ AM_CONDITIONAL([HAVE_KS],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false])]) + PKG_CHECK_MODULES([KS], [libks >= 1.8.2],[ + AM_CONDITIONAL([HAVE_KS],[true])],[ + if module_enabled mod_verto; then + AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_verto in modules.conf]) + else + if module_enabled mod_signalwire; then + AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_signalwire in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false]) + fi + fi + ]) +]) -PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[ +PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client2 >= 2.0.0],[ AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false])]) + PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[ + AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[ + if module_enabled mod_signalwire; then + AC_MSG_ERROR([You need to either install signalwire-client-c2 or signalwire-client-c or disable mod_signalwire in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false]) + fi + ]) +]) PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[ AM_CONDITIONAL([HAVE_AMQP],[true])],[ @@ -1566,6 +1625,17 @@ AS_IF([test "x$enable_core_libedit_support" != "xno"],[ AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support]) ])])]) +AC_ARG_ENABLE(systemd, + [AS_HELP_STRING([--enable-systemd], [Compile with systemd notify support])]) + +AS_IF([test "x$enable_systemd" = "xyes"],[ + PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 219], [ + AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd is available])]) +]) + +AC_SUBST(SYSTEMD_LIBS) + + dnl DH: Added for including libwebsockets AC_ARG_WITH(lws, [AS_HELP_STRING([--with-lws], @@ -1580,14 +1650,14 @@ else AM_CONDITIONAL([HAVE_LWS],[false]) fi -dnl DH: Added for including google protobuf libs +dnl DH: Added for including google protobuf libs and aws sdk AC_ARG_WITH(extra, [AS_HELP_STRING([--with-extra], [enable support for extra modules which require google rpc (libgrpc++ and libgrpc)])], [with_extra="$withval"], [with_extra="no"]) if test "$with_extra" = "yes"; then - PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ + PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ AM_CONDITIONAL([HAVE_GRPC],[true])], [ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GRPC],[false])]) else @@ -1720,7 +1790,7 @@ if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then fi # -# Python checks for mod_python +# Python checks for mod_python (scroll down to see python3 checks for mod_python3) # AC_ARG_WITH( [python], @@ -1840,6 +1910,143 @@ else AC_MSG_WARN([python support disabled, building mod_python will fail!]) fi +# +# Python3 checks for mod_python3 +# +AC_ARG_WITH( + [python3], + [AS_HELP_STRING([--with-python3], [Use system provided version of python3 (default: try)])], + [with_python3="$withval"], + [with_python3="try"] +) + +if test "$with_python3" != "no" +then + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + + if test "$with_python3" != "yes" -a "$with_python3" != "try" ; then + AC_MSG_CHECKING([for python3]) + if test ! -x "$with_python3" ; then + AC_MSG_ERROR([Specified python3 does not exist or is not executable: $with_python3]) + fi + AC_MSG_RESULT([$with_python3]) + AC_SUBST([PYTHON3], ["$with_python3"]) + else + AC_PATH_PROG([PYTHON3], ["python3"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"]) + fi + + if test "$PYTHON3" != "no" ; then + AC_MSG_CHECKING([python3 version]) + PYTHON3_VER="`$PYTHON3 -V 2>&1 | cut -d' ' -f2`" + + if test -z "$PYTHON3_VER" ; then + AC_MSG_ERROR([Unable to detect python3 version]) + fi + AC_MSG_RESULT([$PYTHON3_VER]) + + AC_MSG_CHECKING([for python3 distutils]) + python3_result="`$PYTHON3 -c 'import distutils;' 2>&1`" + if test -z "$python3_result" ; then + python3_has_distutils="yes" + else + python3_has_distutils="no" + fi + AC_MSG_RESULT([$python3_has_distutils]) + + if test "$python3_has_distutils" != "no" ; then + AC_MSG_CHECKING([location of python3 site-packages]) + + PYTHON3_SITE_DIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`" + + if test -z "$PYTHON3_SITE_DIR" ; then + AC_MSG_ERROR([Unable to detect python3 site-packages path]) + elif test ! -d "$PYTHON3_SITE_DIR" ; then + AC_MSG_ERROR([Path $PYTHON3_SITE_DIR returned by python3 does not exist!]) + fi + AC_MSG_RESULT([$PYTHON3_SITE_DIR]) + AC_SUBST([PYTHON3_SITE_DIR], [$PYTHON3_SITE_DIR]) + + # + # python3 distutils found, get settings from python3 directly + # + PYTHON3_CFLAGS="`$PYTHON3 -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`" + PYTHON3_LDFLAGS="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]); print(\" \".join(libs));'`" + PYTHON3_LIB="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); print(\"python\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]);'`" + PYTHON3_LIBDIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`" + + # handle python3 being installed into /usr/local + AC_MSG_CHECKING([python3 libdir]) + if test -z "`echo $PYTHON3_LIBDIR | grep "/usr/lib"`" ; then + PYTHON3_LDFLAGS="-L$PYTHON3_LIBDIR $PYTHON3_LDFLAGS" + LIBS="-L$PYTHON3_LIBDIR $LIBS" + fi + AC_MSG_RESULT([$PYTHON3_LIBDIR]) + + # check libpython3 + AC_CHECK_LIB([$PYTHON3_LIB], [main], [has_libpython3="yes"], [has_libpython3="no"]) + + if test "$has_libpython3" = "no" ; then + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([$PYTHON3_LIB is unusable])], + [AC_MSG_ERROR([$PYTHON3_LIB is unusable])] + ) + fi + + # check whether system libpython3 is usable and has threads support + CFLAGS="$PYTHON3_CFLAGS" + LIBS="$PYTHON3_LDFLAGS" + AC_CHECK_FUNC([PyThread_init_thread], [python3_has_threads="yes"], [python3_has_threads="no"]) + + if test "$python3_has_threads" = "no"; then + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Your python3 lacks threads support, can not build mod_python3])], + [AC_MSG_ERROR([Your python3 lacks threads support, can not build mod_python3])] + ) + else + AC_MSG_NOTICE([Your python3 seems OK, do not forget to enable mod_python3 in modules.conf]) + AC_SUBST([PYTHON3_CFLAGS], [$PYTHON3_CFLAGS]) + AC_SUBST([PYTHON3_LDFLAGS], [$PYTHON3_LDFLAGS]) + fi + else + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Could not find or use python3 distutils module: $python3_result])], + [AC_MSG_ERROR([Could not find or use python3 distutils module: $python3_result])] + ) + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + unset python3_has_threads + unset python3_has_distutils + unset python3_result + else + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Could not find python3, mod_python3 will not build, use --with-python3 to specify the location])], + [AC_MSG_ERROR([Could not find python3, use --with-python3 to specify the location])] + ) + fi +else + AC_MSG_WARN([python3 support disabled, building mod_python3 will fail!]) +fi + +# pcap lib for unit-testing +AC_MSG_CHECKING(libpcap) +AC_CHECK_PROG(HAVE_PCAP_CONFIG,pcap-config,[true],[false]) +if test x"$HAVE_PCAP_CONFIG" = x"true"; then + AC_MSG_RESULT(yes) + PCAP_CONFIG=pcap-config + PCAP_LIBS="`$PCAP_CONFIG --libs`" + PCAP_CFLAGS="`$PCAP_CONFIG --cflags`" + AM_CONDITIONAL([HAVE_PCAP], [true]) +else + AC_MSG_RESULT(no) + AM_CONDITIONAL([HAVE_PCAP], [false]) +fi +AC_SUBST([PCAP_CFLAGS]) +AC_SUBST([PCAP_LIBS]) + # # SNMP checks for mod_snmp # @@ -1860,7 +2067,7 @@ CHECK_ERLANG # Enable clang address sanitizer bit build AC_ARG_ENABLE(address_sanitizer, - [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])], + [AS_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])], [enable_address_sanitizer="$enable_address_sanitizer"], [enable_address_sanitizer="no"]) @@ -1870,8 +2077,57 @@ if test "${enable_address_sanitizer}" = "yes"; then APR_ADDTO(LDFLAGS, -fsanitize=address) fi +# Enable HEAP profiler (requires libgoogle-perftools-dev package) +AC_ARG_ENABLE(heap_profiler, + [AS_HELP_STRING([--enable-heap-profiler],[build with google heap profiler])], + [enable_heap_profiler="$enable_heap_profiler"], + [enable_heap_profiler="no"]) + +# Enable CPU profiler (requires libgoogle-perftools-dev package) +AC_ARG_ENABLE(cpu_profiler, + [AS_HELP_STRING([--enable-cpu-profiler],[build with google cpu profiler])], + [enable_cpu_profiler="$enable_cpu_profiler"], + [enable_cpu_profiler="no"]) + +PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc], [have_tcmalloc=yes], [have_tcmalloc=no]) + +if test "${enable_heap_profiler}" = "yes" || test "${enable_cpu_profiler}" = "yes"; then + if test "x$have_tcmalloc" != "xyes" ; then + AC_MSG_ERROR([You must install libgoogle-perftools-dev in order to use heap or cpu profiler]) + fi +fi + +# WARNING: When both enabled you can NOT link them statically and MUST use the special library +if test "${enable_heap_profiler}" = "yes" && test "${enable_cpu_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -ltcmalloc_and_profiler) + APR_ADDTO(CXXFLAGS, -ltcmalloc_and_profiler) + APR_ADDTO(LDFLAGS, -ltcmalloc_and_profiler) +else + if test "${enable_heap_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -ltcmalloc) + APR_ADDTO(CXXFLAGS, -ltcmalloc) + APR_ADDTO(LDFLAGS, -ltcmalloc) + fi + + if test "${enable_cpu_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -lprofiler) + APR_ADDTO(CXXFLAGS, -lprofiler) + APR_ADDTO(LDFLAGS, -lprofiler) + fi +fi + +# Enable fake dlclose +AC_ARG_ENABLE(fake_dlclose, + [AS_HELP_STRING([--enable-fake-dlclose],[Do not unload dynamic libraries])], + [enable_fake_dlclose="$enable_fake_dlclose"], + [enable_fake_dlclose="no"]) + +if test "${enable_fake_dlclose}" = "yes"; then + APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_FAKE_DLCLOSE) +fi + AC_ARG_ENABLE(, - [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])], + [AS_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])], [enable_pool_sanitizer="$enable_pool_sanitizer"], [enable_pool_sanitizer="no"]) @@ -1892,6 +2148,7 @@ AC_CONFIG_FILES([Makefile src/mod/applications/mod_aws_lex/Makefile src/mod/applications/mod_aws_transcribe/Makefile src/mod/applications/mod_azure_transcribe/Makefile + src/mod/applications/mod_cobalt_transcribe/Makefile src/mod/applications/mod_deepgram_transcribe/Makefile src/mod/applications/mod_google_tts/Makefile src/mod/applications/mod_google_transcribe/Makefile @@ -1964,7 +2221,6 @@ AC_CONFIG_FILES([Makefile src/mod/asr_tts/mod_flite/Makefile src/mod/asr_tts/mod_pocketsphinx/Makefile src/mod/asr_tts/mod_tts_commandline/Makefile - src/mod/asr_tts/mod_unimrcp/Makefile src/mod/codecs/mod_amr/Makefile src/mod/codecs/mod_amrwb/Makefile src/mod/codecs/mod_b64/Makefile @@ -1993,7 +2249,6 @@ AC_CONFIG_FILES([Makefile src/mod/dialplans/mod_dialplan_xml/Makefile src/mod/directories/mod_ldap/Makefile src/mod/endpoints/mod_alsa/Makefile - src/mod/endpoints/mod_dingaling/Makefile src/mod/endpoints/mod_gsmopen/Makefile src/mod/endpoints/mod_h323/Makefile src/mod/endpoints/mod_khomp/Makefile @@ -2043,6 +2298,7 @@ AC_CONFIG_FILES([Makefile src/mod/languages/mod_managed/Makefile src/mod/languages/mod_perl/Makefile src/mod/languages/mod_python/Makefile + src/mod/languages/mod_python3/Makefile src/mod/languages/mod_v8/Makefile src/mod/languages/mod_yaml/Makefile src/mod/languages/mod_basic/Makefile @@ -2086,9 +2342,9 @@ AC_CONFIG_FILES([Makefile build/freeswitch.pc build/standalone_module/freeswitch.pc build/modmake.rules - libs/esl/Makefile - libs/esl/perl/Makefile - libs/esl/php/Makefile + libs/esl/Makefile + libs/esl/perl/Makefile + libs/esl/php/Makefile libs/xmlrpc-c/include/xmlrpc-c/config.h libs/xmlrpc-c/xmlrpc_config.h libs/xmlrpc-c/config.mk @@ -2109,7 +2365,7 @@ AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ]) LIBTOOL='$(SHELL) $(switch_builddir)/libtool' TOUCH_TARGET='if test -f "$@";then touch "$@";fi;' CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' -CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' +CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed "s/\#/\#\//"| sed -e "s|^.*/||" | sort | uniq )' OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )' OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' @@ -2150,16 +2406,7 @@ AC_CONFIG_SUBDIRS([libs/srtp]) if test "$use_system_apr" != "yes"; then AC_CONFIG_SUBDIRS([libs/apr]) fi -if test "$use_system_aprutil" != "yes"; then - AC_CONFIG_SUBDIRS([libs/apr-util]) -fi AC_CONFIG_SUBDIRS([libs/iksemel]) -AC_CONFIG_SUBDIRS([libs/libdingaling]) -AC_CONFIG_SUBDIRS([libs/freetdm]) -AC_CONFIG_SUBDIRS([libs/unimrcp]) -if test "x${enable_zrtp}" = "xyes"; then - AC_CONFIG_SUBDIRS([libs/libzrtp]) -fi case $host in *-openbsd*|*-netbsd*) diff --git a/packer/jambonz-feature-server/aws/files/mod_avmd.c.patch b/packer/jambonz-feature-server/aws/files/mod_avmd.c.patch index ae995b9..da43cd6 100644 --- a/packer/jambonz-feature-server/aws/files/mod_avmd.c.patch +++ b/packer/jambonz-feature-server/aws/files/mod_avmd.c.patch @@ -1,25 +1,22 @@ ---- mod_avmd.c 2022-02-10 11:19:05 -+++ mod_avmd.c.new 2023-04-19 13:28:03 -@@ -1476,15 +1476,20 @@ - } - if ((SWITCH_CALL_DIRECTION_OUTBOUND == switch_channel_direction(channel)) && (avmd_session->settings.outbound_channnel == 1)) { - flags |= SMBF_READ_REPLACE; -- direction = "READ_REPLACE"; -+ direction = "READ_REPLACE"; - } -- if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) && (avmd_session->settings.inbound_channnel == 1)) { -+ if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) /* && (avmd_session->settings.inbound_channnel == 1) */) { -+ /* DCH: for drachtio-fsmrf */ -+ flags |= SMBF_READ_REPLACE; -+ direction = "READ_REPLACE"; +--- mod_avmd.c 2023-08-23 12:41:53.641925581 +0000 ++++ mod_avmd.c.new 2023-08-23 17:55:57.412134779 +0000 +@@ -1483,13 +1483,18 @@ + flags |= SMBF_READ_REPLACE; + direction = "READ_REPLACE"; + } +- if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) && (avmd_session->settings.inbound_channnel == 1)) { ++ if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) /* && (avmd_session->settings.inbound_channnel == 1) */) { ++ /* DCH: for drachtio-fsmrf */ ++ flags |= SMBF_READ_REPLACE; ++ direction = "READ_REPLACE"; +/* - flags |= SMBF_WRITE_REPLACE; + flags |= SMBF_WRITE_REPLACE; if (!strcmp(direction, "READ_REPLACE")) { direction = "READ_REPLACE | WRITE_REPLACE"; } else { direction = "WRITE_REPLACE"; } +*/ - } - - if (flags == 0) { + } + + if (flags == 0) { diff --git a/packer/jambonz-feature-server/aws/files/mod_httapi.c.patch b/packer/jambonz-feature-server/aws/files/mod_httapi.c.patch index eab370d..eae028a 100644 --- a/packer/jambonz-feature-server/aws/files/mod_httapi.c.patch +++ b/packer/jambonz-feature-server/aws/files/mod_httapi.c.patch @@ -1,42 +1,43 @@ ---- mod_httapi.c 2023-03-01 13:57:28 -+++ mod_httapi.c.new 2023-03-01 14:19:34 -@@ -2472,6 +2472,12 @@ +--- mod_httapi.c 2023-08-23 17:17:49.626199388 +0000 ++++ mod_httapi.c.new 2023-08-23 18:04:06.972949593 +0000 +@@ -2477,6 +2477,13 @@ char *ua = NULL; const char *profile_name = NULL; int tries = 10; -+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && -+ strstr(url, "X-Amz-Algorithm") != NULL && -+ strstr(url, "X-Amz-Credential") != NULL && -+ strstr(url, "X-Amz-Date") != NULL && -+ strstr(url, "X-Amz-Expires") != NULL && -+ strstr(url, "X-Amz-SignedHeaders") != NULL; - ++ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && ++ strstr(url, "X-Amz-Algorithm") != NULL && ++ strstr(url, "X-Amz-Credential") != NULL && ++ strstr(url, "X-Amz-Date") != NULL && ++ strstr(url, "X-Amz-Expires") != NULL && ++ strstr(url, "X-Amz-SignedHeaders") != NULL; ++ + if (context->url_params) { profile_name = switch_event_get_header(context->url_params, "profile_name"); -@@ -2614,7 +2620,7 @@ +@@ -2619,7 +2626,7 @@ switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) client); } else { switch_curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1); - switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); + if (!awsSignedUrl) switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); - } - - if (headers) { -@@ -2783,6 +2789,12 @@ + + /* Prevent writing the data (headers in this case) to stdout */ + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, dummy_save_file_callback); +@@ -2789,6 +2796,12 @@ char *metadata; const char *ext = NULL; const char *err_msg = NULL; -+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && -+ strstr(url, "X-Amz-Algorithm") != NULL && -+ strstr(url, "X-Amz-Credential") != NULL && -+ strstr(url, "X-Amz-Date") != NULL && -+ strstr(url, "X-Amz-Expires") != NULL && -+ strstr(url, "X-Amz-SignedHeaders") != NULL; - ++ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && ++ strstr(url, "X-Amz-Algorithm") != NULL && ++ strstr(url, "X-Amz-Credential") != NULL && ++ strstr(url, "X-Amz-Date") != NULL && ++ strstr(url, "X-Amz-Expires") != NULL && ++ strstr(url, "X-Amz-SignedHeaders") != NULL; + load_cache_data(context, url); - -@@ -2831,7 +2843,7 @@ - + +@@ -2837,7 +2850,7 @@ + if (!unreachable && !zstr(context->metadata)) { metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", - url, @@ -44,12 +45,12 @@ switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), switch_event_get_header_nil(headers, "content-length"), -@@ -2855,7 +2867,7 @@ - - +@@ -2861,7 +2874,7 @@ + + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", - url, -+ awsSignedUrl ? context->cache_file : url, ++ awsSignedUrl ? context->cache_file : url, switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), switch_event_get_header_nil(headers, "content-length"), diff --git a/packer/jambonz-feature-server/aws/files/modules.conf.in.extra b/packer/jambonz-feature-server/aws/files/modules.conf.in.extra index 081860d..b803c31 100644 --- a/packer/jambonz-feature-server/aws/files/modules.conf.in.extra +++ b/packer/jambonz-feature-server/aws/files/modules.conf.in.extra @@ -2,6 +2,7 @@ applications/mod_audio_fork applications/mod_aws_lex applications/mod_aws_transcribe applications/mod_azure_transcribe +applications/mod_cobalt_transcribe applications/mod_deepgram_transcribe applications/mod_google_tts applications/mod_google_transcribe diff --git a/packer/jambonz-feature-server/aws/files/modules.conf.vanilla.xml.extra b/packer/jambonz-feature-server/aws/files/modules.conf.vanilla.xml.extra index 4774bf7..3da005a 100644 --- a/packer/jambonz-feature-server/aws/files/modules.conf.vanilla.xml.extra +++ b/packer/jambonz-feature-server/aws/files/modules.conf.vanilla.xml.extra @@ -1,160 +1,161 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - + + + - - + + diff --git a/packer/jambonz-feature-server/aws/files/switch_core_media.c.patch b/packer/jambonz-feature-server/aws/files/switch_core_media.c.patch index 3d86c06..2a550fe 100644 --- a/packer/jambonz-feature-server/aws/files/switch_core_media.c.patch +++ b/packer/jambonz-feature-server/aws/files/switch_core_media.c.patch @@ -1,8 +1,8 @@ ---- switch_core_media.c 2022-03-04 19:02:35.000000000 -0500 -+++ switch_core_media.c.new 2022-03-05 08:54:38.000000000 -0500 -@@ -2749,7 +2749,7 @@ +--- switch_core_media.c 2023-08-23 17:17:24.081729695 +0000 ++++ switch_core_media.c.new 2023-08-23 17:48:32.812205983 +0000 +@@ -2639,7 +2639,7 @@ *(buf + datalen) = '\0'; - + while (*buf & 0x80) { - if (buf + 3 > e) { + if (buf + 3 > e || count >= MAX_RED_FRAMES) { diff --git a/packer/jambonz-feature-server/aws/files/switch_rtp.c.patch b/packer/jambonz-feature-server/aws/files/switch_rtp.c.patch index ee9debf..792cf0a 100644 --- a/packer/jambonz-feature-server/aws/files/switch_rtp.c.patch +++ b/packer/jambonz-feature-server/aws/files/switch_rtp.c.patch @@ -1,35 +1,33 @@ ---- switch_rtp.c 2021-01-12 02:11:42.334172596 +0000 -+++ switch_rtp.c.new 2021-01-12 02:12:42.695207260 +0000 -@@ -5639,8 +5639,8 @@ +--- switch_rtp.c 2023-08-23 17:17:24.229732433 +0000 ++++ switch_rtp.c.new 2023-08-23 17:41:05.504067569 +0000 +@@ -5482,7 +5482,7 @@ static switch_size_t do_flush(switch_rtp_t *rtp_session, int force, switch_size_t bytes_in) { int was_blocking = 0; - switch_size_t bytes; -- uint32_t flushed = 0; + //switch_size_t bytes; -+ //uint32_t flushed = 0; switch_size_t bytes_out = 0; - + if (!switch_rtp_ready(rtp_session)) { -@@ -5700,7 +5700,7 @@ +@@ -5542,7 +5542,7 @@ #endif handle_rfc2833(rtp_session, bytes_in, &do_cng); } - -+/* ++/* DH: disable this flushing feature, would prefer to receive all packets do { if (switch_rtp_ready(rtp_session)) { bytes = sizeof(rtp_msg_t); -@@ -5713,7 +5713,7 @@ +@@ -5555,7 +5555,7 @@ rtp_session->last_media = switch_micro_time_now(); } - + - /* Make sure to handle RFC2833 packets, even if we're flushing the packets */ -+ //Make sure to handle RFC2833 packets, even if we're flushing the packets ++ // Make sure to handle RFC2833 packets, even if we're flushing the packets if (bytes > rtp_header_len && rtp_session->recv_msg.header.version == 2 && rtp_session->recv_msg.header.pt == rtp_session->recv_te) { rtp_session->last_rtp_hdr = rtp_session->recv_msg.header; handle_rfc2833(rtp_session, bytes, &do_cng); -@@ -5732,7 +5732,7 @@ +@@ -5572,7 +5572,7 @@ break; } } while (bytes > 0); diff --git a/packer/jambonz-feature-server/aws/scripts/install_freeswitch.sh b/packer/jambonz-feature-server/aws/scripts/install_freeswitch.sh index cdb3f8a..4d6f1d6 100644 --- a/packer/jambonz-feature-server/aws/scripts/install_freeswitch.sh +++ b/packer/jambonz-feature-server/aws/scripts/install_freeswitch.sh @@ -1,12 +1,12 @@ #!/bin/bash -FREESWITCH_VERSION=v1.10.5 -GRPC_VERSION=c66d2cc -#GRPC_VERSION=v1.39.1 -#GOOGLE_API_VERSION=v1p1beta1-speech -GOOGLE_API_VERSION=e9da6f8b469c52b83f900e820be30762e9e05c57 +FREESWITCH_VERSION=v1.10.10 +SPAN_DSP_VERSION=0d2e6ac +GRPC_VERSION=v1.57.0 +GOOGLE_API_VERSION=29374574304f3356e64423acc9ad059fe43f09b5 +#AWS_SDK_VERSION=1.11.143 # newer but buggy with s2n_init crashes and weird slowdown on voice playout in FS AWS_SDK_VERSION=1.8.129 -LWS_VERSION=v3.2.3 -MODULES_VERSION=v0.7.2 +LWS_VERSION=v4.3.2 +MODULES_VERSION=v0.8.4 echo "freeswitch version to install is ${FREESWITCH_VERSION}" echo "drachtio modules version to install is ${MODULES_VERSION}" @@ -18,8 +18,8 @@ echo "LWS_VERSION version to install is ${LWS_VERSION}" export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH cd /tmp -tar xvfz SpeechSDK-Linux-1.30.0.tar.gz -cd SpeechSDK-Linux-1.30.0 +tar xvfz SpeechSDK-Linux-1.32.1.tar.gz +cd SpeechSDK-Linux-1.32.1 sudo cp -r include /usr/local/include/MicrosoftSpeechSDK sudo cp -r lib/ /usr/local/lib/MicrosoftSpeechSDK if [ "$ARCH" == "arm64" ]; then @@ -34,8 +34,8 @@ if [ "$ARCH" == "amd64" ]; then fi cd /usr/local/src -echo remove SpeechSDK-Linux-1.30.0 -sudo rm -Rf /tmp/SpeechSDK-Linux-1.30.0.tgz /tmp/SpeechSDK-Linux-1.30.0 +echo remove SpeechSDK-Linux-1.32.1 +sudo rm -Rf /tmp/SpeechSDK-Linux-1.32.1.tgz /tmp/SpeechSDK-Linux-1.32.1 echo done echo config git @@ -51,8 +51,8 @@ cd freeswitch/libs git clone https://github.com/drachtio/nuance-asr-grpc-api.git -b main git clone https://github.com/drachtio/riva-asr-grpc-api.git -b main git clone https://github.com/drachtio/soniox-asr-grpc-api.git -b main -git clone https://github.com/freeswitch/spandsp.git -b master -cd spandsp && git checkout 728b60abdd1a71e254b8e831e9156521d788b2b9 && cd .. +git clone https://github.com/drachtio/cobalt-asr-grpc-api.git -b main +git clone https://github.com/freeswitch/spandsp.git && cd spandsp && git checkout ${SPAN_DSP_VERSION} && cd .. git clone https://github.com/freeswitch/sofia-sip.git -b master git clone https://github.com/dpirch/libfvad.git git clone https://github.com/aws/aws-sdk-cpp.git -b ${AWS_SDK_VERSION} @@ -64,6 +64,7 @@ sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_audio_fork /us sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_aws_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_azure_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_azure_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_lex /usr/local/src/freeswitch/src/mod/applications/mod_aws_lex +sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_cobalt_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_cobalt_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_deepgram_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_deepgram_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_google_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_ibm_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_ibm_transcribe @@ -73,9 +74,6 @@ sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_soniox_transcr sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_jambonz_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_jambonz_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_tts /usr/local/src/freeswitch/src/mod/applications/mod_google_tts sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_dialogflow /usr/local/src/freeswitch/src/mod/applications/mod_dialogflow - -sudo sed -i -r -e 's/(.*AM_CFLAGS\))/\1 -g -O0/g' /usr/local/src/freeswitch/src/mod/applications/mod_audio_fork/Makefile.am -sudo sed -i -r -e 's/(.*-std=c++11)/\1 -g -O0/g' /usr/local/src/freeswitch/src/mod/applications/mod_audio_fork/Makefile.am # copy Makefiles and patches into place cp /tmp/configure.ac.extra /usr/local/src/freeswitch/configure.ac @@ -88,44 +86,67 @@ cp /tmp/switch_core_media.c.patch /usr/local/src/freeswitch/src cp /tmp/mod_avmd.c.patch /usr/local/src/freeswitch/src/mod/applications/mod_avmd cp /tmp/mod_httapi.c.patch /usr/local/src/freeswitch/src/mod/applications/mod_httapi -# patch freeswitch cd /usr/local/src/freeswitch/src +echo patching switch_rtp patch < switch_rtp.c.patch +echo patching switch_core_media patch < switch_core_media.c.patch cd /usr/local/src/freeswitch/src/mod/applications/mod_avmd +echo patching mod_avmd patch < mod_avmd.c.patch cd /usr/local/src/freeswitch/src/mod/applications/mod_httapi +echo patching mod_httapi patch < mod_httapi.c.patch # build libwebsockets +echo building lws cd /usr/local/src/libwebsockets sudo mkdir -p build && cd build && sudo cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && sudo make && sudo make install # build libfvad cd /usr/local/src/freeswitch/libs/libfvad +# use our version of libfvad configure.ac - should only do this on debian 12 +if [ "$DISTRO" == "debian-12" ]; then + echo "patching libfvad configure.ac to remove deprecated commands" + sudo cp /tmp/configure.ac.libfvad configure.ac +fi +echo building libfvad sudo autoreconf -i && sudo ./configure && sudo make -j 4 && sudo make install # build spandsp +echo building spandsp cd /usr/local/src/freeswitch/libs/spandsp ./bootstrap.sh && ./configure && make -j 4 && sudo make install # build sofia +echo building sofia cd /usr/local/src/freeswitch/libs/sofia-sip ./bootstrap.sh && ./configure && make -j 4 && sudo make install # build aws-c-common +echo building aws-c-common cd /usr/local/src/freeswitch/libs/aws-c-common mkdir -p build && cd build cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" make -j 4 && sudo make install # build aws-sdk-cpp +echo building aws-sdk-cpp cd /usr/local/src/freeswitch/libs/aws-sdk-cpp +git submodule update --init --recursive mkdir -p build && cd build cmake .. -DBUILD_ONLY="lexv2-runtime;transcribestreaming" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" -make -j 4 && sudo make install +if [ "$DISTRO" == "debian-12" ]; then + echo "patching aws-sdk-cpp to fix debian 12 build" + sudo sed -i 's/uint8_t arr\[16\];/uint8_t arr\[16\] = {0};/g' /usr/local/src/freeswitch/libs/aws-sdk-cpp/build/.deps/build/src/AwsCCommon/tests/byte_buf_test.c + sudo sed -i 's/char filename_array\[64\];/char filename_array\[64\] = {0};/g' /usr/local/src/freeswitch/libs/aws-sdk-cpp/build/.deps/build/src/AwsCCommon/tests/logging/logging_test_utilities.c + cmake .. -DBUILD_ONLY="lexv2-runtime;transcribestreaming" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" +fi +sudo make -j 4 && sudo make install +sudo find /usr/local/src/freeswitch/libs/aws-sdk-cpp/ -type f -name "*.pc" | sudo xargs cp -t /usr/local/lib/pkgconfig/ # build grpc +echo building grpc cd /usr/local/src/grpc git submodule update --init --recursive mkdir -p cmake/build @@ -135,6 +156,7 @@ make -j 4 sudo make install # build googleapis +echo building googleapis cd /usr/local/src/freeswitch/libs/googleapis echo "Ref: https://github.com/GoogleCloudPlatform/cpp-samples/issues/113" sed -i 's/\$fields/fields/' google/maps/routes/v1/route_service.proto @@ -156,11 +178,16 @@ echo "building protobuf stubs for sonioxasr" cd /usr/local/src/freeswitch/libs/soniox-asr-grpc-api LANGUAGE=cpp make +# build cobalt protobufs +echo "building protobuf stubs for cobalt" +cd /usr/local/src/freeswitch/libs/cobalt-asr-grpc-api +LANGUAGE=cpp make + # build freeswitch echo "building freeswitch" cd /usr/local/src/freeswitch sudo ./bootstrap.sh -j -sudo ./configure --enable-tcmalloc=yes --with-lws=yes --with-extra=yes +sudo ./configure --enable-tcmalloc=yes --with-lws=yes --with-extra=yes --with-aws=yes sudo make -j 4 sudo make install sudo make cd-sounds-install cd-moh-install @@ -186,4 +213,3 @@ sudo chmod a+x /etc/cron.daily/freeswitch_log_rotation echo "downloading soniox root verification certificate" cd /usr/local/freeswitch/certs wget https://raw.githubusercontent.com/grpc/grpc/master/etc/roots.pem - diff --git a/packer/jambonz-feature-server/aws/scripts/install_nodejs.sh b/packer/jambonz-feature-server/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-feature-server/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-feature-server/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-feature-server/aws/scripts/install_os_tuning.sh b/packer/jambonz-feature-server/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-feature-server/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-feature-server/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-feature-server/aws/template.json b/packer/jambonz-feature-server/aws/template.json index f444507..3b5247d 100644 --- a/packer/jambonz-feature-server/aws/template.json +++ b/packer/jambonz-feature-server/aws/template.json @@ -3,9 +3,9 @@ "region": "us-east-1", "ssh_username": "admin", "ami_description": "jambonz feature server", - "instance_type": "t2.xlarge", - "drachtio_version": "v0.8.22", - "jambonz_version": "v0.8.4-4", + "instance_type": "c6in.xlarge", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_arch": "amd64", "ami_base_image_owner": "136693071363", "install_telegraf": "yes", @@ -56,13 +56,13 @@ "sudo apt-get update", "sudo apt-get remove --auto-remove nftables", "sudo apt-get purge nftables", - "sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", + "sudo apt-get -y install python-is-python3 lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", "curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\", "libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\", "libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\", "libhiredis-dev gperf libspandsp-dev default-libmysqlclient-dev htop dnsutils gdb libtcmalloc-minimal4 \\", "gnupg2 wget pkg-config ca-certificates libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev \\", - "libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm valgrind libswscale-dev haveged \\", + "libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm valgrind libswscale-dev haveged libre2-dev \\", "libopus-dev libsndfile-dev libshout3-dev libmpg123-dev libmp3lame-dev libopusfile-dev libgoogle-perftools-dev", "sudo chmod a+w /usr/local/src", "ssh-keyscan github.com >> ~/.ssh/known_hosts", @@ -81,6 +81,7 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { @@ -128,14 +129,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", - "sudo rm /home/admin/.ssh/known_hosts", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-mini/aws/files/Makefile.am.extra b/packer/jambonz-mini/aws/files/Makefile.am.extra index 7ba2f2e..7405e94 100644 --- a/packer/jambonz-mini/aws/files/Makefile.am.extra +++ b/packer/jambonz-mini/aws/files/Makefile.am.extra @@ -15,19 +15,8 @@ AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes) AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags) AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs)) endif -if SYSTEM_APRUTIL -AM_LIBAPU_CPPFLAGS := $(shell apu-1-config --includes) -AM_LIBAPU_LDFLAGS := $(shell apu-1-config --ldflags) -AM_LIBAPU_LIBS := $(shell apu-1-config \--libs) -AM_LIBAPU_LINKLIBTOOL := $(shell apu-1-config \--link-libtool) -else -AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes) -AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags) -AM_LIBAPU_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr-util/apu-1-config \--libs)) -endif - -AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) +AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) AM_CPPFLAGS = AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx AM_CPPFLAGS += $(SWITCH_AM_CXXFLAGS) @@ -141,11 +130,6 @@ CORE_LIBS= if ENABLE_LIBVPX CORE_LIBS += libs/libvpx/libvpx.a endif -if SYSTEM_APRUTIL -CORE_LIBS += $(AM_LIBAPU_LINKLIBTOOL) -else -CORE_LIBS += libs/apr-util/libaprutil-1.la -endif if SYSTEM_APR CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL) else @@ -189,8 +173,8 @@ endif # DH: GRPC if HAVE_GRPC -CORE_CFLAGS += -DSWITCH_HAVE_GRPC $(GRPC_CFLAGS) -GRPC_LIBS += -lgrpc++_reflection -lprotobuf +CORE_CFLAGS += -DSWITCH_HAVE_GRPC +GRPC_LIBS += -lgrpc++_reflection -lprotobuf endif ## @@ -252,7 +236,6 @@ libs/libyuv/source/scale_neon.cc \ libs/libyuv/source/scale_win.cc \ libs/libyuv/source/video_common.cc - libfreeswitch_libyuv_la_CPPFLAGS = -O2 -fomit-frame-pointer -Ilibs/libyuv/include CORE_LIBS+=libfreeswitch_libyuv.la endif @@ -327,6 +310,7 @@ libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.pb.cc \ libs/googleapis/gens/google/api/servicemanagement/v1/resources.pb.cc \ libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.grpc.pb.cc \ libs/googleapis/gens/google/api/billing.grpc.pb.cc \ +libs/googleapis/gens/google/api/policy.pb.cc \ libs/googleapis/gens/google/api/usage.pb.cc \ libs/googleapis/gens/google/api/config_change.pb.cc \ libs/googleapis/gens/google/api/context.grpc.pb.cc \ @@ -347,6 +331,8 @@ libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.grpc.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.pb.cc \ libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/resource.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/resource.grpc.pb.cc \ libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.pb.cc \ libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc \ libs/googleapis/gens/google/logging/type/http_request.grpc.pb.cc \ @@ -441,15 +427,24 @@ libs/soniox-asr-grpc-api/stubs/soniox/speech_service.grpc.pb.cc libfreeswitch_libsonioxapis_la_CPPFLAGS = -I/usr/local/include -I$(SONIOX_GENS_PATH) -std=c++17 -pthread -CORE_LIBS+=libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la -noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la +#cobalt asr +COBALT_GENS_PATH = libs/cobalt-asr-grpc-api/stubs/ + +nodist_libfreeswitch_libcobaltapis_la_SOURCES = \ +libs/cobalt-asr-grpc-api/stubs/cobaltspeech/transcribe/v5/transcribe.pb.cc \ +libs/cobalt-asr-grpc-api/stubs/cobaltspeech/transcribe/v5/transcribe.grpc.pb.cc + +libfreeswitch_libcobaltapis_la_CPPFLAGS = -I/usr/local/include -I$(COBALT_GENS_PATH) -I./libs/googleapis/gens -std=c++17 -pthread + +CORE_LIBS+=libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la libfreeswitch_libcobaltapis.la +noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la libfreeswitch_libnuanceapis.la libfreeswitch_libnvidiaapis.la libfreeswitch_libsonioxapis.la libfreeswitch_libcobaltapis.la endif lib_LTLIBRARIES = libfreeswitch.la libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) -libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined -libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(GRPC_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS) +libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) $(AWS_LDFLAGS) -no-undefined +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(SYSTEMD_LIBS) $(GRPC_LIBS) $(AWS_SDK_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) if HAVE_PNG @@ -460,19 +455,6 @@ if HAVE_ODBC libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) endif -if ENABLE_ZRTP -CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes -CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib -CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include -ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib -ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp -ZRTP_LIBS = -lbn -lzrtp -libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS) -libfreeswitch_la_LIBADD += $(ZRTP_LIBS) -CORE_LIBS += libs/libzrtp/libzrtp.a -LIBS += libs/libzrtp/third_party/bnlib/libbn.a -endif - library_includetestdir = $(includedir)/test library_includetest_HEADERS = \ src/include/test/switch_fct.h \ @@ -501,6 +483,7 @@ library_include_HEADERS = \ src/include/switch_dso.h \ src/include/switch_loadable_module.h \ src/include/switch_module_interfaces.h \ + src/include/switch_packetizer.h \ src/include/switch_platform.h \ src/include/switch_resample.h \ src/include/switch_regex.h \ @@ -510,6 +493,7 @@ library_include_HEADERS = \ src/include/switch_jitterbuffer.h \ src/include/switch_estimators.h \ src/include/switch_rtcp_frame.h \ + src/include/switch_spandsp.h \ src/include/switch_stun.h \ src/include/switch_nat.h \ src/include/switch_log.h \ @@ -532,6 +516,10 @@ library_include_HEADERS = \ src/include/switch_hashtable.h \ src/include/switch_image.h +#if HAVE_AWS_SDK +# library_include_HEADERS += src/include/aws_wrapper.h +#endif + nodist_libfreeswitch_la_SOURCES = \ src/include/switch_frame.h \ src/include/switch_swigable_cpp.h \ @@ -539,6 +527,7 @@ nodist_libfreeswitch_la_SOURCES = \ libfreeswitch_la_SOURCES = \ src/switch_apr.c \ + src/switch_apr_queue.c \ src/switch_buffer.c \ src/switch_caller.c \ src/switch_channel.c \ @@ -565,6 +554,7 @@ libfreeswitch_la_SOURCES = \ src/switch_version.c \ src/switch_core_media.c \ src/switch_core_video.c \ + src/switch_packetizer.c \ src/switch_sdp.c \ src/switch_scheduler.c \ src/switch_core_db.c \ @@ -584,6 +574,7 @@ libfreeswitch_la_SOURCES = \ src/switch_ivr_say.c \ src/switch_ivr_menu.c \ src/switch_ivr.c \ + src/switch_spandsp.c \ src/switch_stun.c \ src/switch_nat.c \ src/switch_log.c \ @@ -624,6 +615,10 @@ if ENABLE_CPP libfreeswitch_la_SOURCES += src/switch_cpp.cpp endif +#if HAVE_AWS_SDK +# libfreeswitch_la_SOURCES += src/aws_wrapper.cpp +#endif + $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h @@ -656,7 +651,7 @@ endif fs_encode_SOURCES = src/fs_encode.c fs_encode_CFLAGS = $(AM_CFLAGS) fs_encode_LDFLAGS = $(AM_LDFLAGS) -fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) +fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) if HAVE_ODBC fs_encode_LDADD += $(ODBC_LIB_FLAGS) @@ -781,9 +776,6 @@ src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_ libs/libedit/src/.libs/libedit.a: cd libs/libedit && $(MAKE) -libs/libzrtp/libzrtp.a: - cd libs/libzrtp && $(MAKE) - libs/libvpx/Makefile: libs/libvpx/.update cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 @@ -797,17 +789,15 @@ libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr && $(MAKE) $(MFLAGS) && touch libapr-1.la; fi -libs/apr-util/libaprutil-1.la: libs/apr/libapr-1.la libs/apr-util libs/apr-util/.update - @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr-util && $(MAKE) $(MFLAGS) && touch libaprutil-1.la; fi - -SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ +SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \ libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \ libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \ - libs/srtp/crypto/math/datatypes.c libs/srtp/crypto/math/stat.c \ + libs/srtp/crypto/math/datatypes.c \ libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \ libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \ - libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c libs/srtp/crypto/replay/ut_sim.c + libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c \ + libs/srtp/crypto/cipher/cipher_test_cases.c libs/srtp/crypto/hash/auth_test_cases.c libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC) touch $(switch_srcdir)/src/include/switch.h @@ -898,7 +888,7 @@ yesdepends: rm .nodepends iksemel-dep: - make -C src/mod/endpoints/mod_dingaling deps + make -C src/mod/formats/mod_ssml deps core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS) $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la @@ -942,11 +932,11 @@ pristine: git clean -fdx git reset --hard -update-clean: clean python-reconf +update-clean: clean python-reconf python3-reconf cd libs/esl && $(MAKE) clean cd libs/srtp && $(MAKE) clean -swigall: +swigall: src/include/switch_swigable_cpp.h @echo reswigging all sh $(switch_srcdir)/build/swigall.sh @@ -959,6 +949,10 @@ python-reconf: rm -f src/mod/languages/mod_python/Makefile ./config.status +python3-reconf: + rm -f src/mod/languages/mod_python3/Makefile + ./config.status + reconf: rm config.cache sh ./config.status --recheck @@ -974,7 +968,7 @@ iks-reconf: cd libs/iksemel && $(MAKE) clean cd libs/iksemel && autoreconf -fi cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS) - $(MAKE) mod_dingaling-clean + $(MAKE) mod_ssml-clean cluecon: @clear diff --git a/packer/jambonz-mini/aws/files/Makefile.am.grpc.patch b/packer/jambonz-mini/aws/files/Makefile.am.grpc.patch deleted file mode 100644 index da5e116..0000000 --- a/packer/jambonz-mini/aws/files/Makefile.am.grpc.patch +++ /dev/null @@ -1,175 +0,0 @@ ---- Makefile.am 2019-10-31 16:15:52.546094477 +0000 -+++ Makefile.am.new 2019-10-31 16:19:06.355020970 +0000 -@@ -188,6 +188,12 @@ - LWS_LIBS += -lwebsockets - endif - -+# DH: GRPC -+if HAVE_GRPC -+CORE_CFLAGS += -DSWITCH_HAVE_GRPC $(GRPC_CFLAGS) -+GRPC_LIBS += -lgrpc++_reflection -lprotobuf -+endif -+ - ## - ## libfreeswitch - ## -@@ -255,10 +261,158 @@ - CORE_LIBS+=libfreeswitch_libyuv.la - endif - -+if HAVE_GRPC -+GOOGLEAPIS_GENS_PATH = libs/googleapis/gens -+GOOGLEAPIS_LOGGING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/logging -name '*.pb.cc') -+GOOGLEAPIS_API_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/api -name '*.pb.cc') -+GOOGLEAPIS_RPC_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/rpc -name '*.pb.cc') -+GOOGLEAPIS_SPEECH_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/cloud/speech -name '*.pb.cc') -+GOOGLEAPIS_LONGRUNNING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/longrunning -name '*.pb.cc') -+GOOGLEAPIS_CCS = $(GOOGLEAPIS_API_CCS) $(GOOGLEAPIS_RPC_CCS) $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) -+ -+nodist_libfreeswitch_libgoogleapis_la_SOURCES = \ -+libs/googleapis/gens/google/api/monitoring.grpc.pb.cc \ -+libs/googleapis/gens/google/api/annotations.grpc.pb.cc \ -+libs/googleapis/gens/google/api/http.pb.cc \ -+libs/googleapis/gens/google/api/quota.pb.cc \ -+libs/googleapis/gens/google/api/quota.grpc.pb.cc \ -+libs/googleapis/gens/google/api/backend.grpc.pb.cc \ -+libs/googleapis/gens/google/api/service.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitored_resource.pb.cc \ -+libs/googleapis/gens/google/api/consumer.pb.cc \ -+libs/googleapis/gens/google/api/annotations.pb.cc \ -+libs/googleapis/gens/google/api/metric.pb.cc \ -+libs/googleapis/gens/google/api/logging.pb.cc \ -+libs/googleapis/gens/google/api/auth.grpc.pb.cc \ -+libs/googleapis/gens/google/api/distribution.grpc.pb.cc \ -+libs/googleapis/gens/google/api/label.grpc.pb.cc \ -+libs/googleapis/gens/google/api/launch_stage.grpc.pb.cc \ -+libs/googleapis/gens/google/api/launch_stage.pb.cc \ -+libs/googleapis/gens/google/api/httpbody.grpc.pb.cc \ -+libs/googleapis/gens/google/api/config_change.grpc.pb.cc \ -+libs/googleapis/gens/google/api/logging.grpc.pb.cc \ -+libs/googleapis/gens/google/api/context.pb.cc \ -+libs/googleapis/gens/google/api/system_parameter.pb.cc \ -+libs/googleapis/gens/google/api/distribution.pb.cc \ -+libs/googleapis/gens/google/api/control.pb.cc \ -+libs/googleapis/gens/google/api/consumer.grpc.pb.cc \ -+libs/googleapis/gens/google/api/label.pb.cc \ -+libs/googleapis/gens/google/api/documentation.pb.cc \ -+libs/googleapis/gens/google/api/log.pb.cc \ -+libs/googleapis/gens/google/api/usage.grpc.pb.cc \ -+libs/googleapis/gens/google/api/backend.pb.cc \ -+libs/googleapis/gens/google/api/control.grpc.pb.cc \ -+libs/googleapis/gens/google/api/log.grpc.pb.cc \ -+libs/googleapis/gens/google/api/source_info.grpc.pb.cc \ -+libs/googleapis/gens/google/api/billing.pb.cc \ -+libs/googleapis/gens/google/api/auth.pb.cc \ -+libs/googleapis/gens/google/api/resource.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/check_error.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/check_error.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/distribution.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/distribution.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/operation.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/operation.pb.cc \ -+libs/googleapis/gens/google/api/metric.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitored_resource.grpc.pb.cc \ -+libs/googleapis/gens/google/api/http.grpc.pb.cc \ -+libs/googleapis/gens/google/api/httpbody.pb.cc \ -+libs/googleapis/gens/google/api/endpoint.pb.cc \ -+libs/googleapis/gens/google/api/documentation.grpc.pb.cc \ -+libs/googleapis/gens/google/api/system_parameter.grpc.pb.cc \ -+libs/googleapis/gens/google/api/endpoint.grpc.pb.cc \ -+libs/googleapis/gens/google/api/service.pb.cc \ -+libs/googleapis/gens/google/api/source_info.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/resources.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/resources.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.grpc.pb.cc \ -+libs/googleapis/gens/google/api/billing.grpc.pb.cc \ -+libs/googleapis/gens/google/api/usage.pb.cc \ -+libs/googleapis/gens/google/api/config_change.pb.cc \ -+libs/googleapis/gens/google/api/context.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitoring.pb.cc \ -+libs/googleapis/gens/google/api/field_behavior.pb.cc \ -+libs/googleapis/gens/google/api/client.pb.cc \ -+libs/googleapis/gens/google/rpc/error_details.grpc.pb.cc \ -+libs/googleapis/gens/google/rpc/code.pb.cc \ -+libs/googleapis/gens/google/rpc/status.pb.cc \ -+libs/googleapis/gens/google/rpc/status.grpc.pb.cc \ -+libs/googleapis/gens/google/rpc/error_details.pb.cc \ -+libs/googleapis/gens/google/rpc/code.grpc.pb.cc \ -+libs/googleapis/gens/google/longrunning/operations.grpc.pb.cc \ -+libs/googleapis/gens/google/longrunning/operations.pb.cc \ -+libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.pb.cc \ -+libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.pb.cc \ -+libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/http_request.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/log_severity.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/log_severity.pb.cc \ -+libs/googleapis/gens/google/logging/type/http_request.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_metrics.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/log_entry.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_config.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_config.pb.cc \ -+libs/googleapis/gens/google/logging/v2/log_entry.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_metrics.grpc.pb.cc \ -+libs/googleapis/gens/google/type/date.grpc.pb.cc \ -+libs/googleapis/gens/google/type/timeofday.pb.cc \ -+libs/googleapis/gens/google/type/latlng.grpc.pb.cc \ -+libs/googleapis/gens/google/type/money.pb.cc \ -+libs/googleapis/gens/google/type/date.pb.cc \ -+libs/googleapis/gens/google/type/postal_address.grpc.pb.cc \ -+libs/googleapis/gens/google/type/dayofweek.grpc.pb.cc \ -+libs/googleapis/gens/google/type/dayofweek.pb.cc \ -+libs/googleapis/gens/google/type/timeofday.grpc.pb.cc \ -+libs/googleapis/gens/google/type/color.pb.cc \ -+libs/googleapis/gens/google/type/postal_address.pb.cc \ -+libs/googleapis/gens/google/type/latlng.pb.cc \ -+libs/googleapis/gens/google/type/color.grpc.pb.cc \ -+libs/googleapis/gens/google/type/money.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/gcs.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/validation_result.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.pb.cc -+ -+libfreeswitch_libgoogleapis_la_CPPFLAGS = -I/usr/local/include -I$(GOOGLEAPIS_GENS_PATH) -std=c++11 -pthread -+ -+CORE_LIBS+=libfreeswitch_libgoogleapis.la -+noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la -+endif -+ - lib_LTLIBRARIES = libfreeswitch.la - libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) - libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined --libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) -+libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(GRPC_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) - libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) - - if HAVE_PNG diff --git a/packer/jambonz-mini/aws/files/Makefile.am.patch b/packer/jambonz-mini/aws/files/Makefile.am.patch deleted file mode 100644 index 3d9a565..0000000 --- a/packer/jambonz-mini/aws/files/Makefile.am.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Makefile.am 2019-09-30 19:01:33.268018459 +0000 -+++ Makefile.am.new 2019-09-30 23:04:33.949177848 +0000 -@@ -182,6 +182,12 @@ - CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS) - endif - -+# DH: LWS -+if HAVE_LWS -+CORE_CFLAGS += -DSWITCH_HAVE_LWS $(LWS_CFLAGS) -+LWS_LIBS += -lwebsockets -+endif -+ - ## - ## libfreeswitch - ## -@@ -252,7 +258,7 @@ - lib_LTLIBRARIES = libfreeswitch.la - libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) - libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined --libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) -+libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) - libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) - - if HAVE_PNG diff --git a/packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.30.0.tar.gz b/packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.32.1.tar.gz similarity index 56% rename from packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.30.0.tar.gz rename to packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.32.1.tar.gz index 5d2e6c6..90fca8a 100644 Binary files a/packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.30.0.tar.gz and b/packer/jambonz-mini/aws/files/SpeechSDK-Linux-1.32.1.tar.gz differ diff --git a/packer/jambonz-mini/aws/files/aws_wrapper.cpp b/packer/jambonz-mini/aws/files/aws_wrapper.cpp new file mode 100644 index 0000000..18e838b --- /dev/null +++ b/packer/jambonz-mini/aws/files/aws_wrapper.cpp @@ -0,0 +1,35 @@ +#include +#include +#include + +// C-compatible wrapper functions +extern "C" { + const char ALLOC_TAG[] = "jambonz"; + + void aws_init_api() { + const char* awsTrace = std::getenv("AWS_TRACE"); + Aws::SDKOptions options; + options.httpOptions.installSigPipeHandler = true; + + if (awsTrace && 0 == strcmp("1", awsTrace)) { + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + + Aws::Utils::Logging::InitializeAWSLogging( + Aws::MakeShared( + ALLOC_TAG, Aws::Utils::Logging::LogLevel::Trace, "aws_sdk_")); + } + + Aws::InitAPI(options); + } + + void aws_shutdown_api() { + Aws::SDKOptions options; + + const char* awsTrace = std::getenv("AWS_TRACE"); + if (awsTrace && 0 == strcmp("1", awsTrace)) { + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + Aws::Utils::Logging::ShutdownAWSLogging(); + } + Aws::ShutdownAPI(options); + } +} diff --git a/packer/jambonz-mini/aws/files/aws_wrapper.h b/packer/jambonz-mini/aws/files/aws_wrapper.h new file mode 100644 index 0000000..109c0c9 --- /dev/null +++ b/packer/jambonz-mini/aws/files/aws_wrapper.h @@ -0,0 +1,7 @@ +#ifndef AWS_WRAPPER_H +#define AWS_WRAPPER_H + +void aws_init_api(void); +void aws_shutdown_api(void); + +#endif // AWS_WRAPPER_H diff --git a/packer/jambonz-mini/aws/files/configure.ac.extra b/packer/jambonz-mini/aws/files/configure.ac.extra index b33c28a..89615bd 100644 --- a/packer/jambonz-mini/aws/files/configure.ac.extra +++ b/packer/jambonz-mini/aws/files/configure.ac.extra @@ -3,10 +3,10 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.10.5-release], bugs@freeswitch.org) +AC_INIT([freeswitch],[1.10.10-release],[bugs@freeswitch.org]) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [10]) -AC_SUBST(SWITCH_VERSION_MICRO, [5-release]) +AC_SUBST(SWITCH_VERSION_MICRO, [10-release]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) @@ -16,9 +16,9 @@ AC_CONFIG_AUX_DIR(build/config) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR([src/switch.c]) -AC_CONFIG_HEADER([src/include/switch_private.h]) -AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h]) -AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h]) +AC_CONFIG_HEADERS([src/include/switch_private.h]) +AC_CONFIG_HEADERS([libs/esl/src/include/esl_config_auto.h]) +AC_CONFIG_HEADERS([libs/xmlrpc-c/xmlrpc_amconfig.h]) AC_CANONICAL_HOST @@ -36,7 +36,7 @@ AC_SUBST(switch_builddir) # Enable 64 bit build AC_ARG_ENABLE(64, -[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) +[AS_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) if test "${enable_64}" = "yes"; then case "$host" in @@ -223,7 +223,7 @@ AC_ARG_WITH([pkgconfigdir], AC_SUBST([pkgconfigdir]) #Set default language -AC_LANG_C +AC_LANG([C]) # Checks for programs. AC_PROG_CC AC_PROG_CXX @@ -243,12 +243,12 @@ AC_PROG_AWK AC_PROG_MAKE_SET AC_PROG_INSTALL -#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html) +#override some default libtool behavior and invoke LT_INIT (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html) m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) m4_defun([_LT_AC_LANG_RC_CONFIG], [:]) AM_PROG_CC_C_O -AC_PROG_LIBTOOL +LT_INIT([disable-static]) #Check for compiler vendor AX_COMPILER_VENDOR @@ -295,7 +295,7 @@ fi # Optimize AC_ARG_ENABLE(optimization, -[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"]) +[AS_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"]) if test "${enable_optimizer}" = "yes" ; then AC_DEFINE([OPTIMZER],[],[Enable Optimization.]) @@ -341,7 +341,7 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xintel" ; then ;; esac else - AC_ERROR([Please update configure.in with SOLINK values for your compiler]) + AC_MSG_ERROR(Please update configure.in with SOLINK values for your compiler) fi ## @@ -372,9 +372,7 @@ if test "$ax_cv_c_compiler_vendor" = "gnu"; then AC_CACHE_CHECK([whether compiler supports -Wno-unused-result], [ac_cv_gcc_supports_w_no_unused_result], [ CFLAGS="$CFLAGS -Wno-unused-result -Wno-error=unused-result" - AC_TRY_COMPILE([],[return 0;], - [ac_cv_gcc_supports_w_no_unused_result=yes], - [ac_cv_gcc_supports_w_no_unused_result=no])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_supports_w_no_unused_result=yes],[ac_cv_gcc_supports_w_no_unused_result=no])]) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($ac_cv_gcc_supports_w_no_unused_result) @@ -382,9 +380,7 @@ if test "$ax_cv_c_compiler_vendor" = "gnu"; then AC_CACHE_CHECK([whether compiler supports -Wno-misleading-indentation], [ac_cv_gcc_supports_w_no_misleading_indentation], [ CFLAGS="$CFLAGS -Wno-misleading-indentation -Wno-error=misleading-indentation" - AC_TRY_COMPILE([],[return 0;], - [ac_cv_gcc_supports_w_no_misleading_indentation=yes], - [ac_cv_gcc_supports_w_no_misleading_indentation=no])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_supports_w_no_misleading_indentation=yes],[ac_cv_gcc_supports_w_no_misleading_indentation=no])]) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($ac_cv_gcc_supports_w_no_misleading_indentation) fi @@ -532,7 +528,7 @@ fi # Enable debugging (default: on) # (rename option if the default is changed) AC_ARG_ENABLE(debug, -[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"]) +[AS_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"]) if test "${enable_debug}" = "yes"; then AC_DEFINE([DEBUG],[],[Enable extra debugging.]) @@ -553,17 +549,17 @@ if test "${enable_debug}" = "yes"; then fi AC_ARG_ENABLE(libyuv, -[AC_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"]) +[AS_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"]) AM_CONDITIONAL([ENABLE_LIBYUV],[test "${enable_libyuv}" = "yes"]) AC_ARG_ENABLE(libvpx, -[AC_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"]) +[AS_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"]) AM_CONDITIONAL([ENABLE_LIBVPX],[test "${enable_libvpx}" = "yes"]) AC_ARG_ENABLE(cpp, -[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"]) +[AS_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"]) AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"]) @@ -582,7 +578,7 @@ AC_SUBST(SYS_XMLRPC_CFLAGS) AC_SUBST(SYS_XMLRPC_LDFLAGS) AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"]) -for luaversion in luajit lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do +for luaversion in luajit lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no]) if test ${have_lua} = yes; then break @@ -593,21 +589,14 @@ if test x"${LUA_LIBS}" = x"" ; then fi AC_ARG_ENABLE(srtp, -[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"]) +[AS_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"]) AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"]) have_openal=no -AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"]) +AC_CHECK_LIB(openal, alcLoopbackOpenDeviceSOFT, [have_openal="yes"]) AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"]) -AC_ARG_ENABLE(zrtp, - [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) -if test "x$enable_zrtp" = "xyes" ; then - LIBS="-lpthread $LIBS" - APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP) -fi - PA_LIBS= PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) @@ -622,8 +611,6 @@ fi AC_SUBST(PA_LIBS) -AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"]) - AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) AC_ARG_ENABLE(core-odbc-support, @@ -665,12 +652,13 @@ AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) case $host in *-darwin*) path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig + path_push_unique PKG_CONFIG_PATH /usr/local/opt/openssl/lib/pkgconfig ;; esac if test "$PKG_CONFIG" = "no" \ || test x"$enable_core_pgsql_pkgconfig" = x"no" \ - || ! pkg-config libpq; then + || ! pkg-config --modversion libpq > /dev/null; then if test "$PG_CONFIG" != "no"; then AC_MSG_CHECKING([for PostgreSQL libraries via pg_config]) POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" @@ -682,7 +670,6 @@ if test "$PKG_CONFIG" = "no" \ POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'` fi else - AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config]) POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`" POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`" @@ -699,7 +686,13 @@ AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Spe AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against]) AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against]) have_libpq=no +save_LIBS="${LIBS}" +save_CPPFLAGS="${CPPFLAGS}" +LIBS="${POSTGRESQL_LDFLAGS}" +CPPFLAGS="${POSTGRESQL_CFLAGS}" AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"]) +LIBS="${save_LIBS}" +CPPFLAGS="${save_CPPFLAGS}" AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"]) AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS]) AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS]) @@ -719,7 +712,7 @@ PKG_CHECK_MODULES([SPANDSP], [spandsp >= 3.0],[ AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent]) ]) -PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.12.12],[ +PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.13.15],[ AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[ AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent]) ]) @@ -832,10 +825,12 @@ PKG_CHECK_MODULES([AMRWB], [opencore-amrwb >= 0.1.0 vo-amrwbenc >= 0.1.0],[ AM_CONDITIONAL([HAVE_AMRWB],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMRWB],[false])]) +PKG_CHECK_MODULES([STIRSHAKEN], [stirshaken],[ + AM_CONDITIONAL([HAVE_STIRSHAKEN],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_STIRSHAKEN],[false])]) + AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no) AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"]) -AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no) -AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"]) save_LIBS="$LIBS" LIBS= @@ -872,8 +867,14 @@ AC_SUBST(LIBTOOL_LIB_EXTEN) # Checks for header files. AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h]) +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h sys/time.h]) # Solaris 11 privilege management AS_CASE([$host], @@ -917,13 +918,38 @@ AC_SUBST(HAVE_SYS_SELECT_H_DEFINE) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T -AC_HEADER_TIME +m4_warn([obsolete], +[Update your code to rely only on HAVE_SYS_TIME_H, +then remove this warning and the obsolete code below it. +All current systems provide time.h; it need not be checked for. +Not all systems provide sys/time.h, but those that do, all allow +you to include it and time.h simultaneously.])dnl +AC_CHECK_HEADERS_ONCE([sys/time.h]) +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both + and . This macro is obsolete.]) +fi +# End of obsolete code. + AC_STRUCT_TM # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC -AC_TYPE_SIGNAL +m4_warn([obsolete], +[your code may safely assume C89 semantics that RETSIGTYPE is void. +Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl +AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([#include +#include +], + [return *(signal (0, 0)) (0) == 1;])], + [ac_cv_type_signal=int], + [ac_cv_type_signal=void])]) +AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers + (`int' or `void').]) + AC_FUNC_STRFTIME AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll]) AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups getrusage]) @@ -1028,10 +1054,9 @@ AC_SUBST(DIRECTORY_SEPARATOR) va_list_is_array=no AC_MSG_CHECKING(whether va_list is an array) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -], [va_list list1, list2; list1 = list2;], , -va_list_is_array=yes) +]], [[va_list list1, list2; list1 = list2;]])],[],[va_list_is_array=yes]) AC_MSG_RESULT($va_list_is_array) if test x"$va_list_is_array" = xyes; then VA_LIST_IS_ARRAY_DEFINE=1 @@ -1042,9 +1067,7 @@ AC_SUBST(VA_LIST_IS_ARRAY_DEFINE) AC_MSG_CHECKING(whether compiler has __attribute__) -AC_TRY_COMPILE(, [int x __attribute__((__unused__));], -compiler_has_attribute=yes, -compiler_has_attribute=no) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int x __attribute__((__unused__));]])],[compiler_has_attribute=yes],[compiler_has_attribute=no]) AC_MSG_RESULT($compiler_has_attribute) if test x"$compiler_has_attribute" = xyes; then ATTR_UNUSED="__attribute__((__unused__))" @@ -1057,7 +1080,7 @@ AC_SUBST(ATTR_UNUSED) saved_CFLAGS="$CFLAGS" AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [ CFLAGS="$CFLAGS -Wdeclaration-after-statement" -AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no]) ]) AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement) if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then @@ -1070,7 +1093,7 @@ if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [ CFLAGS="$CFLAGS -Wno-extended-offsetof" - AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) ]) AC_MSG_RESULT($ac_cv_clang_extended_offsetof) if test x"$ac_cv_clang_extended_offsetof" = xyes; then @@ -1080,13 +1103,13 @@ if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then fi # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready -# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_h323 mod_khomp -# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed +# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_opal mod_h323 mod_khomp +# mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed # #saved_CFLAGS="$CFLAGS" #AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [ #CFLAGS="$CFLAGS -Wunused-but-set-variable" -#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no]) +#AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no]) #]) #AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable) #if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then @@ -1111,7 +1134,7 @@ AC_CHECK_SIZEOF(void*, 4) if test "x$ac_cv_sizeof_voidp" != "x"; then voidp_size=$ac_cv_sizeof_voidp else - AC_ERROR([Cannot determine size of void*]) + AC_MSG_ERROR(Cannot determine size of void*) fi if test "$ac_cv_sizeof_short" = "2"; then @@ -1156,7 +1179,7 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then int64_value="__int64" long_value="__int64" else - AC_ERROR([could not detect a 64-bit integer type]) + AC_MSG_ERROR(could not detect a 64-bit integer type) fi if test "$ac_cv_type_size_t" = "yes"; then @@ -1353,7 +1376,21 @@ PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])]) PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[ - AM_CONDITIONAL([HAVE_SHOUT],[true])],[ + AM_CONDITIONAL([HAVE_SHOUT],[true]) + SHOUT_VERSION="`$PKG_CONFIG --modversion shout`" + SHOUT_MAJOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f1`" + SHOUT_MINOR_VERSION="`echo $SHOUT_VERSION | cut -d. -f2`" + SHOUT_PATCH_VERSION="`echo $SHOUT_VERSION | cut -d. -f3`" + test -n "$SHOUT_PATCH_VERSION" || SHOUT_PATCH_VERSION=0 + AC_MSG_NOTICE([SHOUT version: $SHOUT_VERSION]) + AC_MSG_NOTICE([SHOUT major version: $SHOUT_MAJOR_VERSION]) + AC_MSG_NOTICE([SHOUT minor version: $SHOUT_MINOR_VERSION]) + AC_MSG_NOTICE([SHOUT patch version: $SHOUT_PATCH_VERSION]) + AC_SUBST([SHOUT_VERSION]) + AC_SUBST([SHOUT_MAJOR_VERSION]) + AC_SUBST([SHOUT_MINOR_VERSION]) + AC_SUBST([SHOUT_PATCH_VERSION]) + ],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])]) mp3lame=false @@ -1398,7 +1435,9 @@ PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[ PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[ AM_CONDITIONAL([HAVE_OPENCV],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])]) + PKG_CHECK_MODULES([OPENCV], [opencv4 >= 2.4.5],[ + AM_CONDITIONAL([HAVE_OPENCV],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])])]) PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[ AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[ @@ -1517,13 +1556,33 @@ PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[ ]) ]) -PKG_CHECK_MODULES([KS], [libks >= 1.1.0],[ +PKG_CHECK_MODULES([KS], [libks2 >= 2.0.0],[ AM_CONDITIONAL([HAVE_KS],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false])]) + PKG_CHECK_MODULES([KS], [libks >= 1.8.2],[ + AM_CONDITIONAL([HAVE_KS],[true])],[ + if module_enabled mod_verto; then + AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_verto in modules.conf]) + else + if module_enabled mod_signalwire; then + AC_MSG_ERROR([You need to either install libks2 or libks or disable mod_signalwire in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false]) + fi + fi + ]) +]) -PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[ +PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client2 >= 2.0.0],[ AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[ - AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false])]) + PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[ + AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[ + if module_enabled mod_signalwire; then + AC_MSG_ERROR([You need to either install signalwire-client-c2 or signalwire-client-c or disable mod_signalwire in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false]) + fi + ]) +]) PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[ AM_CONDITIONAL([HAVE_AMQP],[true])],[ @@ -1566,6 +1625,17 @@ AS_IF([test "x$enable_core_libedit_support" != "xno"],[ AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support]) ])])]) +AC_ARG_ENABLE(systemd, + [AS_HELP_STRING([--enable-systemd], [Compile with systemd notify support])]) + +AS_IF([test "x$enable_systemd" = "xyes"],[ + PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 219], [ + AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd is available])]) +]) + +AC_SUBST(SYSTEMD_LIBS) + + dnl DH: Added for including libwebsockets AC_ARG_WITH(lws, [AS_HELP_STRING([--with-lws], @@ -1580,14 +1650,14 @@ else AM_CONDITIONAL([HAVE_LWS],[false]) fi -dnl DH: Added for including google protobuf libs +dnl DH: Added for including google protobuf libs and aws sdk AC_ARG_WITH(extra, [AS_HELP_STRING([--with-extra], [enable support for extra modules which require google rpc (libgrpc++ and libgrpc)])], [with_extra="$withval"], [with_extra="no"]) if test "$with_extra" = "yes"; then - PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ + PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ AM_CONDITIONAL([HAVE_GRPC],[true])], [ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GRPC],[false])]) else @@ -1720,7 +1790,7 @@ if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then fi # -# Python checks for mod_python +# Python checks for mod_python (scroll down to see python3 checks for mod_python3) # AC_ARG_WITH( [python], @@ -1840,6 +1910,143 @@ else AC_MSG_WARN([python support disabled, building mod_python will fail!]) fi +# +# Python3 checks for mod_python3 +# +AC_ARG_WITH( + [python3], + [AS_HELP_STRING([--with-python3], [Use system provided version of python3 (default: try)])], + [with_python3="$withval"], + [with_python3="try"] +) + +if test "$with_python3" != "no" +then + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + + if test "$with_python3" != "yes" -a "$with_python3" != "try" ; then + AC_MSG_CHECKING([for python3]) + if test ! -x "$with_python3" ; then + AC_MSG_ERROR([Specified python3 does not exist or is not executable: $with_python3]) + fi + AC_MSG_RESULT([$with_python3]) + AC_SUBST([PYTHON3], ["$with_python3"]) + else + AC_PATH_PROG([PYTHON3], ["python3"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"]) + fi + + if test "$PYTHON3" != "no" ; then + AC_MSG_CHECKING([python3 version]) + PYTHON3_VER="`$PYTHON3 -V 2>&1 | cut -d' ' -f2`" + + if test -z "$PYTHON3_VER" ; then + AC_MSG_ERROR([Unable to detect python3 version]) + fi + AC_MSG_RESULT([$PYTHON3_VER]) + + AC_MSG_CHECKING([for python3 distutils]) + python3_result="`$PYTHON3 -c 'import distutils;' 2>&1`" + if test -z "$python3_result" ; then + python3_has_distutils="yes" + else + python3_has_distutils="no" + fi + AC_MSG_RESULT([$python3_has_distutils]) + + if test "$python3_has_distutils" != "no" ; then + AC_MSG_CHECKING([location of python3 site-packages]) + + PYTHON3_SITE_DIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`" + + if test -z "$PYTHON3_SITE_DIR" ; then + AC_MSG_ERROR([Unable to detect python3 site-packages path]) + elif test ! -d "$PYTHON3_SITE_DIR" ; then + AC_MSG_ERROR([Path $PYTHON3_SITE_DIR returned by python3 does not exist!]) + fi + AC_MSG_RESULT([$PYTHON3_SITE_DIR]) + AC_SUBST([PYTHON3_SITE_DIR], [$PYTHON3_SITE_DIR]) + + # + # python3 distutils found, get settings from python3 directly + # + PYTHON3_CFLAGS="`$PYTHON3 -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`" + PYTHON3_LDFLAGS="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]); print(\" \".join(libs));'`" + PYTHON3_LIB="`$PYTHON3 -c 'from distutils import sysconfig; ldver = sysconfig.get_config_var(\"LDVERSION\"); print(\"python\" + [[ldver,sysconfig.get_config_var(\"VERSION\")]][[ldver==None]]);'`" + PYTHON3_LIBDIR="`$PYTHON3 -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`" + + # handle python3 being installed into /usr/local + AC_MSG_CHECKING([python3 libdir]) + if test -z "`echo $PYTHON3_LIBDIR | grep "/usr/lib"`" ; then + PYTHON3_LDFLAGS="-L$PYTHON3_LIBDIR $PYTHON3_LDFLAGS" + LIBS="-L$PYTHON3_LIBDIR $LIBS" + fi + AC_MSG_RESULT([$PYTHON3_LIBDIR]) + + # check libpython3 + AC_CHECK_LIB([$PYTHON3_LIB], [main], [has_libpython3="yes"], [has_libpython3="no"]) + + if test "$has_libpython3" = "no" ; then + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([$PYTHON3_LIB is unusable])], + [AC_MSG_ERROR([$PYTHON3_LIB is unusable])] + ) + fi + + # check whether system libpython3 is usable and has threads support + CFLAGS="$PYTHON3_CFLAGS" + LIBS="$PYTHON3_LDFLAGS" + AC_CHECK_FUNC([PyThread_init_thread], [python3_has_threads="yes"], [python3_has_threads="no"]) + + if test "$python3_has_threads" = "no"; then + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Your python3 lacks threads support, can not build mod_python3])], + [AC_MSG_ERROR([Your python3 lacks threads support, can not build mod_python3])] + ) + else + AC_MSG_NOTICE([Your python3 seems OK, do not forget to enable mod_python3 in modules.conf]) + AC_SUBST([PYTHON3_CFLAGS], [$PYTHON3_CFLAGS]) + AC_SUBST([PYTHON3_LDFLAGS], [$PYTHON3_LDFLAGS]) + fi + else + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Could not find or use python3 distutils module: $python3_result])], + [AC_MSG_ERROR([Could not find or use python3 distutils module: $python3_result])] + ) + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + unset python3_has_threads + unset python3_has_distutils + unset python3_result + else + AS_IF([test "$with_python3" = "try"], + [AC_MSG_WARN([Could not find python3, mod_python3 will not build, use --with-python3 to specify the location])], + [AC_MSG_ERROR([Could not find python3, use --with-python3 to specify the location])] + ) + fi +else + AC_MSG_WARN([python3 support disabled, building mod_python3 will fail!]) +fi + +# pcap lib for unit-testing +AC_MSG_CHECKING(libpcap) +AC_CHECK_PROG(HAVE_PCAP_CONFIG,pcap-config,[true],[false]) +if test x"$HAVE_PCAP_CONFIG" = x"true"; then + AC_MSG_RESULT(yes) + PCAP_CONFIG=pcap-config + PCAP_LIBS="`$PCAP_CONFIG --libs`" + PCAP_CFLAGS="`$PCAP_CONFIG --cflags`" + AM_CONDITIONAL([HAVE_PCAP], [true]) +else + AC_MSG_RESULT(no) + AM_CONDITIONAL([HAVE_PCAP], [false]) +fi +AC_SUBST([PCAP_CFLAGS]) +AC_SUBST([PCAP_LIBS]) + # # SNMP checks for mod_snmp # @@ -1860,7 +2067,7 @@ CHECK_ERLANG # Enable clang address sanitizer bit build AC_ARG_ENABLE(address_sanitizer, - [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])], + [AS_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])], [enable_address_sanitizer="$enable_address_sanitizer"], [enable_address_sanitizer="no"]) @@ -1870,8 +2077,57 @@ if test "${enable_address_sanitizer}" = "yes"; then APR_ADDTO(LDFLAGS, -fsanitize=address) fi +# Enable HEAP profiler (requires libgoogle-perftools-dev package) +AC_ARG_ENABLE(heap_profiler, + [AS_HELP_STRING([--enable-heap-profiler],[build with google heap profiler])], + [enable_heap_profiler="$enable_heap_profiler"], + [enable_heap_profiler="no"]) + +# Enable CPU profiler (requires libgoogle-perftools-dev package) +AC_ARG_ENABLE(cpu_profiler, + [AS_HELP_STRING([--enable-cpu-profiler],[build with google cpu profiler])], + [enable_cpu_profiler="$enable_cpu_profiler"], + [enable_cpu_profiler="no"]) + +PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc], [have_tcmalloc=yes], [have_tcmalloc=no]) + +if test "${enable_heap_profiler}" = "yes" || test "${enable_cpu_profiler}" = "yes"; then + if test "x$have_tcmalloc" != "xyes" ; then + AC_MSG_ERROR([You must install libgoogle-perftools-dev in order to use heap or cpu profiler]) + fi +fi + +# WARNING: When both enabled you can NOT link them statically and MUST use the special library +if test "${enable_heap_profiler}" = "yes" && test "${enable_cpu_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -ltcmalloc_and_profiler) + APR_ADDTO(CXXFLAGS, -ltcmalloc_and_profiler) + APR_ADDTO(LDFLAGS, -ltcmalloc_and_profiler) +else + if test "${enable_heap_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -ltcmalloc) + APR_ADDTO(CXXFLAGS, -ltcmalloc) + APR_ADDTO(LDFLAGS, -ltcmalloc) + fi + + if test "${enable_cpu_profiler}" = "yes"; then + APR_ADDTO(CFLAGS, -lprofiler) + APR_ADDTO(CXXFLAGS, -lprofiler) + APR_ADDTO(LDFLAGS, -lprofiler) + fi +fi + +# Enable fake dlclose +AC_ARG_ENABLE(fake_dlclose, + [AS_HELP_STRING([--enable-fake-dlclose],[Do not unload dynamic libraries])], + [enable_fake_dlclose="$enable_fake_dlclose"], + [enable_fake_dlclose="no"]) + +if test "${enable_fake_dlclose}" = "yes"; then + APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_FAKE_DLCLOSE) +fi + AC_ARG_ENABLE(, - [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])], + [AS_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])], [enable_pool_sanitizer="$enable_pool_sanitizer"], [enable_pool_sanitizer="no"]) @@ -1892,6 +2148,7 @@ AC_CONFIG_FILES([Makefile src/mod/applications/mod_aws_lex/Makefile src/mod/applications/mod_aws_transcribe/Makefile src/mod/applications/mod_azure_transcribe/Makefile + src/mod/applications/mod_cobalt_transcribe/Makefile src/mod/applications/mod_deepgram_transcribe/Makefile src/mod/applications/mod_google_tts/Makefile src/mod/applications/mod_google_transcribe/Makefile @@ -1964,7 +2221,6 @@ AC_CONFIG_FILES([Makefile src/mod/asr_tts/mod_flite/Makefile src/mod/asr_tts/mod_pocketsphinx/Makefile src/mod/asr_tts/mod_tts_commandline/Makefile - src/mod/asr_tts/mod_unimrcp/Makefile src/mod/codecs/mod_amr/Makefile src/mod/codecs/mod_amrwb/Makefile src/mod/codecs/mod_b64/Makefile @@ -1993,7 +2249,6 @@ AC_CONFIG_FILES([Makefile src/mod/dialplans/mod_dialplan_xml/Makefile src/mod/directories/mod_ldap/Makefile src/mod/endpoints/mod_alsa/Makefile - src/mod/endpoints/mod_dingaling/Makefile src/mod/endpoints/mod_gsmopen/Makefile src/mod/endpoints/mod_h323/Makefile src/mod/endpoints/mod_khomp/Makefile @@ -2043,6 +2298,7 @@ AC_CONFIG_FILES([Makefile src/mod/languages/mod_managed/Makefile src/mod/languages/mod_perl/Makefile src/mod/languages/mod_python/Makefile + src/mod/languages/mod_python3/Makefile src/mod/languages/mod_v8/Makefile src/mod/languages/mod_yaml/Makefile src/mod/languages/mod_basic/Makefile @@ -2086,9 +2342,9 @@ AC_CONFIG_FILES([Makefile build/freeswitch.pc build/standalone_module/freeswitch.pc build/modmake.rules - libs/esl/Makefile - libs/esl/perl/Makefile - libs/esl/php/Makefile + libs/esl/Makefile + libs/esl/perl/Makefile + libs/esl/php/Makefile libs/xmlrpc-c/include/xmlrpc-c/config.h libs/xmlrpc-c/xmlrpc_config.h libs/xmlrpc-c/config.mk @@ -2109,7 +2365,7 @@ AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ]) LIBTOOL='$(SHELL) $(switch_builddir)/libtool' TOUCH_TARGET='if test -f "$@";then touch "$@";fi;' CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' -CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' +CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed "s/\#/\#\//"| sed -e "s|^.*/||" | sort | uniq )' OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )' OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' @@ -2150,16 +2406,7 @@ AC_CONFIG_SUBDIRS([libs/srtp]) if test "$use_system_apr" != "yes"; then AC_CONFIG_SUBDIRS([libs/apr]) fi -if test "$use_system_aprutil" != "yes"; then - AC_CONFIG_SUBDIRS([libs/apr-util]) -fi AC_CONFIG_SUBDIRS([libs/iksemel]) -AC_CONFIG_SUBDIRS([libs/libdingaling]) -AC_CONFIG_SUBDIRS([libs/freetdm]) -AC_CONFIG_SUBDIRS([libs/unimrcp]) -if test "x${enable_zrtp}" = "xyes"; then - AC_CONFIG_SUBDIRS([libs/libzrtp]) -fi case $host in *-openbsd*|*-netbsd*) diff --git a/packer/jambonz-mini/aws/files/configure.ac.grpc.patch b/packer/jambonz-mini/aws/files/configure.ac.grpc.patch deleted file mode 100644 index f030a1b..0000000 --- a/packer/jambonz-mini/aws/files/configure.ac.grpc.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- configure.ac 2019-10-22 22:47:40.566582350 +0000 -+++ configure.ac.new 2019-10-23 14:56:29.469206772 +0000 -@@ -1563,6 +1563,20 @@ - AM_CONDITIONAL([HAVE_LWS],[false]) - fi - -++dnl DH: Added for including google protobuf libs -++AC_ARG_WITH(grpc, -+ [AS_HELP_STRING([--with-grpc], -+ [enable support for google rpc (libgrpc++ and libgrpc)])], -+ [with_grpc="$withval"], -+ [with_grpc="no"]) -+if test "$with_grpc" = "yes"; then -+ PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ -+ AM_CONDITIONAL([HAVE_GRPC],[true])], [ -+ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GRPC],[false])]) -+else -+ AM_CONDITIONAL([HAVE_GRPC],[false]) -+fi -+ - dnl --------------------------------------------------------------------------- - dnl - OpenLDAP SDK - dnl --------------------------------------------------------------------------- -@@ -1858,6 +1872,9 @@ - src/Makefile - src/mod/Makefile - src/mod/applications/mod_audio_fork/Makefile -+ src/mod/applications/mod_google_tts/Makefile -+ src/mod/applications/mod_google_transcribe/Makefile -+ src/mod/applications/mod_dialogflow/Makefile - src/mod/applications/mod_abstraction/Makefile - src/mod/applications/mod_avmd/Makefile - src/mod/applications/mod_bert/Makefile diff --git a/packer/jambonz-mini/aws/files/configure.ac.libfvad b/packer/jambonz-mini/aws/files/configure.ac.libfvad new file mode 100644 index 0000000..69d7564 --- /dev/null +++ b/packer/jambonz-mini/aws/files/configure.ac.libfvad @@ -0,0 +1,41 @@ +AC_INIT([libfvad],[1.0],[dpirch@gmail.com],[],[https://github.com/dpirch/libfvad]) +AC_PREREQ([2.60]) +AC_CONFIG_SRCDIR([src/fvad.c]) +AC_CONFIG_AUX_DIR([ac-aux]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([ + -Wall -Wno-extra-portability foreign subdir-objects + tar-pax no-dist-gzip dist-xz +]) + +AC_PROG_CC + +LT_INIT([disable-static pic-only]) + +# optional examples, requires libsndfile +AC_ARG_ENABLE([examples], + [AS_HELP_STRING([--enable-examples], + [build the fvadwav example program; requires libsndfile @<:@default=no@:>@])]) + +AS_IF([test "x$enable_examples" = xyes], + [PKG_CHECK_MODULES([sndfile], [sndfile])], + [enable_examples=no]) + +AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$enable_examples" = xyes]) + +### output ### +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile tests/Makefile libfvad.pc]) +AC_OUTPUT + +AC_MSG_RESULT([ + $PACKAGE $VERSION + =========== + + source code location: $srcdir + installation prefix: $prefix + compiler: $CC + cflags: $CFLAGS + + build examples: $enable_examples +]) \ No newline at end of file diff --git a/packer/jambonz-mini/aws/files/configure.ac.patch b/packer/jambonz-mini/aws/files/configure.ac.patch deleted file mode 100644 index f1baabc..0000000 --- a/packer/jambonz-mini/aws/files/configure.ac.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- configure.ac 2019-09-30 19:01:33.308021065 +0000 -+++ configure.ac.new 2019-09-30 23:00:53.730843843 +0000 -@@ -13,7 +13,7 @@ - AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) - - AC_CONFIG_AUX_DIR(build/config) --AM_INIT_AUTOMAKE -+AM_INIT_AUTOMAKE([subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - AC_CONFIG_SRCDIR([src/switch.c]) - AC_CONFIG_HEADER([src/include/switch_private.h]) -@@ -1549,6 +1549,20 @@ - AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support]) - ])])]) - -+dnl DH: Added for including libwebsockets -+AC_ARG_WITH(lws, -+ [AS_HELP_STRING([--with-lws], -+ [enable support for libwebsockets])], -+ [with_lws="$withval"], -+ [with_lws="no"]) -+if test "$with_lws" = "yes"; then -+ PKG_CHECK_MODULES([LWS], [libwebsockets], [ -+ AM_CONDITIONAL([HAVE_LWS],[true])], [ -+ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LWS],[false])]) -+else -+ AM_CONDITIONAL([HAVE_LWS],[false]) -+fi -+ - dnl --------------------------------------------------------------------------- - dnl - OpenLDAP SDK - dnl --------------------------------------------------------------------------- -@@ -1843,6 +1857,7 @@ - tests/unit/Makefile - src/Makefile - src/mod/Makefile -+ src/mod/applications/mod_audio_fork/Makefile - src/mod/applications/mod_abstraction/Makefile - src/mod/applications/mod_avmd/Makefile - src/mod/applications/mod_bert/Makefile diff --git a/packer/jambonz-mini/aws/files/mod_avmd.c.patch b/packer/jambonz-mini/aws/files/mod_avmd.c.patch index ae995b9..da43cd6 100644 --- a/packer/jambonz-mini/aws/files/mod_avmd.c.patch +++ b/packer/jambonz-mini/aws/files/mod_avmd.c.patch @@ -1,25 +1,22 @@ ---- mod_avmd.c 2022-02-10 11:19:05 -+++ mod_avmd.c.new 2023-04-19 13:28:03 -@@ -1476,15 +1476,20 @@ - } - if ((SWITCH_CALL_DIRECTION_OUTBOUND == switch_channel_direction(channel)) && (avmd_session->settings.outbound_channnel == 1)) { - flags |= SMBF_READ_REPLACE; -- direction = "READ_REPLACE"; -+ direction = "READ_REPLACE"; - } -- if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) && (avmd_session->settings.inbound_channnel == 1)) { -+ if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) /* && (avmd_session->settings.inbound_channnel == 1) */) { -+ /* DCH: for drachtio-fsmrf */ -+ flags |= SMBF_READ_REPLACE; -+ direction = "READ_REPLACE"; +--- mod_avmd.c 2023-08-23 12:41:53.641925581 +0000 ++++ mod_avmd.c.new 2023-08-23 17:55:57.412134779 +0000 +@@ -1483,13 +1483,18 @@ + flags |= SMBF_READ_REPLACE; + direction = "READ_REPLACE"; + } +- if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) && (avmd_session->settings.inbound_channnel == 1)) { ++ if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) /* && (avmd_session->settings.inbound_channnel == 1) */) { ++ /* DCH: for drachtio-fsmrf */ ++ flags |= SMBF_READ_REPLACE; ++ direction = "READ_REPLACE"; +/* - flags |= SMBF_WRITE_REPLACE; + flags |= SMBF_WRITE_REPLACE; if (!strcmp(direction, "READ_REPLACE")) { direction = "READ_REPLACE | WRITE_REPLACE"; } else { direction = "WRITE_REPLACE"; } +*/ - } - - if (flags == 0) { + } + + if (flags == 0) { diff --git a/packer/jambonz-mini/aws/files/mod_httapi.c.patch b/packer/jambonz-mini/aws/files/mod_httapi.c.patch index eab370d..eae028a 100644 --- a/packer/jambonz-mini/aws/files/mod_httapi.c.patch +++ b/packer/jambonz-mini/aws/files/mod_httapi.c.patch @@ -1,42 +1,43 @@ ---- mod_httapi.c 2023-03-01 13:57:28 -+++ mod_httapi.c.new 2023-03-01 14:19:34 -@@ -2472,6 +2472,12 @@ +--- mod_httapi.c 2023-08-23 17:17:49.626199388 +0000 ++++ mod_httapi.c.new 2023-08-23 18:04:06.972949593 +0000 +@@ -2477,6 +2477,13 @@ char *ua = NULL; const char *profile_name = NULL; int tries = 10; -+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && -+ strstr(url, "X-Amz-Algorithm") != NULL && -+ strstr(url, "X-Amz-Credential") != NULL && -+ strstr(url, "X-Amz-Date") != NULL && -+ strstr(url, "X-Amz-Expires") != NULL && -+ strstr(url, "X-Amz-SignedHeaders") != NULL; - ++ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && ++ strstr(url, "X-Amz-Algorithm") != NULL && ++ strstr(url, "X-Amz-Credential") != NULL && ++ strstr(url, "X-Amz-Date") != NULL && ++ strstr(url, "X-Amz-Expires") != NULL && ++ strstr(url, "X-Amz-SignedHeaders") != NULL; ++ + if (context->url_params) { profile_name = switch_event_get_header(context->url_params, "profile_name"); -@@ -2614,7 +2620,7 @@ +@@ -2619,7 +2626,7 @@ switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) client); } else { switch_curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1); - switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); + if (!awsSignedUrl) switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); - } - - if (headers) { -@@ -2783,6 +2789,12 @@ + + /* Prevent writing the data (headers in this case) to stdout */ + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, dummy_save_file_callback); +@@ -2789,6 +2796,12 @@ char *metadata; const char *ext = NULL; const char *err_msg = NULL; -+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && -+ strstr(url, "X-Amz-Algorithm") != NULL && -+ strstr(url, "X-Amz-Credential") != NULL && -+ strstr(url, "X-Amz-Date") != NULL && -+ strstr(url, "X-Amz-Expires") != NULL && -+ strstr(url, "X-Amz-SignedHeaders") != NULL; - ++ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL && ++ strstr(url, "X-Amz-Algorithm") != NULL && ++ strstr(url, "X-Amz-Credential") != NULL && ++ strstr(url, "X-Amz-Date") != NULL && ++ strstr(url, "X-Amz-Expires") != NULL && ++ strstr(url, "X-Amz-SignedHeaders") != NULL; + load_cache_data(context, url); - -@@ -2831,7 +2843,7 @@ - + +@@ -2837,7 +2850,7 @@ + if (!unreachable && !zstr(context->metadata)) { metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", - url, @@ -44,12 +45,12 @@ switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), switch_event_get_header_nil(headers, "content-length"), -@@ -2855,7 +2867,7 @@ - - +@@ -2861,7 +2874,7 @@ + + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s", - url, -+ awsSignedUrl ? context->cache_file : url, ++ awsSignedUrl ? context->cache_file : url, switch_event_get_header_nil(headers, "last-modified"), switch_event_get_header_nil(headers, "etag"), switch_event_get_header_nil(headers, "content-length"), diff --git a/packer/jambonz-mini/aws/files/modules.conf.in.extra b/packer/jambonz-mini/aws/files/modules.conf.in.extra index 081860d..b803c31 100644 --- a/packer/jambonz-mini/aws/files/modules.conf.in.extra +++ b/packer/jambonz-mini/aws/files/modules.conf.in.extra @@ -2,6 +2,7 @@ applications/mod_audio_fork applications/mod_aws_lex applications/mod_aws_transcribe applications/mod_azure_transcribe +applications/mod_cobalt_transcribe applications/mod_deepgram_transcribe applications/mod_google_tts applications/mod_google_transcribe diff --git a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.extra b/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.extra index 4774bf7..3da005a 100644 --- a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.extra +++ b/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.extra @@ -1,160 +1,161 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - + + + - - + + diff --git a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc b/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc deleted file mode 100644 index beee2ad..0000000 --- a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc.patch b/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc.patch deleted file mode 100644 index 3d5cf68..0000000 --- a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.grpc.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- modules.conf.xml 2019-05-15 21:08:29.049449029 +0000 -+++ modules.conf.xml.new 2019-05-15 22:05:00.303623468 +0000 -@@ -7,6 +7,9 @@ - - - -+ -+ -+ - - - diff --git a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.patch b/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.patch deleted file mode 100644 index 57aca31..0000000 --- a/packer/jambonz-mini/aws/files/modules.conf.vanilla.xml.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- modules.conf.xml 2019-09-30 19:01:33.304020805 +0000 -+++ modules.conf.xml.new 2019-09-30 23:11:23.371830901 +0000 -@@ -1,5 +1,6 @@ - - -+ - - - -@@ -10,7 +11,7 @@ - - - -- -+ - - - -@@ -39,7 +40,7 @@ - - - -- -+ - - - -@@ -47,28 +48,28 @@ - - - -- -+ - - -- -+ - - - -- -+ - -- -- -- -+ -+ -+ - -- -+ - - - - -- -- -+ -+ - -- -+ - - - -@@ -87,7 +88,7 @@ - - - -- -+ - - - -@@ -96,17 +97,17 @@ - - - -- -+ - - - - - -- -+ - - - -- -+ - - - -@@ -123,7 +124,7 @@ - - - -- -+ - - - diff --git a/packer/jambonz-mini/aws/files/switch_core.c.patch b/packer/jambonz-mini/aws/files/switch_core.c.patch new file mode 100644 index 0000000..ed7828f --- /dev/null +++ b/packer/jambonz-mini/aws/files/switch_core.c.patch @@ -0,0 +1,22 @@ +--- switch_core.c 2023-08-22 14:51:14.809826416 +0000 ++++ switch_core.c.new 2023-08-22 14:50:44.109074396 +0000 +@@ -45,6 +45,7 @@ + #include "private/switch_core_pvt.h" + #include + #include ++#include + #ifndef WIN32 + #include + #ifdef HAVE_SETRLIMIT +@@ -2447,6 +2448,11 @@ + const char *use = NULL; + #include "cc.h" + ++#ifdef FREESWITCH_AWS_GLOBAL_INITIALIZATION ++ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Initializing AWS SDK\n"); ++ aws_init_api(); ++#endif ++ + + if (switch_core_init(flags, console, err) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_GENERR; diff --git a/packer/jambonz-mini/aws/files/switch_core_media.c.patch b/packer/jambonz-mini/aws/files/switch_core_media.c.patch index 3d86c06..2a550fe 100644 --- a/packer/jambonz-mini/aws/files/switch_core_media.c.patch +++ b/packer/jambonz-mini/aws/files/switch_core_media.c.patch @@ -1,8 +1,8 @@ ---- switch_core_media.c 2022-03-04 19:02:35.000000000 -0500 -+++ switch_core_media.c.new 2022-03-05 08:54:38.000000000 -0500 -@@ -2749,7 +2749,7 @@ +--- switch_core_media.c 2023-08-23 17:17:24.081729695 +0000 ++++ switch_core_media.c.new 2023-08-23 17:48:32.812205983 +0000 +@@ -2639,7 +2639,7 @@ *(buf + datalen) = '\0'; - + while (*buf & 0x80) { - if (buf + 3 > e) { + if (buf + 3 > e || count >= MAX_RED_FRAMES) { diff --git a/packer/jambonz-mini/aws/files/switch_rtp.c.patch b/packer/jambonz-mini/aws/files/switch_rtp.c.patch index ee9debf..792cf0a 100644 --- a/packer/jambonz-mini/aws/files/switch_rtp.c.patch +++ b/packer/jambonz-mini/aws/files/switch_rtp.c.patch @@ -1,35 +1,33 @@ ---- switch_rtp.c 2021-01-12 02:11:42.334172596 +0000 -+++ switch_rtp.c.new 2021-01-12 02:12:42.695207260 +0000 -@@ -5639,8 +5639,8 @@ +--- switch_rtp.c 2023-08-23 17:17:24.229732433 +0000 ++++ switch_rtp.c.new 2023-08-23 17:41:05.504067569 +0000 +@@ -5482,7 +5482,7 @@ static switch_size_t do_flush(switch_rtp_t *rtp_session, int force, switch_size_t bytes_in) { int was_blocking = 0; - switch_size_t bytes; -- uint32_t flushed = 0; + //switch_size_t bytes; -+ //uint32_t flushed = 0; switch_size_t bytes_out = 0; - + if (!switch_rtp_ready(rtp_session)) { -@@ -5700,7 +5700,7 @@ +@@ -5542,7 +5542,7 @@ #endif handle_rfc2833(rtp_session, bytes_in, &do_cng); } - -+/* ++/* DH: disable this flushing feature, would prefer to receive all packets do { if (switch_rtp_ready(rtp_session)) { bytes = sizeof(rtp_msg_t); -@@ -5713,7 +5713,7 @@ +@@ -5555,7 +5555,7 @@ rtp_session->last_media = switch_micro_time_now(); } - + - /* Make sure to handle RFC2833 packets, even if we're flushing the packets */ -+ //Make sure to handle RFC2833 packets, even if we're flushing the packets ++ // Make sure to handle RFC2833 packets, even if we're flushing the packets if (bytes > rtp_header_len && rtp_session->recv_msg.header.version == 2 && rtp_session->recv_msg.header.pt == rtp_session->recv_te) { rtp_session->last_rtp_hdr = rtp_session->recv_msg.header; handle_rfc2833(rtp_session, bytes, &do_cng); -@@ -5732,7 +5732,7 @@ +@@ -5572,7 +5572,7 @@ break; } } while (bytes > 0); diff --git a/packer/jambonz-mini/aws/scripts/install_app.sh b/packer/jambonz-mini/aws/scripts/install_app.sh index a006af9..69a6797 100755 --- a/packer/jambonz-mini/aws/scripts/install_app.sh +++ b/packer/jambonz-mini/aws/scripts/install_app.sh @@ -3,6 +3,9 @@ VERSION=$1 DB_USER=$2 DB_PASS=$3 +ALIAS_LINE="alias gl='git log --oneline --decorate'" +echo "$ALIAS_LINE" >> ~/.bash_aliases + cd /home/admin cp /tmp/ecosystem.config.js apps diff --git a/packer/jambonz-mini/aws/scripts/install_drachtio.sh b/packer/jambonz-mini/aws/scripts/install_drachtio.sh index 657605d..ff945e4 100644 --- a/packer/jambonz-mini/aws/scripts/install_drachtio.sh +++ b/packer/jambonz-mini/aws/scripts/install_drachtio.sh @@ -1,24 +1,20 @@ #!/bin/bash VERSION=$1 +DISTRO=$2 -echo "drachtio version to install is ${VERSION}" +echo "drachtio version to install is ${VERSION} on ${DISTRO}" chmod 0777 /usr/local/src cd /usr/local/src + git clone https://github.com/drachtio/drachtio-server.git -b ${VERSION} cd drachtio-server git submodule update --init --recursive ./autogen.sh && mkdir -p build && cd $_ && ../configure --enable-tcmalloc=yes CPPFLAGS='-DNDEBUG -g -O2' && make -j 4 && sudo make install -if [ "$2" = "gcp" ]; then - echo "installing drachtio for gcp" - sudo mv /tmp/drachtio.gcp.service /etc/systemd/system/drachtio.service - sudo mv /tmp/drachtio-5070.gcp.service /etc/systemd/system/drachtio-5070.service -else - echo "installing drachtio for aws" - sudo mv /tmp/drachtio.service /etc/systemd/system - sudo mv /tmp/drachtio-5070.service /etc/systemd/system -fi +echo "installing drachtio for aws" +sudo mv /tmp/drachtio.service /etc/systemd/system +sudo mv /tmp/drachtio-5070.service /etc/systemd/system sudo mv /tmp/drachtio.conf.xml /etc sudo chmod 644 /etc/drachtio.conf.xml diff --git a/packer/jambonz-mini/aws/scripts/install_freeswitch.sh b/packer/jambonz-mini/aws/scripts/install_freeswitch.sh index cdb3f8a..ecc6643 100644 --- a/packer/jambonz-mini/aws/scripts/install_freeswitch.sh +++ b/packer/jambonz-mini/aws/scripts/install_freeswitch.sh @@ -1,12 +1,12 @@ #!/bin/bash -FREESWITCH_VERSION=v1.10.5 -GRPC_VERSION=c66d2cc -#GRPC_VERSION=v1.39.1 -#GOOGLE_API_VERSION=v1p1beta1-speech -GOOGLE_API_VERSION=e9da6f8b469c52b83f900e820be30762e9e05c57 +FREESWITCH_VERSION=v1.10.10 +SPAN_DSP_VERSION=0d2e6ac +GRPC_VERSION=v1.57.0 +GOOGLE_API_VERSION=29374574304f3356e64423acc9ad059fe43f09b5 +#AWS_SDK_VERSION=1.11.143 # newer but buggy with s2n_init crashes and weird slowdown on voice playout in FS AWS_SDK_VERSION=1.8.129 -LWS_VERSION=v3.2.3 -MODULES_VERSION=v0.7.2 +LWS_VERSION=v4.3.2 +MODULES_VERSION=v0.8.4 echo "freeswitch version to install is ${FREESWITCH_VERSION}" echo "drachtio modules version to install is ${MODULES_VERSION}" @@ -18,8 +18,8 @@ echo "LWS_VERSION version to install is ${LWS_VERSION}" export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH cd /tmp -tar xvfz SpeechSDK-Linux-1.30.0.tar.gz -cd SpeechSDK-Linux-1.30.0 +tar xvfz SpeechSDK-Linux-1.32.1.tar.gz +cd SpeechSDK-Linux-1.32.1 sudo cp -r include /usr/local/include/MicrosoftSpeechSDK sudo cp -r lib/ /usr/local/lib/MicrosoftSpeechSDK if [ "$ARCH" == "arm64" ]; then @@ -34,8 +34,8 @@ if [ "$ARCH" == "amd64" ]; then fi cd /usr/local/src -echo remove SpeechSDK-Linux-1.30.0 -sudo rm -Rf /tmp/SpeechSDK-Linux-1.30.0.tgz /tmp/SpeechSDK-Linux-1.30.0 +echo remove SpeechSDK-Linux-1.32.1 +sudo rm -Rf /tmp/SpeechSDK-Linux-1.32.1.tgz /tmp/SpeechSDK-Linux-1.32.1 echo done echo config git @@ -51,8 +51,8 @@ cd freeswitch/libs git clone https://github.com/drachtio/nuance-asr-grpc-api.git -b main git clone https://github.com/drachtio/riva-asr-grpc-api.git -b main git clone https://github.com/drachtio/soniox-asr-grpc-api.git -b main -git clone https://github.com/freeswitch/spandsp.git -b master -cd spandsp && git checkout 728b60abdd1a71e254b8e831e9156521d788b2b9 && cd .. +git clone https://github.com/drachtio/cobalt-asr-grpc-api.git -b main +git clone https://github.com/freeswitch/spandsp.git && cd spandsp && git checkout ${SPAN_DSP_VERSION} && cd .. git clone https://github.com/freeswitch/sofia-sip.git -b master git clone https://github.com/dpirch/libfvad.git git clone https://github.com/aws/aws-sdk-cpp.git -b ${AWS_SDK_VERSION} @@ -64,6 +64,7 @@ sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_audio_fork /us sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_aws_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_azure_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_azure_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_lex /usr/local/src/freeswitch/src/mod/applications/mod_aws_lex +sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_cobalt_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_cobalt_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_deepgram_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_deepgram_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_google_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_ibm_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_ibm_transcribe @@ -74,9 +75,6 @@ sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_jambonz_transc sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_tts /usr/local/src/freeswitch/src/mod/applications/mod_google_tts sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_dialogflow /usr/local/src/freeswitch/src/mod/applications/mod_dialogflow -sudo sed -i -r -e 's/(.*AM_CFLAGS\))/\1 -g -O0/g' /usr/local/src/freeswitch/src/mod/applications/mod_audio_fork/Makefile.am -sudo sed -i -r -e 's/(.*-std=c++11)/\1 -g -O0/g' /usr/local/src/freeswitch/src/mod/applications/mod_audio_fork/Makefile.am - # copy Makefiles and patches into place cp /tmp/configure.ac.extra /usr/local/src/freeswitch/configure.ac cp /tmp/Makefile.am.extra /usr/local/src/freeswitch/Makefile.am @@ -88,44 +86,67 @@ cp /tmp/switch_core_media.c.patch /usr/local/src/freeswitch/src cp /tmp/mod_avmd.c.patch /usr/local/src/freeswitch/src/mod/applications/mod_avmd cp /tmp/mod_httapi.c.patch /usr/local/src/freeswitch/src/mod/applications/mod_httapi -# patch freeswitch cd /usr/local/src/freeswitch/src +echo patching switch_rtp patch < switch_rtp.c.patch +echo patching switch_core_media patch < switch_core_media.c.patch cd /usr/local/src/freeswitch/src/mod/applications/mod_avmd +echo patching mod_avmd patch < mod_avmd.c.patch cd /usr/local/src/freeswitch/src/mod/applications/mod_httapi +echo patching mod_httapi patch < mod_httapi.c.patch # build libwebsockets +echo building lws cd /usr/local/src/libwebsockets sudo mkdir -p build && cd build && sudo cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && sudo make && sudo make install # build libfvad cd /usr/local/src/freeswitch/libs/libfvad +# use our version of libfvad configure.ac - should only do this on debian 12 +if [ "$DISTRO" == "debian-12" ]; then + echo "patching libfvad configure.ac to remove deprecated commands" + sudo cp /tmp/configure.ac.libfvad configure.ac +fi +echo building libfvad sudo autoreconf -i && sudo ./configure && sudo make -j 4 && sudo make install # build spandsp +echo building spandsp cd /usr/local/src/freeswitch/libs/spandsp ./bootstrap.sh && ./configure && make -j 4 && sudo make install # build sofia +echo building sofia cd /usr/local/src/freeswitch/libs/sofia-sip ./bootstrap.sh && ./configure && make -j 4 && sudo make install # build aws-c-common +echo building aws-c-common cd /usr/local/src/freeswitch/libs/aws-c-common mkdir -p build && cd build cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" make -j 4 && sudo make install # build aws-sdk-cpp +echo building aws-sdk-cpp cd /usr/local/src/freeswitch/libs/aws-sdk-cpp +git submodule update --init --recursive mkdir -p build && cd build cmake .. -DBUILD_ONLY="lexv2-runtime;transcribestreaming" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" -make -j 4 && sudo make install +if [ "$DISTRO" == "debian-12" ]; then + echo "patching aws-sdk-cpp to fix debian 12 build" + sudo sed -i 's/uint8_t arr\[16\];/uint8_t arr\[16\] = {0};/g' /usr/local/src/freeswitch/libs/aws-sdk-cpp/build/.deps/build/src/AwsCCommon/tests/byte_buf_test.c + sudo sed -i 's/char filename_array\[64\];/char filename_array\[64\] = {0};/g' /usr/local/src/freeswitch/libs/aws-sdk-cpp/build/.deps/build/src/AwsCCommon/tests/logging/logging_test_utilities.c + cmake .. -DBUILD_ONLY="lexv2-runtime;transcribestreaming" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" +fi +sudo make -j 4 && sudo make install +sudo find /usr/local/src/freeswitch/libs/aws-sdk-cpp/ -type f -name "*.pc" | sudo xargs cp -t /usr/local/lib/pkgconfig/ # build grpc +echo building grpc cd /usr/local/src/grpc git submodule update --init --recursive mkdir -p cmake/build @@ -135,6 +156,7 @@ make -j 4 sudo make install # build googleapis +echo building googleapis cd /usr/local/src/freeswitch/libs/googleapis echo "Ref: https://github.com/GoogleCloudPlatform/cpp-samples/issues/113" sed -i 's/\$fields/fields/' google/maps/routes/v1/route_service.proto @@ -156,11 +178,16 @@ echo "building protobuf stubs for sonioxasr" cd /usr/local/src/freeswitch/libs/soniox-asr-grpc-api LANGUAGE=cpp make +# build cobalt protobufs +echo "building protobuf stubs for cobalt" +cd /usr/local/src/freeswitch/libs/cobalt-asr-grpc-api +LANGUAGE=cpp make + # build freeswitch echo "building freeswitch" cd /usr/local/src/freeswitch sudo ./bootstrap.sh -j -sudo ./configure --enable-tcmalloc=yes --with-lws=yes --with-extra=yes +sudo ./configure --enable-tcmalloc=yes --with-lws=yes --with-extra=yes --with-aws=yes sudo make -j 4 sudo make install sudo make cd-sounds-install cd-moh-install @@ -186,4 +213,3 @@ sudo chmod a+x /etc/cron.daily/freeswitch_log_rotation echo "downloading soniox root verification certificate" cd /usr/local/freeswitch/certs wget https://raw.githubusercontent.com/grpc/grpc/master/etc/roots.pem - diff --git a/packer/jambonz-mini/aws/scripts/install_homer.sh b/packer/jambonz-mini/aws/scripts/install_homer.sh index 14717c6..c1962bc 100644 --- a/packer/jambonz-mini/aws/scripts/install_homer.sh +++ b/packer/jambonz-mini/aws/scripts/install_homer.sh @@ -5,6 +5,12 @@ DB_USER=$2 DB_PASS=$3 curl -s https://packagecloud.io/install/repositories/qxip/sipcapture/script.deb.sh | sudo bash + +# DH: TMP hack until homer releases debs for bookworm +sudo sed -i 's/bookworm/bullseye/g' /etc/apt/sources.list.d/qxip_sipcapture.list +sudo apt-get update + +# now install homer sudo apt-get install -y homer-app heplify-server sudo cp /usr/local/homer/etc/webapp_config.json.example /usr/local/homer/etc/webapp_config.json diff --git a/packer/jambonz-mini/aws/scripts/install_jaeger.sh b/packer/jambonz-mini/aws/scripts/install_jaeger.sh index 4e89e79..7cd53d7 100644 --- a/packer/jambonz-mini/aws/scripts/install_jaeger.sh +++ b/packer/jambonz-mini/aws/scripts/install_jaeger.sh @@ -17,20 +17,35 @@ sudo chmod 644 /etc/systemd/system/jaeger-collector.service sudo cp jaeger-query.service /etc/systemd/system sudo chmod 644 /etc/systemd/system/jaeger-query.service -echo "installing cassandra" +echo "installing cassandra on $2" -sudo apt-get install -y default-jdk +if [ "$2" == "debian-12" ]; then + + # if debian 12 we need to downgrade java JDK to 11 + echo "downgrading Java JSDK to 11 because cassandra requires it" + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11.1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz + sudo tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz -C /opt/ + sudo update-alternatives --install /usr/bin/java java /opt/jdk-11.0.9+11/bin/java 100 + sudo update-alternatives --install /usr/bin/javac javac /opt/jdk-11.0.9+11/bin/javac 100 + sudo update-alternatives --set java /opt/jdk-11.0.9+11/bin/java + sudo update-alternatives --set javac /opt/jdk-11.0.9+11/bin/javac + echo "export JAVA_HOME=/opt/jdk-11.0.9+11" >> ~/.bashrc + echo "export PATH=$PATH:$JAVA_HOME/bin" >> ~/.bashrc + source ~/.bashrc +else + sudo apt-get install -y default-jdk +fi +# Verify the installation +java -version tar xvfz apache-cassandra-4.1.3-bin.tar.gz -mv apache-cassandra-4.1.3 /usr/local/cassandra +sudo mv apache-cassandra-4.1.3 /usr/local/cassandra sudo cp cassandra.yaml /usr/local/cassandra/conf sudo chown -R admin:admin /usr/local/cassandra/ -cat /usr/local/cassandra/conf/cassandra.yaml - chown -R admin:admin /usr/local/cassandra/ -echo 'export PATH=$PATH:/usr/local/cassandra/bin' | tee -a /home/admin/.bashrc -echo 'export PATH=$PATH:/usr/local/cassandra/bin' | tee -a /etc/profile +echo 'export PATH=$PATH:/usr/local/cassandra/bin' | sudo tee -a /home/admin/.bashrc +echo 'export PATH=$PATH:/usr/local/cassandra/bin' | sudo tee -a /etc/profile export PATH=$PATH:/usr/local/cassandra/bin sudo cp cassandra.service /etc/systemd/system diff --git a/packer/jambonz-mini/aws/scripts/install_nodejs.sh b/packer/jambonz-mini/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-mini/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-mini/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-mini/aws/scripts/install_os_tuning.sh b/packer/jambonz-mini/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-mini/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-mini/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-mini/aws/template.json b/packer/jambonz-mini/aws/template.json index 2789ae9..df027a8 100644 --- a/packer/jambonz-mini/aws/template.json +++ b/packer/jambonz-mini/aws/template.json @@ -4,8 +4,8 @@ "ssh_username": "admin", "ami_description": "jambonz all-in-one AMI", "instance_type": "c6in.xlarge", - "drachtio_version": "v0.8.22", - "jambonz_version": "v0.8.4-4", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "jambonz_user": "admin", "jambonz_password": "JambonzR0ck$", "install_telegraf": "yes", @@ -64,14 +64,14 @@ "sudo apt-get update", "sudo apt-get remove --auto-remove nftables", "sudo apt-get purge nftables", - "sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", - "curl argon2 telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\", - "libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev linux-headers-amd64 libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\", + "sudo apt-get -y install python-is-python3 lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", + "curl argon2 telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev zlib1g-dev systemd-coredump liblz4-tool \\", + "libxtables-dev libip6tc-dev libip4tc-dev libiptc-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\", "libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\", - "libhiredis-dev gperf libspandsp-dev default-libmysqlclient-dev htop dnsutils gdb \\", - "gnupg2 wget pkg-config ca-certificates libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev snapd \\", - "libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm libswscale-dev haveged jq fail2ban pandoc \\", - "libopus-dev libsndfile-dev libshout3-dev libmpg123-dev libmp3lame-dev libopusfile-dev libgoogle-perftools-dev", + "libhiredis-dev gperf libspandsp-dev default-libmysqlclient-dev htop dnsutils gdb autoconf-archive \\", + "gnupg2 wget pkg-config ca-certificates libjpeg-dev libsqlite3-dev libpcre3-dev libldns-dev snapd linux-headers-$(uname -r) \\", + "libspeex-dev libspeexdsp-dev libedit-dev libtiff-dev yasm libswscale-dev haveged jq fail2ban pandoc libre2-dev \\", + "libopus-dev libsndfile1-dev libshout3-dev libmpg123-dev libmp3lame-dev libopusfile-dev libgoogle-perftools-dev", "sudo chmod a+w /usr/local/src", "mkdir ~/apps", "cd ~/apps", @@ -95,13 +95,39 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_jaeger`}}", + "environment_vars": [ + "ARCH=amd64", + "MEDIA_SERVER_NAME={{user `mediaserver_name`}}", + "PREFERRED_CODEC_LIST={{user `preferred_codec_list`}}", + "DISTRO={{user `distro`}}" + ], + "script": "scripts/install_freeswitch.sh" + }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_jaeger`}} {{user `distro`}}", "script": "scripts/install_jaeger.sh" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_homer`}} {{user `homer_user`}} {{user `homer_password`}}", + "script": "scripts/install_postgresql.sh" + }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_homer`}} {{user `homer_user`}} {{user `homer_password`}}", + "script": "scripts/install_homer.sh" + }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `drachtio_version`}} {{user `distro`}}", + "script": "scripts/install_drachtio.sh" + }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_cloudwatch`}}", @@ -112,24 +138,10 @@ "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `rtp_engine_version`}}", "script": "scripts/install_rtpengine.sh" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `drachtio_version`}}", - "script": "scripts/install_drachtio.sh" - }, { "type": "shell", "script": "scripts/install_nodejs.sh" }, - { - "type": "shell", - "environment_vars": [ - "ARCH=amd64", - "MEDIA_SERVER_NAME={{user `mediaserver_name`}}", - "PREFERRED_CODEC_LIST={{user `preferred_codec_list`}}" - ], - "script": "scripts/install_freeswitch.sh" - }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_influxdb`}}", @@ -148,11 +160,6 @@ "type": "shell", "script": "scripts/install_redis.sh" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_homer`}} {{user `homer_user`}} {{user `homer_password`}}", - "script": "scripts/install_postgresql.sh" - }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_homer`}} {{user `influxdb_ip`}}", @@ -177,21 +184,18 @@ "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `jambonz_version`}} {{user `jambonz_user`}} {{user `jambonz_password`}}", "script": "scripts/install_app.sh" }, - { - "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_homer`}} {{user `homer_user`}} {{user `homer_password`}}", - "script": "scripts/install_homer.sh" - }, { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-monitoring/aws/scripts/install_os_tuning.sh b/packer/jambonz-monitoring/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-monitoring/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-monitoring/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-monitoring/aws/template.json b/packer/jambonz-monitoring/aws/template.json index 1dc7954..3513f60 100644 --- a/packer/jambonz-monitoring/aws/template.json +++ b/packer/jambonz-monitoring/aws/template.json @@ -4,7 +4,7 @@ "ssh_username": "admin", "ami_description": "jambonz monitoring server", "instance_type": "t2.xlarge", - "jambonz_version": "v0.8.4-4", + "jambonz_version": "v0.8.5-rc8", "homer_user": "homer_user", "homer_password": "XcapJTqy11LnsYRtxXGPTYQkAnI", "install_influxdb": "yes", @@ -68,6 +68,7 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { @@ -108,13 +109,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-sbc-rtp/aws/scripts/install_nodejs.sh b/packer/jambonz-sbc-rtp/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-sbc-rtp/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-sbc-rtp/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-sbc-rtp/aws/scripts/install_os_tuning.sh b/packer/jambonz-sbc-rtp/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-sbc-rtp/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-sbc-rtp/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-sbc-rtp/aws/template.json b/packer/jambonz-sbc-rtp/aws/template.json index d0ca227..606aae7 100644 --- a/packer/jambonz-sbc-rtp/aws/template.json +++ b/packer/jambonz-sbc-rtp/aws/template.json @@ -3,12 +3,12 @@ "region": "us-east-1", "ssh_username": "admin", "ami_description": "jambonz SBC RTP server", - "drachtio_version": "v0.8.22", - "jambonz_version": "v0.8.4-4", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_arch": "amd64", "ami_base_image_owner": "136693071363", "instance_type": "t3.xlarge", - "rtp_engine_version": "mr11.4.1.4", + "rtp_engine_version": "mr11.5.1.1", "rtp_engine_min_port": "40000", "rtp_engine_max_port": "60000", "install_datadog": "no", @@ -81,6 +81,7 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { @@ -124,13 +125,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-sbc-sip-rtp/aws/scripts/install_nodejs.sh b/packer/jambonz-sbc-sip-rtp/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-sbc-sip-rtp/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-sbc-sip-rtp/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-sbc-sip-rtp/aws/scripts/install_os_tuning.sh b/packer/jambonz-sbc-sip-rtp/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-sbc-sip-rtp/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-sbc-sip-rtp/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-sbc-sip-rtp/aws/template.json b/packer/jambonz-sbc-sip-rtp/aws/template.json index 610ae73..a83f41e 100644 --- a/packer/jambonz-sbc-sip-rtp/aws/template.json +++ b/packer/jambonz-sbc-sip-rtp/aws/template.json @@ -4,11 +4,11 @@ "ssh_username": "admin", "ami_description": "jambonz SBC SIP+RTP", "instance_type": "t3.xlarge", - "drachtio_version": "v0.8.22", - "jambonz_version": "v0.8.4-4", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_arch": "amd64", "ami_base_image_owner": "136693071363", - "rtp_engine_version": "mr11.4.1.4", + "rtp_engine_version": "mr11.5.1.1", "rtp_engine_min_port": "40000", "rtp_engine_max_port": "60000", "install_datadog": "no", @@ -84,6 +84,11 @@ "source": "files/", "destination": "/tmp" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", + "script": "scripts/install_os_tuning.sh" + }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{build `ID`}}", @@ -94,10 +99,6 @@ "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `rtp_engine_version`}}", "script": "scripts/install_rtpengine.sh" }, - { - "type": "shell", - "script": "scripts/install_os_tuning.sh" - }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_cloudwatch`}}", @@ -134,14 +135,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", - "sudo rm /home/admin/.ssh/known_hosts", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-sbc-sip/aws/scripts/install_nodejs.sh b/packer/jambonz-sbc-sip/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-sbc-sip/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-sbc-sip/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-sbc-sip/aws/scripts/install_os_tuning.sh b/packer/jambonz-sbc-sip/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-sbc-sip/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-sbc-sip/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-sbc-sip/aws/template.json b/packer/jambonz-sbc-sip/aws/template.json index 7d03921..a3eebad 100644 --- a/packer/jambonz-sbc-sip/aws/template.json +++ b/packer/jambonz-sbc-sip/aws/template.json @@ -4,8 +4,8 @@ "ssh_username": "admin", "ami_description": "jambonz SBC SIP", "instance_type": "t3.xlarge", - "drachtio_version": "v0.8.22", - "jambonz_version": "v0.8.4-4", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_arch": "amd64", "ami_base_image_owner": "136693071363", "install_datadog": "no", @@ -86,8 +86,13 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, + { + "type": "shell", + "script": "scripts/install_nodejs.sh" + }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_cloudwatch`}}", @@ -107,10 +112,6 @@ "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_telegraf`}}", "script": "scripts/install_telegraf.sh" }, - { - "type": "shell", - "script": "scripts/install_nodejs.sh" - }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `drachtio_version`}}", @@ -124,13 +125,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_nodejs.sh b/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_os_tuning.sh b/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-web-server-and-monitoring-server/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-web-server-and-monitoring-server/aws/template.json b/packer/jambonz-web-server-and-monitoring-server/aws/template.json index d53425e..aea72e5 100644 --- a/packer/jambonz-web-server-and-monitoring-server/aws/template.json +++ b/packer/jambonz-web-server-and-monitoring-server/aws/template.json @@ -4,7 +4,7 @@ "ssh_username": "admin", "ami_description": "jambonz web+monitoring server", "instance_type": "t3.xlarge", - "jambonz_version": "v0.8.4-4", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_arch": "amd64", "ami_base_image_owner": "136693071363", "install_datadog": "no", @@ -83,6 +83,7 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { @@ -149,14 +150,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", - "sudo rm /home/admin/.ssh/known_hosts", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ] diff --git a/packer/jambonz-web-server/aws/scripts/install_nodejs.sh b/packer/jambonz-web-server/aws/scripts/install_nodejs.sh index d8de438..9c21c68 100644 --- a/packer/jambonz-web-server/aws/scripts/install_nodejs.sh +++ b/packer/jambonz-web-server/aws/scripts/install_nodejs.sh @@ -1,5 +1,11 @@ #!/bin/bash -curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - && sudo apt-get install -y nodejs +sudo apt-get update +sudo apt-get install -y ca-certificates curl gnupg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update +sudo apt-get install nodejs -y sudo npm install -g npm@latest node -v npm -v diff --git a/packer/jambonz-web-server/aws/scripts/install_os_tuning.sh b/packer/jambonz-web-server/aws/scripts/install_os_tuning.sh index 10ae665..36486bc 100755 --- a/packer/jambonz-web-server/aws/scripts/install_os_tuning.sh +++ b/packer/jambonz-web-server/aws/scripts/install_os_tuning.sh @@ -1,4 +1,6 @@ #!/bin/bash +DISTRO=$1 + sudo sed -i '/# End of file/i * hard nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i * soft nofile 65535' /etc/security/limits.conf sudo sed -i '/# End of file/i root hard nofile 65535' /etc/security/limits.conf @@ -18,12 +20,13 @@ sudo cp /tmp/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades # disable ipv6 echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf > /dev/null -sudo sysctl -p # install latest cmake -cd /usr/local/src -wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz -tar xvfz v3.27.4.tar.gz -cd CMake-3.27.4 -./bootstrap && make -j 4 && sudo make install -cmake --version +if [ "$DISTRO" == "debian-12" ]; then + cd /usr/local/src + wget https://github.com/Kitware/CMake/archive/refs/tags/v3.27.4.tar.gz + tar xvfz v3.27.4.tar.gz + cd CMake-3.27.4 + ./bootstrap && make -j 4 && sudo make install + cmake --version +fi \ No newline at end of file diff --git a/packer/jambonz-web-server/aws/template.json b/packer/jambonz-web-server/aws/template.json index c31bc8f..a54cbc1 100644 --- a/packer/jambonz-web-server/aws/template.json +++ b/packer/jambonz-web-server/aws/template.json @@ -4,8 +4,8 @@ "ssh_username": "admin", "ami_description": "jambonz webserver", "instance_type": "t3.xlarge", - "jambonz_version": "v0.8.4-4", - "ami_base_image_arch": "amd64", + "drachtio_version": "v0.8.24-rc1", + "jambonz_version": "v0.8.5-rc9", "ami_base_image_owner": "136693071363", "install_datadog": "no", "install_cloudwatch": "yes", @@ -75,6 +75,7 @@ }, { "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `distro`}}", "script": "scripts/install_os_tuning.sh" }, { @@ -111,13 +112,15 @@ { "type": "shell", "inline": [ + "set -e", + "set -x", "echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections", "echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections", "sudo apt-get -y install iptables-persistent", "sudo rm -Rf /tmp/*", "sudo rm /root/.ssh/authorized_keys", "sudo rm /home/admin/.ssh/authorized_keys", - "if [ \"{{user `leave_source`}}\" == \"no\" ]; then sudo rm -Rf /usr/local/src/*; fi" + "if [ \"{{user `leave_source`}}\" = 'no' ]; then sudo rm -Rf /usr/local/src/*; fi" ] } ]