Asterisk Dialplan: Incoming Call Simulation (Latest Versions)
Updated guide for modern Asterisk (PJSIP era): incoming call simulation with real configs, common mistakes, and troubleshooting steps.
Before connecting real SIP trunks or telecom providers, engineers must verify that Asterisk inbound call handling works correctly.
The safest way to do this is by performing an incoming call simulation inside the system. This allows you to test dialplan logic, audio flow, IVR routing, and agent ringing without depending on an external provider.
This guide explains how to simulate inbound calls in modern Asterisk using PJSIP, along with real troubleshooting steps.
Why Incoming Call Simulation Is Important
- Verify dialplan before going live
- Test IVR, queues, and routing safely
- Debug audio and RTP without provider complexity
- Prevent production downtime during setup
Professional telecom deployments always test locally first.
How Real Inbound Calls Normally Arrive
In production:
- SIP provider sends an INVITE to Asterisk
- Asterisk matches the trunk endpoint (PJSIP identify)
- Call enters a dialplan context such as
from-trunk - Dialplan decides IVR, queue, or agent routing
Simulation reproduces this same behavior internally.
Method 1 — Simulate Incoming Call Using Local Extension Dial
The simplest simulation is to create a test extension that jumps into the inbound context.
[from-internal]
exten => 9000,1,Goto(from-trunk,s,1)
same => n,Hangup()
When an internal user dials 9000, the system behaves exactly like a real inbound trunk call.
Create a Basic Inbound Dialplan
[from-trunk]
exten => s,1,Answer()
same => n,Playback(thank-you-for-calling)
same => n,Dial(PJSIP/1001,20)
same => n,Voicemail(1001@default)
same => n,Hangup()
Now dialing 9000 internally simulates:
- External provider call arrival
- Greeting playback
- Agent ringing
- Voicemail fallback
Method 2 — Simulate Using Asterisk CLI Originate Command
Asterisk CLI allows direct call generation:
channel originate PJSIP/1001 extension s@from-trunk
This command:
- Creates a call to extension 1001
- When answered, enters
from-trunkcontext - Runs full inbound dialplan logic
This is extremely useful for automated testing.
Method 3 — Simulate Using Call Files (Production-Style Testing)
Create a call file:
/var/spool/asterisk/outgoing/test.call
Channel: PJSIP/1001
Context: from-trunk
Extension: s
Priority: 1
CallerID: "Test Call" <9999>
When the file is placed in the outgoing directory, Asterisk automatically originates the call.
This method is widely used in:
- Autodialers
- Bulk notification systems
- QA testing environments
How to Verify the Simulation Is Working
Open Asterisk CLI:
asterisk -rvvv
Then confirm:
- Call enters
from-trunkcontext - Playback audio is heard
- Agent extension rings
- Voicemail triggers if unanswered
Common Problems During Incoming Call Testing
No Audio Heard
- RTP or NAT misconfiguration
- Firewall blocking UDP media ports
Call Does Not Reach Dialplan
- Wrong context name
- Typo in extension or priority
Agent Does Not Ring
- PJSIP endpoint not registered
- Wrong Dial() target
Debug tools:
pjsip set logger on
rtp set debug on
dialplan show from-trunk
Production Testing Strategy Used by Experts
- First simulate internally (Goto method)
- Then simulate via CLI originate
- Then test with real SIP trunk
This layered approach prevents live customer failures.
Key Takeaway
Incoming call simulation is a mandatory step before real telecom deployment.
By testing inbound routing internally, you ensure IVR, dialing, audio, and voicemail work perfectly before exposing the system to real customers.
Always simulate first — production reliability depends on it.
Want to see API-driven CRM + Telecom workflows in action? Try the WhatsApp bot or explore the demos.
Comments (0)
Be the first to comment.