Sign inSign up

rjp44/b2bua-freeswitch

By rjp44

•Updated about 1 month ago

Freeswitch for Aplisay B2BUA

Image
0

2.5K

rjp44/b2bua-freeswitch repository overview

⁠Aplisay B2BUA

A Back-to-Back User Agent (B2BUA) implementation using FreeSWITCH and a Node.js configuration server.

⁠Architecture

This project consists of two main components:

  1. FreeSWITCH - The SIP B2BUA engine
  2. Config Server - Node.js service that provides dynamic configuration to FreeSWITCH

⁠Quick Start

⁠Production Mode
  1. Clone the repository:

    git clone https://github.com/aplisay/aplisay-b2bua.git
    cd aplisay-b2bua
    
  2. Set environment variables:

    export PUBLIC_IP=your.public.ip
    export DOMAIN_NAME=b2bua.aplisay.local
    
  3. Start the services:

    docker-compose up -d
    
⁠Development Mode

For development with live config editing and local config-server:

  1. Clone and setup:

    git clone https://github.com/aplisay/aplisay-b2bua.git
    cd aplisay-b2bua
    
  2. Start development environment:

    ./dev-start.sh
    
  3. Stop development environment:

    ./dev-stop.sh
    

Development Features:

  • FreeSWITCH runs in Docker with volume-mounted config directory
  • Config-server runs locally on port 5002 with auto-restart
  • Live editing of FreeSWITCH configuration files
  • Easy access to logs and runtime files

⁠Services

⁠FreeSWITCH
  • Ports: 5060 (SIP), 5061 (SIP TLS), 8021 (ESL), 10000-12000 (RTP)
  • Configuration: Dynamically loaded from config-server
  • Network: Internal network 172.17.0.11
⁠Config Server
  • Port: 4000 (Production) / 5002 (Development)
  • Network: Internal network 172.17.0.10 (Production) / Local (Development)
  • Endpoints:
    • GET /health - Health check
    • GET /freeswitch/directory - User directory
    • GET /freeswitch/dialplan - Dialplan configuration
    • GET /admin/config - Admin configuration (basic auth)

⁠Development

⁠Building from source
# 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/
⁠Shared .env for development

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.
⁠Configuration

The config-server uses the config npm package for configuration management:

  • config/default.json - Default configuration
  • config/development.json - Development overrides
  • Environment variables can override any setting

⁠License

Proprietary - Aplisay Ltd.

Tag summary

Content type

Image

Digest

sha256:10302f688…

Size

769.7 MB

Last updated

about 1 month ago

docker pull rjp44/b2bua-freeswitch