Skip to content
Phone Guides

Make a first internal call with Asterisk PJSIP

After configuring accounts 6001 and 6002, add routes that tell Asterisk what to do when either number is dialled. This example deliberately contains only two internal destinations.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. These examples have not been independently tested by Phone Guides. Scope: Asterisk 22, the PJSIP account names from register two phones, and direct file-based configuration on the same controlled local network.

Add an explicit internal context

Preserve the effective extensions.conf and any relevant included files before editing. Add the following context once, without replacing unrelated routes:


[pg-internal]
exten => 6001,1,Dial(PJSIP/6001,20)
 same => n,Hangup()

exten => 6002,1,Dial(PJSIP/6002,20)
 same => n,Hangup()

The endpoint's context=pg-internal chooses where calls from that endpoint enter the dialplan. Each exact extension begins at priority 1. Dial() attempts the selected PJSIP destination with a 20-second ringing timeout; the next priority ends the remaining dialplan path when reached. This example does not distinguish busy, unanswered and unavailable destinations with separate announcements.

The Dial application reference for branch 22 documents timeout, options and result variables. The upstream context/priority explanation describes how the instructions are organised. These original two-route instructions are not a complete business dialplan.

Check the loaded routes

At the Asterisk CLI:


dialplan reload
dialplan show pg-internal
pjsip show contacts

Read any reload errors. Confirm both numbers appear in the intended context with their expected application arguments. Inspect the destination account/contact before changing the route to work around a missing phone.

The destination expression PJSIP/6002 refers to endpoint 6002 and its associated location information. It is not a public telephone number. The upstream PJSIP channel dialling guide explains the available forms; do not substitute a provider destination without a separate trunk design.

Make and record the reader checks

From phone 6001, dial 6002. Observe ringing, answer and speak in both directions. End the call and confirm the other end clears. Repeat from 6002 to 6001. Then dial an unused internal number to see the no-route behaviour. A successful answer in one direction is not enough to conclude the other direction works.

Observation What to investigate next
No matching extension Endpoint context, dialled digits and loaded dialplan
Destination unavailable Endpoint/AOR relationships and contact registration
Ringing but no answer Actual destination, phone state and timeout
Answered with missing audio Negotiated media address, firewall and codec
Call remains after one side hangs up Signalling path and termination messages

During a call, core show channels can show active legs. Use core show channel with the actual channel name for more detail. Treat channel names and output here as observations you collect, not fixed text a guide can guarantee. The CLI help guide explains how to find the appropriate command on your build.

Keep this path internal

There is no outbound trunk route in this context. Retain that boundary while learning the call flow. Do not add an unrestricted wildcard to make an unrelated dialled number work. If applying the example to an existing system, inspect all includes as well as these visible lines.

To reverse the change, restore the previous context and reload the file-based dialplan, then inspect it again. Review contexts and patterns before extending the destinations, or use first troubleshooting checks for a failure. Return to Asterisk documentation.