Asterisk automatic dialing
Sometimes, you may need asterisk to call somebody and play any kind of application or run a dialplan extension.
Asterisk call files can be use here. You need to create a call file (which is a clear text file) and move it in /var/spool/asterisk/outgoing/ directory. A thread on the asterisk server will check for new files there and process them.
The file contains keys and values seperated by a ‘:’ character on each line. Here are the accepted parameters:
- Specify where and how to call
- Channel: <channel>: Channel to use for the outbound call
- CallerID: Name <number> Caller ID, please note that it may not work if you do not respect the format: CallerID: Some Name <1234>
- MaxRetries: <number> Number of retries before failing (not including the initial attempt, e.g. 0 = total of 1 attempt to make the call)
- RetryTime: <number> Seconds between retries, don’t hammer an unavailable phone
- WaitTime: <number> Seconds to wait for an answer
- Account: Set the account code to use.
- If the call answers, connect it here
- Context: <context-name> Context in extensions.conf
- Extension: <ext> Extension definition in extensions.conf
- Priority: <priority> Priority of extension to start with
- Set: Set a variable for use in the extension logic (example: file1=/tmp/to ); in Asterisk 1.0.x use ‘SetVar’ instead of ‘Set’
- Application: Asterisk Application to run (use instead of specifiying context, extension and priority)
- Data: The options to be passed to application
- New (?) in Asterisk 1.4
- Set: Can now also write to dialplan functions like CDR()
- AlwaysDelete: Yes/No - If the file’s modification time is in the future, the call file will not be deleted
- Archive: Yes/No - Move to subdir “outgoing_done” with “Status: value”, where value can be Completed, Expired or Failed.
Example :
If you want to call the number 5140000000 through channel Zap/g1 and play welcome prompt when answered, your call file will look like :
Channel: Zap/g1/5140000000
CallerID: Ruddy Micnes <5143161470>
WaitTime: 30
Application: Playback
Data: welcome
Comments
Leave a Reply