Skip to content

Commit

Permalink
Set min buffer on mod twilio stream (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie authored Jun 27, 2024
1 parent 5f16c6d commit 69d5832
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 120 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
go-version: "1.22.x"

- name: Run tests
working-directory: components/freeswitch_event_logger
Expand Down Expand Up @@ -135,9 +135,6 @@ jobs:
run: |
components/freeswitch/bin/export_tts_voices > components/freeswitch/conf/autoload_configs/tts_voices.xml
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
terraform 1.5.6
ruby 3.3.1
golang 1.22.1
terraform 1.9.0
ruby 3.3.3
golang 1.22.4
2 changes: 1 addition & 1 deletion components/app/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.3.1
ruby 3.3.3
7 changes: 5 additions & 2 deletions components/freeswitch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM public.ecr.aws/debian/debian:bookworm-slim as freeswitch-build
FROM public.ecr.aws/docker/library/debian:bookworm-slim as freeswitch-build
ARG signalwire_token

RUN apt update && apt install --no-install-recommends -yq cmake gcc g++ make cmake build-essential git libssl-dev libspeex-dev libspeexdsp-dev

RUN apt-get update && apt-get install --no-install-recommends -yq gnupg2 wget ca-certificates lsb-release && \
wget --http-user=signalwire --http-password=${signalwire_token} -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg && \
echo "machine freeswitch.signalwire.com login signalwire password ${signalwire_token}" > /etc/apt/auth.conf && \
chmod 600 /etc/apt/auth.conf && \
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `lsb_release -sc` main" > /etc/apt/sources.list.d/freeswitch.list && \
echo "deb-src [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list && \
apt-get update --allow-releaseinfo-change && \
Expand All @@ -22,13 +23,14 @@ RUN make install

FROM public.ecr.aws/aws-cli/aws-cli as aws-cli

FROM public.ecr.aws/debian/debian:bookworm-slim
FROM public.ecr.aws/docker/library/debian:bookworm-slim

ARG signalwire_token

RUN apt-get update && apt-get install --no-install-recommends -yq libssl-dev libspeex-dev libspeexdsp-dev gnupg2 wget ca-certificates lsb-release && \
wget --http-user=signalwire --http-password=${signalwire_token} -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg && \
echo "machine freeswitch.signalwire.com login signalwire password ${signalwire_token}" > /etc/apt/auth.conf && \
chmod 600 /etc/apt/auth.conf && \
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `lsb_release -sc` main" > /etc/apt/sources.list.d/freeswitch.list && \
echo "deb-src [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list && \
apt-get update --allow-releaseinfo-change && \
Expand Down Expand Up @@ -86,6 +88,7 @@ ENV FS_LOG_DIRECTORY "/var/log/freeswitch"
ENV FS_STORAGE_DIRECTORY "$FS_CACHE_DIRECTORY/freeswitch/storage"
ENV FS_TTS_CACHE_DIRECTORY "$FS_CACHE_DIRECTORY/freeswitch/tts_cache"
ENV MOD_TWILIO_STREAM_SUBPROTOCOL_NAME "audio.somleng.org"
ENV MOD_TWILIO_STREAM_MIN_BUFFER_MILISECS "500"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["freeswitch"]
4 changes: 2 additions & 2 deletions components/gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://apt.opensips.org/packages.php?os=bookworm

FROM public.ecr.aws/debian/debian:bookworm-slim AS bootstrap
FROM public.ecr.aws/docker/library/debian:bookworm-slim AS bootstrap

USER root

Expand Down Expand Up @@ -30,7 +30,7 @@ CMD ["create_db"]

# Build

FROM public.ecr.aws/debian/debian:bookworm-slim AS build
FROM public.ecr.aws/docker/library/debian:bookworm-slim AS build

USER root

Expand Down
2 changes: 1 addition & 1 deletion components/media_proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/debian/debian:bookworm-slim
FROM public.ecr.aws/docker/library/debian:bookworm-slim

USER root

Expand Down
22 changes: 11 additions & 11 deletions infrastructure/core/codebuild.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_iam_role" "codebuild" {

data "aws_iam_policy_document" "codebuild" {
statement {
effect = "Allow"
effect = "Allow"

resources = [
"arn:aws:logs:*:*:log-group:/aws/codebuild/${local.codebuild_identifier}*",
Expand All @@ -48,7 +48,7 @@ resource "aws_iam_role_policy_attachment" "codebuild_ecr_public" {
}

resource "aws_codebuild_project" "amd64" {
name = "${local.codebuild_identifier}-amd64"
name = "${local.codebuild_identifier}-amd64"

service_role = aws_iam_role.codebuild.arn

Expand All @@ -62,20 +62,20 @@ resource "aws_codebuild_project" "amd64" {
}

environment {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/amazonlinux2-x86_64-standard:5.0"
type = "LINUX_CONTAINER"
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/amazonlinux2-x86_64-standard:5.0"
type = "LINUX_CONTAINER"
privileged_mode = true
}

source {
type = "GITHUB"
type = "GITHUB"
location = "https://github.com/somleng/somleng-switch.git"
}
}

resource "aws_codebuild_project" "arm64" {
name = "${local.codebuild_identifier}-arm64"
name = "${local.codebuild_identifier}-arm64"

service_role = aws_iam_role.codebuild.arn

Expand All @@ -89,14 +89,14 @@ resource "aws_codebuild_project" "arm64" {
}

environment {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/amazonlinux2-aarch64-standard:3.0"
type = "ARM_CONTAINER"
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/amazonlinux2-aarch64-standard:3.0"
type = "ARM_CONTAINER"
privileged_mode = true
}

source {
type = "GITHUB"
type = "GITHUB"
location = "https://github.com/somleng/somleng-switch.git"
}
}
5 changes: 1 addition & 4 deletions infrastructure/modules/somleng_switch/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ terraform {
local = {
source = "hashicorp/local"
}
template = {
source = "hashicorp/template"
}
tls = {
source = "hashicorp/tls"
}
docker = {
source = "kreuzwerker/docker"
source = "kreuzwerker/docker"
}
}
required_version = ">= 0.13"
Expand Down
77 changes: 31 additions & 46 deletions infrastructure/production/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 31 additions & 46 deletions infrastructure/staging/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69d5832

Please sign in to comment.