A Back-to-Back User Agent (B2BUA) implementation using FreeSWITCH and a Node.js configuration server.
This project consists of two main components:
Clone the repository:
git clone https://github.com/aplisay/aplisay-b2bua.git
cd aplisay-b2bua
Set environment variables:
export PUBLIC_IP=your.public.ip
export DOMAIN_NAME=b2bua.aplisay.local
Start the services:
docker-compose up -d
For development with live config editing and local config-server:
Clone and setup:
git clone https://github.com/aplisay/aplisay-b2bua.git
cd aplisay-b2bua
Start development environment:
./dev-start.sh
Stop development environment:
./dev-stop.sh
Development Features:
172.17.0.11172.17.0.10 (Production) / Local (Development)GET /health - Health checkGET /freeswitch/directory - User directoryGET /freeswitch/dialplan - Dialplan configurationGET /admin/config - Admin configuration (basic auth)# Build FreeSWITCH container
docker build -f freeswitch/Dockerfile -t aplisay-b2bua-freeswitch ./freeswitch/
# Build config-server container
docker build -f config-server/Dockerfile -t aplisay-b2bua-config-server ./config-server/
Create a .env file at the repository root and reuse it for all services (local dev and compose). Example values:
# Auth tokens
FS_CONFIG_TOKEN=aplisay-b2bua-config-token-2024
ADMIN_BEARER_TOKEN=
# Network and identity
PUBLIC_IP=127.0.0.1
DOMAIN_NAME=b2bua.aplisay.local
# Test gateway (config-server XML)
TEST_GATEWAY_ID=test-gateway-001
TEST_GATEWAY_REGISTRAR=sip.example.com:5060
TEST_GATEWAY_USERNAME=testuser
TEST_GATEWAY_PASSWORD=testpass123
TEST_GATEWAY_OPTIONS={"register":true,"transport":"tls"}
# ESL (esl-poller)
ESL_HOST=freeswitch
ESL_PORT=8021
ESL_SECRET=ClueCon
# Config server URL for esl-poller
# Use http://127.0.0.1:5002 when running config-server locally
CONFIG_SERVER_BASE=http://config-server:4000
CONFIG_SERVER_TOKEN=${FS_CONFIG_TOKEN}
# Optional database
DATABASE_SERVER=
DATABASE_NAME=
DATABASE_USER=
DATABASE_PASSWD=
DATABASE_PORT=5432
Notes:
config-server and esl-poller load environment via dotenv when run locally (yarn develop).docker-compose.yml and docker-compose.dev.yml both include env_file: .env, so the same file is used for containers.The config-server uses the config npm package for configuration management:
config/default.json - Default configurationconfig/development.json - Development overridesProprietary - Aplisay Ltd.
Content type
Image
Digest
sha256:10302f688…
Size
769.7 MB
Last updated
about 1 month ago
docker pull rjp44/b2bua-freeswitch