VoIP.info Guide

Plan and configure an Asterisk SIP trunk

Translate each carrier direction into explicit PJSIP objects, identification, restricted dialplan, retry policy and leg-by-leg acceptance evidence.

Reviewed 2026-10-19Current Asterisk PJSIP object, outbound-registration, configuration-example and res_pjsip references reviewed October 1, 2026; no account, carrier, PBX, endpoint, registration, identifier, route, call, emergency workflow, media stream, capacity or failover path was testedIntermediateDocumentation based · not lab tested

Translate the carrier contract by call direction

Obtain the provider's current Asterisk or standards reference and record inbound and outbound signaling destinations, source networks, authentication direction, registration requirement, transport, number format, caller-identity policy, codecs, media networks, emergency process, capacity owner and failover behavior. Do not copy another carrier's working configuration and change only the password.

Keep four questions separate: how Asterisk locates the carrier, how each side authenticates the other, how an inbound request is identified, and which dialplan context may handle it. A successful registration answers only the configured registration exchange. It does not establish inbound identification, outbound routing, media or emergency behavior.

Redundancy needs separate failure paths
A PBX uses a primary provider path and an alternate provider path. Shared PBX, power and internet dependencies remain unless the design also separates them.

New-call recovery and active-call survival are different tests. Inbound number failover needs a provider-side routing plan.

Draw the PJSIP object graph before writing it

The endpoint owns call behavior and the inbound context. An AoR gives Asterisk a contact for requests sent toward the carrier. An auth object answers or verifies a challenge according to its configured direction. An identify object maps inbound traffic to an endpoint. An outbound registration object exists only when the carrier requires Asterisk to REGISTER; it does not automatically create every object needed to place or receive calls.

Use distinct inbound and outbound auth objects when both directions authenticate. Asterisk's current reference warns against reusing one auth section because realm semantics differ by direction. Record the exact object names and relationships so a status screen or trace can be tied back to one configuration owner.

Make inbound identification and authorization explicit

Asterisk can identify an endpoint by source address through an identify object, while current res_pjsip also documents header and request-URI methods. The PJSIP relationship guide warns that configuration and endpoint-identifier module order affect whether a packet is identified by source IP or by the From user. Inspect the loaded identifier order and the actual request before broadening a match.

Place carrier-originated calls in a restricted context that can reach only intended business destinations. Match the documented provider signaling sources, but do not treat an IP match as permission to inherit unrestricted outbound routes. Identification, authentication and dialplan authorization remain separate controls.

Define registration failure and recovery policy

When registration is required, preserve server_uri, client_uri, contact identity, transport and outbound-auth ownership as separate fields. Asterisk documents no response, 408, 500, 502, 503, 504 and 600-class responses as temporary registration failures. Authentication rejections can be treated as permanent by the default auth_rejection_permanent behavior; changing that policy affects retry behavior and should follow carrier evidence rather than guesswork.

Set and observe a bounded retry plan. Asterisk's guide documents a 60-second default retry interval for temporary failures when retry is configured. Capture the response, retry state and next attempt instead of repeatedly reloading or manually registering, which can erase the failure timeline.

Route numbers and media without merging the legs

Normalize inbound DID and outbound destination formats according to the carrier's actual contract. Start with an explicit test destination rather than a broad catch-all, and document how forwarded external calls affect caller identity, channel use and billing. Keep provider-accepted identity separate from the display ultimately presented by the destination.

Endpoint codec allowance contributes to the outgoing SDP offer, but configured overlap is not a negotiated call result. Likewise, TLS protects a signaling leg and SRTP can protect a media leg only when configured and negotiated on that leg. Trace request routing, SDP, received RTP and audible media independently before changing authentication.

Prove loaded state, both directions and recovery

After a controlled reload, inspect the exact endpoint, AoR contact, identifier, auth ownership and outbound registration state. Then correlate one bounded inbound and outbound INVITE exchange with the dialplan context, normalized digits, selected endpoint, response, negotiated media and final disposition. Generated configuration, successful reload, registered status and a completed call are separate evidence stages.

Test inbound and outbound calls, two-way audio, DTMF, hold, blind and attended transfer, caller identity, unavailable and rejected destinations, carrier or network interruption, retry and return to service. Arrange emergency configuration and approved validation directly with the carrier. Preserve a redacted acceptance record and rollback path with the PBX backup. No account, carrier, PBX, endpoint, registration, identifier, route, call, emergency workflow, media stream, capacity or failover path was inspected or tested for this guide.

Implement provider-required headers at one owned boundary

When a provider specifies an outbound header, preserve the method and exact syntax, then use the PJSIP header ownership guide and missing-header diagnostic. A successful REGISTER or a value visible on the caller does not prove the INVITE carried it.

Translate Localphone’s older Asterisk example deliberately

Localphone publishes a chan_sip-era Asterisk example. The Localphone service record treats it as service-model evidence, not a current PJSIP template or compatibility claim, and requires each field to be mapped and observed.

Match Vonage delivery to the loaded PJSIP objects

Use the Vonage inbound diagnostic to align the selected URI, transport, endpoint identification, context and response.

Trace the delivered didlogic DID form in Asterisk

The provider example handles plus-prefixed and non-prefixed DIDs in a trunk context. The didlogic diagnostic records endpoint identification, context, normalization and first dialplan match.

Prove Callcentric provider routing before changing Asterisk

The Callcentric forwarding diagnostic distinguishes a provider-side direct forward from an INVITE that actually reaches the Asterisk edge and dialplan.

Anveo Direct media may bypass its signaling path

Before changing Asterisk, use the Anveo Direct diagnostic to compare the DID URI, inbound request, SDP and direct carrier RTP separately.

Trace CarrierX selection before changing Asterisk

Use the CarrierX diagnostic to prove the provider’s selected trunk, endpoint attempt and response before changing endpoint identification, context or media settings.

Trace AVOXI routing before changing Asterisk

Use the AVOXI diagnostic to prove the number target, provider attempt and response before changing endpoint identification, context or media.

Trace Easybell delivery before changing Asterisk

Use the Easybell diagnostic to prove provider target and edge receipt before changing endpoint identification, context or media.

Prove SIP.US DID treatment before changing Asterisk

Use the SIP.US DID diagnostic to establish provider routing and edge receipt before changing endpoint identification, context or media.

Prove Flowroute media after Asterisk accepts signaling

Flowroute Direct Media can arrive from sources outside its signaling proxy ranges. Follow the Flowroute audio diagnostic before changing unrelated endpoint identification.

Match Bulk Solutions inbound delivery after proving the provider assignment

Use the Bulk Solutions diagnostic to establish DID and edge evidence before changing Asterisk identify, context or media.

Match Yay.com delivery after proving the provider assignment

Use the Yay.com diagnostic to establish number, destination and edge evidence before changing PJSIP identify or context.

Match ClearlyIP delivery only after proving the number owner

The ClearlyIP diagnostic establishes provider routing and delivered identity before PJSIP identify or context changes.

Version-scope the Simwood Asterisk 16 example

The Simwood guide uses the sample for object ownership only and requires comparison with the installed branch and loaded state.

Map Sinch applications to loaded Asterisk objects

The Sinch diagnostic compares direction, source, endpoint identification, context and the first loaded route.

Keep SIPTRUNK signaling and direct media separate

The SIPTRUNK guide proves gateway signaling, loaded route and actual SDP or RTP independently.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.