From cf15febf2022473ac79977b74bbe85143b317dbb Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 3 Dec 2021 09:23:16 -0500 Subject: [PATCH] Revert "Feature - Add mrf variables to template.json (#8)" (#9) This reverts commit c032c94895354ad9d36769b12bf7a5d4d1b70e8b. --- .gitignore | 5 +- .../jambonz-scalable-production.yaml | 49 ------------------- .../files/mrf_sip_profile.xml | 3 +- .../scripts/install_datadog.sh | 4 +- .../scripts/install_freeswitch.sh | 5 +- packer/jambonz-feature-server/template.json | 16 ++---- .../scripts/install_datadog.sh | 4 +- packer/jambonz-sbc-sip/template.json | 16 +++--- 8 files changed, 17 insertions(+), 85 deletions(-) diff --git a/.gitignore b/.gitignore index 2cec9aa..d833a11 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,4 @@ gcp.json data_volume/ -tmpAudio/ - -.idea -*.iml \ No newline at end of file +tmpAudio/ \ No newline at end of file diff --git a/cloudformation/jambonz-scalable-production.yaml b/cloudformation/jambonz-scalable-production.yaml index 5169d0d..b3c618f 100644 --- a/cloudformation/jambonz-scalable-production.yaml +++ b/cloudformation/jambonz-scalable-production.yaml @@ -15,26 +15,6 @@ Parameters: Default: "name of an aws keypair that you have downloaded and will use to access the EC2 instances via ssh" Type: "AWS::EC2::KeyPair::KeyName" - TlsDomain: - Default: "" - Description: "TLS domain name" - Type: String - - TlsKey: - Default: "" - Description: "TLS .key certificate" - Type: "AWS::SSM::Parameter::Value" - - TlsCert: - Default: "" - Description: "TLS .cert certificate" - Type: "AWS::SSM::Parameter::Value" - - TlsFullchain: - Default: "" - Description: "TLS .fullchain certificate" - Type: "AWS::SSM::Parameter::Value" - InstanceTypeSbcSip: Description: "the EC2 instance type for the SBC SIP server" Type: String @@ -1080,32 +1060,8 @@ Resources: sudo systemctl restart telegraf echo "restarting drachtio server" - - #If TLS build out certificates from SSM params - if ["${TLS_DOMAIN}" != ""] && ["${TLS_KEY}" != ""] && ["${TLS_CERT}" != ""] && ["${TLS_FULLCHAIN}" != ""]; then - - #create certificate based on SSM values - sudo mkdir -p "/etc/certs/$TLS_DOMAIN" - echo "$TLS_KEY" > "/etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.key" - echo "$TLS_CERT" > "/etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.cert" - echo "$TLS_FULLCHAIN" > "/etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.fullchain.crt" - - #update drachtio.conf.xml with newly created certs - sudo sed -i "/udp-mtu/a \ - - /etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.key - /etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.crt - /etc/certs/$TLS_DOMAIN/$TLS_DOMAIN.fullchain.crt - " /etc/drachtio.conf.xml - - #update drachtio.service add contact for tls - sudo sed -i -e "s/--contact sip:${LOCAL_IP};transport=tcp/a --contact sips:${LOCAL_IP}:5061;transport=tls --external-ip ${PUBLIC_IP} \/g" /etc/systemd/system/drachtio.service - sudo sed -i -e "s/--contact sip:${LOCAL_IP};transport=tcp/a --contact sips:${LOCAL_IP}:8443;transport=wss --external-ip ${PUBLIC_IP} \/g" /etc/systemd/system/drachtio.service - fi - # point drachtio server to the HEP endpoint on the monitoring server sudo sed -i -e "s/--address 0.0.0.0 --port 9022/--address 0.0.0.0 --port 9022 --homer ${MONITORING_SERVER_IP}:9060 --homer-id 10/g" /etc/systemd/system/drachtio.service - sudo systemctl daemon-reload sudo systemctl restart drachtio @@ -1126,11 +1082,6 @@ Resources: MONITORING_SERVER_IP: !GetAtt MonitoringServerEC2.PrivateIp AWS_SNS_TOPIC_ARN: !Ref SbcSipServerSNSTopic JAMBONES_TIME_SERIES_HOST: !GetAtt MonitoringServerEC2.PrivateIp - TLS_DOMAIN: !Ref TlsDomain - TLS_KEY: !Ref TlsKey - TLS_CERT: !Ref TlsCert - TLS_FULLCHAIN: !Ref TlsFullchain - SbcSipServerPlacementGroup: Type: AWS::EC2::PlacementGroup Properties: diff --git a/packer/jambonz-feature-server/files/mrf_sip_profile.xml b/packer/jambonz-feature-server/files/mrf_sip_profile.xml index 9ed0723..ba7559c 100644 --- a/packer/jambonz-feature-server/files/mrf_sip_profile.xml +++ b/packer/jambonz-feature-server/files/mrf_sip_profile.xml @@ -18,8 +18,7 @@ - - + diff --git a/packer/jambonz-feature-server/scripts/install_datadog.sh b/packer/jambonz-feature-server/scripts/install_datadog.sh index 206a338..a4a3ea2 100755 --- a/packer/jambonz-feature-server/scripts/install_datadog.sh +++ b/packer/jambonz-feature-server/scripts/install_datadog.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ "$1" == "yes" ] && [ "$DD_KEY" != "" ]; then +if [ "$1" == "yes" ]; then echo installing datadog... - DD_INSTALL_ONLY=true DD_API_KEY=${DD_KEY} bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)" + DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)" fi \ No newline at end of file diff --git a/packer/jambonz-feature-server/scripts/install_freeswitch.sh b/packer/jambonz-feature-server/scripts/install_freeswitch.sh index f4d2ccc..cc830bc 100644 --- a/packer/jambonz-feature-server/scripts/install_freeswitch.sh +++ b/packer/jambonz-feature-server/scripts/install_freeswitch.sh @@ -130,9 +130,8 @@ sudo cp /usr/local/src/freeswitch/conf/vanilla/autoload_configs/modules.conf.xml sudo cp /tmp/freeswitch.service /etc/systemd/system sudo chown root:root -R /usr/local/freeswitch sudo chmod 644 /etc/systemd/system/freeswitch.service -sudo sed -i -e "s/global_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8/global_codec_prefs=${CODEC_LIST}/g" /usr/local/freeswitch/conf/vars.xml -sudo sed -i -e "s/outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8/outbound_codec_prefs=${CODEC_LIST}/g" /usr/local/freeswitch/conf/vars.xml -sudo sed -i -e "s/outbound_codec_prefs=PCMU,PCMA,OPUS,G722/a " /usr/local/freeswitch/conf/vars.xml +sudo sed -i -e 's/global_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8/global_codec_prefs=PCMU,PCMA,OPUS,G722/g' /usr/local/freeswitch/conf/vars.xml +sudo sed -i -e 's/outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8/outbound_codec_prefs=PCMU,PCMA,OPUS,G722/g' /usr/local/freeswitch/conf/vars.xml sudo systemctl enable freeswitch sudo cp /tmp/freeswitch_log_rotation /etc/cron.daily/freeswitch_log_rotation sudo chown root:root /etc/cron.daily/freeswitch_log_rotation diff --git a/packer/jambonz-feature-server/template.json b/packer/jambonz-feature-server/template.json index 8651109..b67db8c 100644 --- a/packer/jambonz-feature-server/template.json +++ b/packer/jambonz-feature-server/template.json @@ -7,10 +7,7 @@ "drachtio_version": "v0.8.13-rc1", "jambonz_version": "v0.6.7-rc8", "install_telegraf": "yes", - "install_datadog": "no", - "datadog_key" : "", - "mediaserver_name" : "jambonz", - "preferred_codec_list" : "PCMU,PCMA,OPUS,G722" + "install_datadog": "no" }, "builders": [{ "type": "amazon-ebs", @@ -66,8 +63,8 @@ "ssh-keyscan github.com >> ~/.ssh/known_hosts", "mkdir ~/apps", "cd ~/apps", - "git clone https://github.com/jambonz/jambonz-feature-server.git -b {{user `jambonz_version`}}", - "git clone https://github.com/jambonz/fsw-clear-old-calls.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/jambonz-feature-server.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/fsw-clear-old-calls.git -b {{user `jambonz_version`}}", "sudo find / -name authorized_keys | sudo xargs -0 -r rm -Rf" ] }, @@ -86,9 +83,6 @@ }, { "type": "shell", - "environment_vars": [ - "DD_KEY={{user `datadog_key`}}" - ], "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_datadog`}}", "script": "scripts/install_datadog.sh" }, @@ -99,10 +93,6 @@ }, { "type": "shell", - "environment_vars": [ - "USER_AGENT_STRING={{user `mediaserver_name`}}", - "CODEC_LIST={{user `preferred_codec_list`}}" - ], "script": "scripts/install_freeswitch.sh" }, { diff --git a/packer/jambonz-sbc-sip/scripts/install_datadog.sh b/packer/jambonz-sbc-sip/scripts/install_datadog.sh index d066ef7..ddca0d0 100755 --- a/packer/jambonz-sbc-sip/scripts/install_datadog.sh +++ b/packer/jambonz-sbc-sip/scripts/install_datadog.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ "$1" == "yes" ] && [ "$DD_KEY" != "" ]; then +if [ "$1" == "yes" ]; then - DD_INSTALL_ONLY=true DD_API_KEY=$DD_KEY bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)" + DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)" fi diff --git a/packer/jambonz-sbc-sip/template.json b/packer/jambonz-sbc-sip/template.json index 9bb8863..0e5f3d2 100644 --- a/packer/jambonz-sbc-sip/template.json +++ b/packer/jambonz-sbc-sip/template.json @@ -7,7 +7,6 @@ "drachtio_version": "v0.8.13-rc1", "jambonz_version": "v0.6.7-rc8", "install_datadog": "no", - "datadog_key" : "", "install_telegraf": "yes" }, "builders": [{ @@ -64,12 +63,12 @@ "ssh-keyscan github.com >> ~/.ssh/known_hosts", "mkdir ~/apps", "cd ~/apps", - "git clone https://github.com/jambonz/sbc-options-handler.git", - "git clone https://github.com/jambonz/sbc-outbound.git -b {{user `jambonz_version`}}", - "git clone https://github.com/jambonz/sbc-inbound.git -b {{user `jambonz_version`}}", - "git clone https://github.com/jambonz/sbc-registrar.git -b {{user `jambonz_version`}}", - "git clone https://github.com/jambonz/jambonz-smpp-esme.git -b {{user `jambonz_version`}}", - "git clone https://github.com/jambonz/sbc-call-router.git" + "git clone git@github.com:jambonz/sbc-options-handler.git", + "git clone git@github.com:jambonz/sbc-outbound.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/sbc-inbound.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/sbc-registrar.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/jambonz-smpp-esme.git -b {{user `jambonz_version`}}", + "git clone git@github.com:jambonz/sbc-call-router.git" ] }, { @@ -88,9 +87,6 @@ }, { "type": "shell", - "environment_vars": [ - "DD_KEY={{user `datadog_key`}}" - ], "execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `install_datadog`}}", "script": "scripts/install_datadog.sh" },