Skip to content
Phone Guides

Asterisk security baseline before connecting trunks

Decide who may place calls, where they may call, and which networks may reach each service before adding an external trunk. A password check and a firewall rule answer different questions. Both matter, and neither replaces dialplan permissions.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. Examples have not been independently tested by Phone Guides. Scope: Asterisk 22/PJSIP planning and configuration review, not certification of a particular deployment.

Draw the trust boundaries

Keep a short table of the server's interfaces and services. For each, record the allowed source, port/transport, purpose and owner. Include SIP, the actual configured media range, SSH, HTTP/ARI, AMI and any database or provisioning service. Opening a signalling port does not automatically justify opening every management interface.

Call entry point Intended destination scope Review question
Authenticated office phone Authorised internal and external routes Does this account need every external destination?
Provider trunk Approved inbound destinations Can this context reach a paid outbound route through an include?
Anonymous or unidentified traffic No paid routes Is it rejected or deliberately isolated?
Integration account Only its documented task Can it change configuration or originate calls beyond that task?

The upstream security overview treats network protection and dialplan authorisation as separate concerns. Follow that distinction when reviewing an installation.

Audit contexts and includes

Context names are labels, not permissions enforced by their English meaning. Inspect the actual entry context selected for each endpoint/trunk, all included contexts and every reachable destination. A context called from-provider is unsafe if it includes an unrestricted outbound context.

Use separate inbound and internal routes, with only the necessary destinations in each. Avoid broad matching that sends untrusted input straight to a chargeable trunk. The official dialplan security guidance explains why any extension reachable from an incoming context must be treated as reachable by that caller. The contexts guide shows a small internal-only example.

Protect accounts and management access

Generate a different strong secret for each phone and service account. Replace every illustrative placeholder before use, restrict access to files containing secrets and keep secret values out of tickets and screenshots. Revoke an account that is no longer needed. Do not reuse the office phone's credentials for an application integration.

Keep administrative interfaces on controlled networks or an appropriate protected access path. Grant an AMI/ARI account only the permissions its application needs. If a product manages these settings, use its supported controls. The upstream network guidance provides the general principle; match individual PJSIP options to the branch reference.

Check transport and authentication separately

UDP SIP examples in the introductory guides are limited to a controlled local network. They do not encrypt signalling or audio. For other deployments, plan the documented TLS and media-encryption path, including certificate trust and renewal. TLS for SIP alone is not evidence that RTP is encrypted.

Digest authentication capabilities depend on software and build versions. Use the official PJSIP authentication guide rather than assuming every phone supports the same algorithms. Record the peer's documented capabilities; do not disable authentication to hide a compatibility problem.

Review changes and watch for misuse

Before exposure, check the installed branch/patch against published security advisories. Record which update owner supplies fixes. Inspect active listeners and effective objects after configuration changes.

In your own checks, verify that an invalid password does not register, unauthorised callers cannot reach paid routes, and a provider call can reach only the intended inbound destinations. Monitor unusual destinations and repeated failures, and use provider-side spend/destination controls where available. These are reader checks, not results observed by Phone Guides.

Next: PJSIP objects. Return to Asterisk documentation.