Discussion:
[asterisk-users] 100 outgoing calls - 10 at a time - /var/spool/asterisk/outgoing/
Patrick Archibald
2012-09-28 01:01:49 UTC
Permalink
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
Patrick Lists
2012-09-28 04:27:30 UTC
Permalink
Post by Patrick Archibald
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?
Afaik that is not possible. Wouldn't it make more sense to move call
files in batches of 10 to outgoing/?

Regards,
Patrick
Logan Bibby
2012-09-28 04:32:09 UTC
Permalink
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
Post by Patrick Archibald
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?
Afaik that is not possible. Wouldn't it make more sense to move call files
in batches of 10 to outgoing/?
Regards,
Patrick
--
______________________________**______________________________**_________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
http://www.asterisk.org/hello
asterisk-users mailing list
http://lists.digium.com/**mailman/listinfo/asterisk-**users<http://lists.digium.com/mailman/listinfo/asterisk-users>
A J Stiles
2012-09-28 08:10:45 UTC
Permalink
Post by Patrick Archibald
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?
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.
--
AJS

Answers come *after* questions.
Lenz Emilitri
2012-10-03 09:41:45 UTC
Permalink
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.
Post by A J Stiles
Post by Patrick Archibald
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?
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.
--
Loway - home of QueueMetrics - http://queuemetrics.com
Test-drive WombatDialer beta @ http://wombatdialer.com
Leif Madsen
2012-09-28 11:27:05 UTC
Permalink
Post by Patrick Archibald
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?
<snip>
Post by Patrick Archibald
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.
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
--
Leif Madsen
http://www.oreilly.com/catalog/asterisk
Aldo Bergamini
2012-09-28 12:11:37 UTC
Permalink
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
--
Leif Madsen
http://www.oreilly.com/catalog/asterisk
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
Leif Madsen
2012-09-28 12:24:39 UTC
Permalink
Post by Aldo Bergamini
I am happy to hear that a new release of The Book is in the works!
That's good! I'd hate to be working on something no one wanted :)
Post by Aldo Bergamini
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!!
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.
--
Leif Madsen
http://www.oreilly.com/catalog/asterisk
Aldo Bergamini
2012-09-28 12:43:56 UTC
Permalink
Post by Leif Madsen
That's good! I'd hate to be working on something no one wanted :)
;-)))
Post by Leif Madsen
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.
Post by Leif Madsen
--
Leif Madsen
http://www.oreilly.com/catalog/asterisk
TIA,
Aldo



Sent from my iPhone
Patrick Archibald
2012-09-28 15:40:52 UTC
Permalink
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
Loading...