Posted on Friday, 9th July 2010 by Michael
Simple Asterisk Auto Dialer
What is it:
This simple shell script was created by Michael LaSalvia of Digital Offensive to auto dial numbers and plays back a message to the person that picks up the phone. This script will take a comma separated file (CSV) that is setup as follows:
Number,Sound,Trunk_Name
And automate the dialing and playing of that sound / message. The sound can be in the standard gsm format or an mp3 file. This is useful for automating phone campaigns or just having a good time messing with friends.
How it works:
This script takes advantage of the Asterisk outgoing spool directory. The script creates a “call” file using the variables that you provided in the csv file as well as the variables you set in the script. The file is then moved into the /var/sppol/asterisk/outgoing directory where asterisk will process the “call” file and place the call.
The CSV file:
The CSV file is setup with three columns number, sound and trunk_name
The telephone number must not contain any – and must be the full 10 digit number for local and long distance calls. This may vary based on your dial plan.
To play custom sounds / messages you will need to create them and upload them to /var/lib/asterisk/sounds. Make sure that all the files you upload there that you chown them to asterisk.asterisk if your PBX is running as asterisk. When adding the sound to play in the CSV file do not add the extension just define the exact name.
To allow you to use different trunks to place your calls we added a column to define your trunks. If you only have one trunk then use that trunks name on each line
The CSV should look like this:
7175551111,campaign1,trunk1
7174442222,campaingn2,trunk2
And so on….
The shell script variables:
If you are not sure what you are doing please leave all the settings here along except nFile and nTrunk.
- sounds: this variable defines the path to the asterisk sounds. You must upload your custom sounds /messages to this directory for them to play.
- rOut: this variable defines the path to the asterisk outgoing spool directory.
- rUser: this variable defines the user as asterisk.
- rGroup: this variable defines the group as asterisk.
- nFile: this variable defines the path and file name of your CSV file. You need to upload that file to a readable spot on your PBX.
- rtry: this variable defines the max time to wait between trying to call a user back.
- mtry: this variable defines the max number of times to try to call someone back.
- stime: this variable defines the time to wait before calling the next number. This will help avoid congestion.
What is needed:
- You will need an Asterisk based PBX.
- You will need to have an account that has the ability to access required directories and files. Preferably root.
- You will need to modify the /etc/asterisk/modules.conf file and add the line “load pbx_spool.so”
- You will need to have a copy of our script which can be downloaded here: http://www.digitaloffensive.com/files
- You will need a client to upload your sound / message files to the server with as well as your CSV file.
How to run:
To run this script you will need to either manually execute it daily or schedule it via cron.
Current issues:
Since I do not have access to the do not call lists database I cannot add the functionality to check your CSV file against the do not call list. With that being stated I do not take any responsibility for your actions with this script.
Posted in Code | Comments (9)
July 9th, 2010 at 11:49 pm
[...] This post was mentioned on Twitter by VoIP Hub. VoIP Hub said: Digital Offensive » Blog Archive » Simple Asterisk Auto Dialer http://bit.ly/ajDfuA [...]
August 11th, 2010 at 1:59 pm
Hi Michael
This is excellent but could do with speaking to you when you’re free, drop me a line @ sam.watson@coverdaleandpartners.co.uk when you get a chance
cheers
September 3rd, 2010 at 8:13 pm
[...] via Digital Offensive » Blog Archive » Simple Asterisk Auto Dialer. [...]
September 9th, 2010 at 12:17 pm
If I have 10 phone lines, can it dial ALL 10 at the SAME TIME with the SAME MESSAGE?
1111111111,sound1,trunk1
2222222222,sound1,trunk2
3333333333,sound1,trunk3
Would that make it call all three numbers at the very same time???
September 9th, 2010 at 12:34 pm
You would need to create a ring group and put all the numbers you want it to call in that group. Then I think it will work I have not tested this. The timing may be a few seconds off but should be close.
July 5th, 2011 at 6:00 am
The script it awesome.
But it is not entering the data in CDR table.
Any Solution for that??
July 18th, 2011 at 12:47 pm
The solution is to hire us to do it or do it yourself. This is a simple free script.
August 9th, 2011 at 8:58 pm
Michael,
I got it worked out. Script is working great. Thanks again for the post.
Martin
September 8th, 2011 at 8:12 am
I got data into cdr table..thanx michael..