Asterisk Call Recording: Call (Latest Versions)
Updated guide for modern Asterisk (PJSIP era): call files with real configs, common mistakes, and troubleshooting steps.
Call files are one of the oldest yet most powerful outbound dialing mechanisms available in Asterisk.
Long before predictive dialers and REST APIs existed, Asterisk could automatically place calls simply by dropping a specially formatted file into a directory.
Even in modern architectures, call files remain extremely useful for:
- scheduled outbound calling
- bulk notification systems
- retry queues and failover dialing
- simple integrations without AMI/ARI coding
- high-reliability background call triggering
Understanding call files is essential for engineers building autodialers, campaign schedulers, or telecom automation platforms.
How Call Files Work Internally
Asterisk continuously monitors a special directory:
/var/spool/asterisk/outgoing/
When a correctly formatted file appears in this folder:
- Asterisk reads the file instantly
- Parses dialing instructions
- Creates a new outbound channel
- Executes the requested dialplan or application
This mechanism works even if:
- no user is logged into CLI
- no external API is running
- the trigger is created by cron, script, or another system
Basic Call File Structure
A minimal outbound call file looks like:
Channel: PJSIP/provider-endpoint/9876543210
Context: outbound
Extension: 9876543210
Priority: 1
Callerid: 1800123456
Timeout: 60
Key fields explained:
- Channel → which trunk/endpoint to use
- Context/Extension/Priority → dialplan entry point
- Callerid → outbound CLI
- Timeout → max ringing duration in seconds
Safe Way to Create Call Files (Important)
Never write files directly into the outgoing directory. Instead:
- Create file in a temporary folder
- Set correct ownership and permissions
- Move it into
outgoing/
Example:
nano /tmp/test.call
mv /tmp/test.call /var/spool/asterisk/outgoing/
Reason: Asterisk may read incomplete files if written directly.
Correct Permissions for Call Files
chown asterisk:asterisk /tmp/test.call
chmod 640 /tmp/test.call
Wrong permissions cause:
- call file ignored silently
- no error in CLI
Example: Triggering an IVR Call Automatically
Channel: PJSIP/provider-endpoint/9876543210
Context: ivr-campaign
Extension: s
Priority: 1
Callerid: 1800123456
MaxRetries: 2
RetryTime: 300
WaitTime: 45
Additional retry parameters allow:
- automatic redial if customer does not answer
- controlled retry intervals
- limited retry count for compliance
Scheduling Calls Using Call Files
Call files support delayed execution using file timestamp.
touch -t 202602151230 /tmp/scheduled.call
When moved to outgoing:
- Asterisk waits until timestamp time
- Then places the call automatically
This enables:
- appointment reminders
- payment alerts
- campaign scheduling without cron logic
How Autodialers Use Call Files in Production
Large outbound systems often:
- generate thousands of call files from database queues
- throttle file movement into outgoing/
- track completion via CDR or AMI events
This makes call files a simple yet extremely scalable outbound triggering mechanism.
Common Real-World Problems with Call Files
1. Call Never Starts
- cause → wrong permissions or ownership
- fix → ensure asterisk user owns file
2. Call Starts Immediately Instead of Scheduled
- cause → timestamp not set before moving
3. Calls Fail with Channel Error
- cause → wrong endpoint or trunk name
4. Too Many Concurrent Calls
- cause → dumping many files at once
- fix → rate-limit file movement
Debugging Call File Execution
Watch logs while placing a call file:
asterisk -rvvv
tail -f /var/log/asterisk/full
You should see:
- call file detected
- channel creation
- dialplan execution
Security Considerations
- restrict write access to outgoing directory
- validate numbers before generating files
- prevent abuse that could trigger mass calling
Unauthorized call file creation can lead to fraud or telecom billing loss.
Call Files vs AMI vs ARI
- Call Files → simplest, file-based, highly reliable
- AMI Originate → real-time control, event tracking
- ARI → full application-level call orchestration
Modern platforms (like MYLINEHUB) often combine:
- database scheduling
- AMI/ARI orchestration
- fallback call files for reliability
Production Checklist
- temporary file creation before move
- correct ownership and permissions
- retry and timeout logic configured
- rate-limit concurrent calls
- monitor logs and CDR completion
Key Takeaway
Call files remain one of the most stable and scalable outbound dialing mechanisms in Asterisk.
While modern systems use APIs and AI orchestration, call files still provide a simple, reliable foundation for telecom automation.
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.