100 Outgoing Calls – 10 At A Time – /var/spool/asterisk/outgoing/

Home » Asterisk Users » 100 Outgoing Calls – 10 At A Time – /var/spool/asterisk/outgoing/
Asterisk Users 9 Comments

Hi,

Is there a way to move 100 .call files in to
/var/spool/asterisk/outgoing/ at once and have Asterisk call at maximum 10 at a time?

The maxcalls setting in asterisk.conf will limit the number of calls but not gracefully. The calls over 10 just fail. I need to queue them up.

I can certainly write a program to limit the number of simultaneous outgoing calls but before I do that I thought I would ask if there is another solution.

Thanks in advance.

Rock on, PLA

Patrick L Archibald http://PatrickArchibald.com

9 thoughts on - 100 Outgoing Calls – 10 At A Time – /var/spool/asterisk/outgoing/

  • Afaik that is not possible. Wouldn’t it make more sense to move call files in batches of 10 to outgoing/?

    Regards, Patrick

  • I agree. A script that read the spool directory, sent enough files to equal
    10, wait a few seconds, check again and move more would do the trick.

    – Logan

  • Yes: Move them in batches of 10. Could be as simple as last if ++$n_files > 9;
    if the script is in Perl.

    You know how many calls you can deal with at once; it’s up to you to stay within your own limits. Asterisk just tries its damnedest to do whatever it’s been told, without imposing any sort of judgement as to whether it’s sane or wholesome.

  • Generally the preferred method when you’re doing this programatically anyways is to use an external script through the Asterisk Manager Interface to generate your calls.

    Luckily, Russell Bryant has recently create an amioriginate.py[0] script which he’s using as an example in the upcoming Asterisk: The Definitive Guide 4e book.

    [0] https://github.com/russellb/amiutils

  • Hi Leif,

    I am happy to hear that a new release of The Book is in the works!

    I will have a look at Russell’s script as soon as I am back at my work chair: there is however something I am very curious about: it is how you ask Asterisk, over AMI, to launch an external command, script, etc.

    I was (falsely) assuming that you need a channel to launch a script upon..

    To be able to trigger ‘commands’ over AMI, before any channel exists, opens immense possibilities!!

    TIA, Aldo

    Sent from my iPhone

  • That’s good! I’d hate to be working on something no one wanted 🙂

    Oh heck ya. You can start up an Asterisk instance and just start doing things with it via your programs. That’s the immense power of AMI; it’s essentially the Asterisk API.

  • ;-)))

    Yes, I know…

    I have been writing an Objective-C library to control Asterisk over AMI, but I did not see the event that you need to send to just trigger a script, say, to read the log files and get the last calls, or anything similar.

    I can originate calls with an AMI Originate command and some dialplan glue, but I am missing anything like an Exec AMI command.

    TIA, Aldo

    Sent from my iPhone

  • Thanks everyone for the guidance on my outgoing call question.

    And I’m looking forward to Asterisk: The Definitive Guide 4e book too!

    Thanks, PLA

  • The problem I see with this approach is that you usually do not “just” want to dial out 10 calls at a time, but you will want to keep track of what happened to them and (in case) reschedule them. So you will likely need to monitor them over AMI to make sure they went through, and you need to implement some rescheduling logic.

    [Shameless plug starts here]
    This was the reason why we started working on Wombat a while ago – to offer something that would handle all this (and more) but leaving you the
    “Asterisk touch” of being free to program the call handling at the dialplan level, so you would get the best of both worlds. Did I already mention the current beta versions are free? 🙂
    [Shameless plug ends here]

    I am not saying that this is the only correct solution (or it is a correct solution at all) but our almost ten years of Asterisk call-center experience show that what starts out as something quick and simple to plug a hole ends up being a platform 🙂

    Just my two Swiss cents, l.

    2012/9/28 A J Stiles