Howwise RSS
VoIP & Phone Systems8 min read

FreePBX Cannot Make Outbound Calls: Layer-by-Layer Fix

Short answer

When FreePBX cannot make outbound calls despite a registered phone, the failure is in one of three layers: no dialplan match, no matching outbound route or empty trunk sequence, or a trunk that is down or rejects the call. The Asterisk CLI shows which.

Key takeaways
  • A registered extension only proves REGISTER works, so test an internal call or *43 first to separate phone problems from route and trunk problems.
  • Run asterisk -rvvvvv, dial the number, and read the last executed line: no outrt-N context means a pattern or route problem, while an immediate Congestion means a trunk problem.
  • The first matching outbound route wins, so a broad earlier route pointing at a dead trunk silently blocks every route below it.
  • Prove the trunk independently with channel originate PJSIP/NUMBER@TRUNKNAME application Playback hello-world, which bypasses phone, routes and permissions but places a real, billable call.
  • If a change has no effect, click Apply Config or run fwconsole reload, because route edits are not live until the dialplan is regenerated.

FreePBX cannot make outbound calls but the phone is registered: why?

Registration only proves the phone can authenticate to Asterisk. Dialing out needs three more things: the dialed digits must reach the from-internal dialplan, an outbound route must match them, and a trunk must accept the call.

Split the problem first. Dial another extension, then dial *43 (echo test). If both work, the phone, codecs and the from-internal context are fine, and the fault is in the route or trunk layers. If internal calls also fail, fix the extension first (wrong context, ban by Fail2Ban, bad NAT) before touching routes.

Then place one external call with the CLI open, as shown next. Guessing at settings in the GUI is slower than reading one log.

How do I watch the failing call on the Asterisk CLI?

Open the console, raise verbosity, enable SIP tracing, dial the external number from the phone, and read from the top. The last line that executed tells you which layer failed.

  1. Run asterisk -rvvvvv (or asterisk -r, then core set verbose 5).
  2. Run pjsip set logger on so the INVITE to the provider and its response are printed. On chan_sip use sip set debug on.
  3. Dial the number once and note the dialed digits exactly as the phone sent them.
  4. Find the line starting with Executing [NUMBER@from-internal:1] and read what follows it.
# Healthy: route matched, trunk dialed
Executing [15551234567@from-internal:1] Macro("PJSIP/200-0000012", "user-callerid,SKIPTTL,")
Executing [15551234567@outrt-1:1] Macro("PJSIP/200-0000012", "dialout-trunk,1,15551234567,,")
Executing [s@macro-dialout-trunk:...] Dial("PJSIP/200-0000012", "PJSIP/15551234567@mytrunk,300,")

# No route matched: never enters an outrt-N context
Executing [915551234567@from-internal:1] ... 
Executing [i@from-internal:1] Playback("...", "invalid")

# Route matched but no usable trunk
Executing [s@macro-outisbusy:1] Playback("...", "all-circuits-busy-now")
Executing [s@macro-outisbusy:2] Congestion("...", "20")
Tip: Exact macro and Gosub names vary between FreePBX versions. The pattern to look for is stable: from-internal, then an outrt-N context, then a dial-out step toward a trunk.

Why are my outbound route dial patterns not matching?

If the log never enters an outrt-N context, no pattern matched the digits as the phone sent them. The usual culprit is a mismatch between what is dialed and what the pattern expects, such as a leading 9 that is not stripped, or 10 digits dialed against an 11-digit pattern.

In each pattern row, FreePBX evaluates prefix, match pattern and prepend in order: the prefix is removed from the dialed digits, the remainder must match the pattern, then the prepend is added before the number goes to the trunk. A caller ID field restricts the row to a given extension CID.

Pattern characters: X is 0-9, Z is 1-9, N is 2-9, [1-9] is a custom set, . matches one or more of any digit (so 00. needs at least one digit after 00), and ! matches zero or more. The Dial Patterns Wizards dropdown on the route's Dial Patterns tab inserts common sets, which is a safe way to avoid typos.

Numbering planPrefixMatch patternPrependDialed / sent
US/Canada, 10 digits, trunk wants 11NXXNXXXXXX15551234567 becomes 15551234567
US/Canada with 9 for outside line9NXXNXXXXXX195551234567 becomes 15551234567
US/Canada, provider requires E.164NXXNXXXXXX+15551234567 becomes +15551234567
US/Canada, 11 digits dialed1NXXNXXXXXX+15551234567 becomes +15551234567
UK national (0 trunk prefix)0ZXXXXXXXXX+4402079460000 becomes +442079460000
International, 00 prefix (UK/EU)00.+0033123456789 becomes +33123456789
International, US 011011.+01133123456789 becomes +33123456789
Warning: Keep emergency numbers (911, 999, 112) in their own route with an Emergency CID and a working trunk. Never let a broad pattern like . swallow them while you test.

How do route order and trunk sequence cause all circuits busy?

The first outbound route whose pattern matches wins, and the Outbound Routes list order is the evaluation order. A catch-all route with pattern . that points at a dead trunk, placed above your working routes, will answer every call with congestion. Move the specific routes above it, or fix its trunk.

Inside a matched route, Trunk Sequence for Matched Routes must list at least one enabled trunk. An empty sequence, or a trunk with Disable this trunk ticked, leaves nothing to dial, and the log goes straight to macro-outisbusy: Playback all-circuits-busy-now, then Congestion. The caller hears fast busy immediately, with no INVITE visible in pjsip logger.

If a route has a failover trunk, FreePBX tries the next trunk only on congestion or channel-unavailable results, not on a normal SIP rejection such as 403 or 404 that the first provider returned deliberately.

Inspect what the dialplan really contains instead of trusting the GUI. These commands only read the dialplan and place no call:

