Feature/proxmox (#50)

* initial changes for proxmox support

* proxmox packer updates

* terraform template for Proxmox jambonz-mini

* update jambonz-mini to 0.8.3-3
This commit is contained in:
Dave Horton authored and GitHub committed 2023-05-31 10:05:42 -04:00
1 parent 28ff526716
commit 80ec4a45da
286 files changed
+49674 -4

No files matched your search

File renamed without changes.
File renamed without changes.
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
VERSION=$1
DB_USER=$2
DB_PASS=$3
cd /home/admin
cp /tmp/ecosystem.config.js apps
echo "building jambonz-feature-server.."
cd /home/admin/apps/jambonz-feature-server && npm ci --unsafe-perm
echo "building fsw-clear-old-calls.."
cd /home/admin/apps/fsw-clear-old-calls && npm ci --unsafe-perm && sudo npm install -g .
echo "building jambonz-api-server.."
cd /home/admin/apps/jambonz-api-server && npm ci --unsafe-perm
echo "building jambonz-webapp.."
cd /home/admin/apps/jambonz-webapp && npm ci --unsafe-perm && npm run build
echo "building sbc-sip-sidecar.."
cd /home/admin/apps/sbc-sip-sidecar && npm ci --unsafe-perm
echo "building sbc-inbound.."
cd /home/admin/apps/sbc-inbound && npm ci --unsafe-perm
echo "building sbc-outbound.."
cd /home/admin/apps/sbc-outbound && npm ci --unsafe-perm
echo "building sbc-call-router.."
cd /home/admin/apps/sbc-call-router && npm ci --unsafe-perm
echo "building jambonz-smpp-esme.."
cd /home/admin/apps/jambonz-smpp-esme && npm ci --unsafe-perm
echo "building sbc-rtpengine-sidecar.."
cd /home/admin/apps/sbc-rtpengine-sidecar && npm ci --unsafe-perm
sudo npm install -g pino-pretty pm2 pm2-logrotate gulp grunt
sudo pm2 install pm2-logrotate
echo "0 * * * * root fsw-clear-old-calls --password JambonzR0ck$ >> /var/log/fsw-clear-old-calls.log 2>&1" | sudo tee -a /etc/crontab
echo "0 1 * * * root find /tmp -name \"*.mp3\" -mtime +2 -exec rm {} \; > /dev/null 2>&1" | sudo tee -a /etc/crontab
sudo -u admin bash -c "pm2 install pm2-logrotate"
sudo -u admin bash -c "pm2 set pm2-logrotate:max_size 1G"
sudo -u admin bash -c "pm2 set pm2-logrotate:retain 5"
sudo -u admin bash -c "pm2 set pm2-logrotate:compress true"
sudo chown -R admin:admin /home/admin/apps
sudo rm /home/admin/apps/jambonz-webapp/.env
sudo snap install core
sudo snap install --classic certbot
sudo rm /usr/bin/certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
@@ -5,7 +5,7 @@
"ami_description": "jambonz all-in-one AMI",
"instance_type": "c6in.xlarge",
"drachtio_version": "v0.8.22",
"jambonz_version": "v0.8.3",
"jambonz_version": "v0.8.3-3",
"jambonz_user": "admin",
"jambonz_password": "JambonzR0ck$",
"install_telegraf": "yes",
+102
View File
@@ -0,0 +1,102 @@
# packer-jambonz-mini
A [packer](https://www.packer.io/) template to build an AMI containing everything needed to run jambonz on a single EC2 instance. The base linux distro is Debian 11 (bullseye).
## Installing
```
$ packer build -color=false template.json
```
### variables
There are many variables that can be specified on the `packer build` command line; however defaults (which are shown below) are appropriate for building an "all in one" jambonz server, so you generally should not need to specify values.
```
"region": "us-east-1"
```
The region to create the AMI in
```
"ami_description": "EC2 AMI jambonz mini"
```
AMI description.
```
"instance_type": "t2.medium"
```
EC2 Instance type to use when building the AMI.
```
"install_drachtio": "true"
```
whether to install drachtio
```
"install_nodejs": "false",
```
whether to install Node.js
```
"install_rtpengine": "true",
```
whether to install rtpengine
```
"install_freeswitch": "true",
```
whether to install freeswitch
```
"install_drachtio_fail2ban": "true",
```
whether to install fail2ban with drachtio filter
```
"install_redis": "true",
```
whether to install redis
```
"drachtio_version": "v0.8.3"
```
drachtio tag or branch to build
```
"nodejs_version": "v10.16.2",
```
Node.js version to install
```
"freeswitch_bind_cloud_ip": "true"
```
If freeswitch is enabled, and cloud_provider is not none then this variable dictates whether freeswitch should bind its sip and rtp ports to the cloud public address (versus the local ipv4 address).
```
"mod_audio_fork_subprotocol": "audio.jambonz.org"
```
websocket subprotocol name used by freeswitch module mod_audio_fork
```
"mod_audio_fork_service_threads": "3",
```
number of libwebsocket service threads used by freeswitch module mod_audio_fork
``
"mod_audio_fork_buffer_secs": "2",
```
max number of seconds of audio to buffer by freeswitch module mod_audio_fork
```
"freeswitch_build_with_grpc:: "true"
```
whether to build support for google speech and text-to-speech services
```
"remove_source": "true"
```
whether to remove source build directories, or leave them on the instance
```
"cloud_provider": "aws"
```
Cloud provider the AMI will be built on.
File renamed without changes.
@@ -0,0 +1,2 @@
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,175 @@
--- 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
@@ -0,0 +1,24 @@
--- 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
Loaded 100 of 286 files, more files were not shown because too many files have changed in this diff. Show more