Skip to content

Asterisk

Status: Current | Last reviewed: 2026-06-03

PJSIP realtime, ARI, dialplan. Configured (not coded) — runs from an upstream image with mounted config.

Image

asterisk:22-realtime (custom-built; see Dockerfile).

Ports

Port Purpose
5060/UDP, 5061/TCP SIP signaling
8087 ARI HTTP + WebSocket
10000–19999/UDP RTP media

Note: 8087 (ARI) is not 8088 (Janus admin). A common bug is "ARI not ready after 60s" because the controller raced Asterisk boot — restart ari-controller once Asterisk is up.

Configuration

Mounted from .devcontainer/asterisk/conf/ in Vanguard. Per-environment overlays for cluster mounted via ConfigMap.

File Purpose
pjsip.conf Realtime config wiring; the actual endpoints are ODBC-loaded from ps_* tables
extensions.conf Dialplan; routes inbound to the trueserve Stasis app
func_odbc.conf ODBC-backed dialplan functions
ari.conf Allows ari-controller to subscribe

Realtime tables

PJSIP reads endpoints, AORs, auths, and contacts from ps_* tables in Postgres. These names are upstream Asterisk's; we keep them as-is for compatibility (see cleanup-proposals.md).

Warning: a SIP call that answers and immediately hangs up with Q.850 cause=16 usually means func_odbc.conf is querying the dropped agent_configs view. Use agent_versions instead.

RTP range guard

Local dev keeps Asterisk RTP below the Janus/rtpengine range (20000-20499). The Overmind asterisk-rtp-watchdog service checks RTP socket usage and prunes stale allocations by restarting Asterisk only when the range is near-full and there are no active calls. Manual check/prune:

bash .devcontainer/scripts/asterisk-rtp-watchdog.sh --once
bash .devcontainer/scripts/asterisk-rtp-watchdog.sh --once --prune

Vanguard

Started by docker-compose.media.yml as tsf-local-asterisk.

docker logs tsf-local-asterisk --tail 100 -f
docker exec -it tsf-local-asterisk asterisk -rvvv

Production

Helm chart at charts/asterisk. Runs with hostNetwork: true on a dedicated media node pool. Config mounted via ConfigMap.

See also