asterisk -rx 'dialplan show outbound-allroutes'
asterisk -rx 'dialplan show outrt-1'
asterisk -rx 'dialplan show from-internal' | grep -i outbound

# After any GUI change
fwconsole reload
Tip: If the dialplan output lacks your new pattern, the change was never applied. Click the red Apply Config button or run fwconsole reload, then check again.

How do I check that the trunk is up and accepts the call?

A trunk can look configured and still be unusable. Check its state, then prove the path with a call that bypasses the phone and the routes.

  1. Run pjsip show registrations. A registering trunk should show Registered; Rejected or Unregistered points to wrong credentials, wrong server, or a blocked IP.
  2. Run pjsip show endpoints and pjsip show aors. An AOR contact showing Unavail with qualify enabled means Asterisk's OPTIONS pings fail, and calls to it return congestion at once. On chan_sip use sip show peers and look for UNREACHABLE.
  3. Originate a call straight to the trunk with the command below. If it connects, the trunk works and the fault is in the route, permissions or the number format your route sends.
  4. Run fail2ban-client status and then fail2ban-client status asterisk. If the provider or phone IP is banned, unban it with fail2ban-client set asterisk unbanip IP.
asterisk -rx 'pjsip show registrations'
asterisk -rx 'pjsip show aors'
asterisk -rx 'pjsip show endpoint mytrunk'

# Trunk test, independent of phone and routes (places a REAL call)
asterisk -rx 'channel originate PJSIP/15551234567@mytrunk application Playback hello-world'

# Dialplan path test via from-internal (places a REAL call if a trunk matches)
asterisk -rx 'channel originate Local/15551234567@from-internal application Playback hello-world'
Warning: The originate commands place real calls: the destination phone rings and your provider bills the call, including international rates. Use a number you own and never an emergency number.

Which restrictions and carrier rules reject an otherwise valid call?

When the INVITE does leave, the provider's response tells you the cause. In the pjsip logger output, read the first line of the response. Detailed fixes live in the separate articles on SIP 403 Forbidden, SIP 503 Service Unavailable and SIP 488 Not Acceptable Here.

FreePBX-side restrictions can also stop the call before the trunk. A route with a Route Password or PIN Set prompts for a PIN, and a caller who does not enter it is dropped with no obvious error. Intra Company Route and per-extension outbound CID settings can alter the caller ID sent upstream. Where the Class of Service module is installed, it can deny route groups per extension.

EvidenceLikely causeFix
401 or 407 repeated, then failureWrong username or password on the trunkCorrect credentials; check auth_username versus username
403 ForbiddenIP not allowed, outbound calling disabled, or caller ID not a verified numberWhitelist the server IP; set Outbound CID to a verified DID; enable outbound on the account
404 Not Found or 484Number format wrong for the providerAdd prepend such as +1 or +44, or strip a prefix
488 Not Acceptable HereNo shared codec or SRTP mismatchAlign allowed codecs (ulaw/alaw/g729) and encryption settings
402, 403 or 603 right after dialingBalance exhausted or destination blocked (international)Top up; ask provider to enable the destination
503 Service UnavailableProvider down, or channel limit reached (Maximum Channels)Check provider status; raise or correct Maximum Channels

Which symptom points to which layer?

Use the symptom and the CLI evidence together. Timing matters: an instant failure means Asterisk decided locally, while a delayed one means it waited on the network or provider.

SymptomLayerCLI evidenceFix
Instant fast busyTrunk missing or unavailableoutisbusy then Congestion, no INVITEAdd or enable a trunk in the route's sequence; fix Unavail AOR
Invalid or not-in-service messageNo pattern matchedLands in i@from-internal, no outrt-NFix prefix, match pattern, prepend; Apply Config
Wrong trunk usedRoute orderDifferent outrt-N than expectedReorder Outbound Routes; narrow broad patterns
Silence or ringback for about 30 seconds, then the call failsProvider unreachable or firewallINVITE retransmits, no responseCheck outbound firewall, DNS, Fail2Ban, NAT settings
Silence or PIN prompt then dropRoute password or PIN setAuthenticate step in the routeRemove the PIN or give users the right PIN set
Rings, then drops within secondsProvider rejection or media failure403, 404 or 488 in logger; BYE shortly after answerFix CID, number format, codecs, or external media address

Common questions

Why do I hear a fast busy only when dialing external numbers?

Internal calls stay in from-internal and never need a trunk, while external calls require a route and a usable trunk. A fast busy within a second usually means the route matched but the trunk is disabled, missing from the sequence, or shows Unavail. Check pjsip show aors and the route's Trunk Sequence.

Does a failed outbound route affect incoming calls?

Normally not, because inbound calls use Inbound Routes and the trunk's registration. But a Fail2Ban or firewall block on the provider's IP can break both directions. Compare pjsip show registrations with fail2ban-client status asterisk.

How can I test a dial pattern without calling anyone?

Read the patterns instead of dialing: run dialplan show outbound-allroutes or dialplan show outrt-1 and check by eye whether a pattern such as _NXXNXXXXXX fits your digits. Do not treat channel originate Local/NUMBER@from-internal application Playback hello-world as a dry run, because it rings a real line and your provider bills the call if any trunk matches. Use it only with a number you own.

Why did my route change not take effect?

FreePBX writes configuration to the database first and only regenerates the dialplan on Apply Config. Click the red button or run fwconsole reload, then confirm with dialplan show outbound-allroutes.

Should I use E.164 numbers on every trunk?

Only if the provider accepts or requires it. Many US providers accept 10 or 11 digits, while others need +1. Send exactly the format the provider documents, and use the prepend field so users can keep dialing locally.

Related topics:freepbxasteriskoutbound routessip trunktroubleshooting