What is the best way to campaign dial 5000 numbers? Spool files or AMI actions?

Home » Asterisk Users » What is the best way to campaign dial 5000 numbers? Spool files or AMI actions?
Asterisk Users 6 Comments

Hi everyone,

Using Asterisk 1.6x here with a TDM PRI. I have to run a campaign for about
5000 numbers and then put the call to agents right away and pull up the CRM
based on the number dialed. So, I am going to be doing some PHP+Ajax work.
I am familiar with spool files but I don’t like the fact that I can’t read
the status of the call in real-time. However, I know that it’s the easiest
way to approach the issue.

Are there any benefits to one or the other method? Or what is the best way
to do something like this now-a-days? I may even be able to install
Asterisk 1.8x for this purpose if it makes my job easier.

Any input is greatly appreciated.


6 thoughts on - What is the best way to campaign dial 5000 numbers? Spool files or AMI actions?

  • The way to call 5000 numbers is to call one number, really well. Then
    you put it in a loop. You need to run a lab for long enough that you
    have the bugs worked out, before you subject real people to problems.

    With asterisk you can always tell the real-time status of a call, even
    if you initiate from a call file. Perhaps you would enjoy reading up
    on Local channels. Some people prefer to initiate calls from AMI. I
    tried it and didn’t like it.

    But because most of us have been annoyed by an autodialer in our
    lives, even if we ourselves have made autodialers in the past, this is
    probably about the limit of the help you’re going to get, unless you
    ask a more specific question that shows you’ve been trying to learn
    this hands-on and you’ve gotten stuck on a particular problem.

  • Thanks for the input but using spool files or AMI or AGI is way different
    from each other and that is what I want to get an input on. I do have hands
    on with all methods like I noted but want to know what the trend is
    now-a-days and what is more robust and proven out of all three.


  • Sammy,

    Would you care to elaborate please. Have you had experience doing such a
    campaign using AMI? Maybe you can share of the code.

    Most appreciated,

  • Yes why not,
    I made an aut-odialer (the code I can share on my blogpost in couple of
    days for you.) The basic structure of the script/code was to:

    1- Start, connect to DB, fetch campaign data
    2- Fetch numbers to dial from campaign, If no numbers goto step 6
    3- Feed those number in a loop to AMI using a php-AMI helper script (Async
    Event, don’t wait for reply from Asterisk)
    4- Check asterisk if its dialing capacity has reached or not
    5a- If Not, goto step 2
    5b- If Yes, wait for sometime for calls to finish, goto step 4
    6- Close DB,Stop

    So, I had a context that was connecting to MySQL and on each incoming call
    trigger it was pushed with primary keys/identifiers of campaign and
    callednumber. Using those I updated the CDRs/STATUS of that particular
    number if it failed or successfully answered.

    That was all. Obviously there are major advanced features in this script
    which are missing and need time and proper coding expertise to develop..i.e
    multi-campaign mode, aggressiveness of dialer, retrying of failed numbers


  • Hi Sammy,

    Yes, that’s what I have brain-stormed as well. I would very much appreciate
    sharing the code as I can try to improve it. I will put a GUI to it so that
    admin can insert campaign numbers and agents be able to see what percentage
    of the campaign is done.

    Can you share it with me already?