[Freeswitch-users] script for generating bulk calls

David Villasmil david.villasmil.work at gmail.com
Mon Aug 13 19:11:01 MSD 2012


Maybe you can use this one as a start:

It uses a MySQL table (below) to dial out numbers and parking them for the
time specified in the table.
All you need to do is originate in background not waiting for the result...


#!/usr/bin/perl

use DBI;
require ESL;


MysqlConnect();

my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");
my $mydomain = "myserverIP"

my $sql_numbers = "select * from test_numbers where enabled = 1;";
my $sth_numbers = $db->prepare($sql_numbers);

if (!$sth_numbers->execute()){
     print "Could NOT execute!\n$sql_numbers\n";
}else{
     if(($rows_numbers = $sth_numbers->rows)>0){
          while (my $ref_numbers = $sth_numbers->fetchrow_hashref() ) {

               my $dialstr = "{execute_on_answer='sched_hangup +" .
$$ref_numbers{'len_park'} . " alloted_timeout',originate_retries=" .
$$ref_numbers{'tries'} . ",originate_retry_sleep_ms=1000}sofia/internal/" .
$$ref_numbers{'number'} . "%" . $mydomain . " &park()";
               print "DIALSTR: $dialstr \n";

               my $e = $con->api("originate", $dialstr);
               print $e->getBody();
               my $uuid = $e->getBody();

               SetVar($uuid,"customer_company","DIALER");
          }
     }
}

print "\n";
exit 0;


sub SetVar($$$){
     my $uuid = shift;
     my $var = shift;
     my $val = shift;
     do_api("uuid_setvar", $uuid . " " . $var . " " . $val);
     return;
}



sub do_api($$) {
     my $cmd = shift;
     my $args = shift;
     print "CMD : <$cmd>\nARGS: <$args>\n";
     my $e = $con->api($cmd, $args);
     if ($e) {
          print STDERR $e->getBody() . "\n";
     }
     return;
}

sub MysqlConnect(){
        $db = DBI->connect('DBI:mysql:dialer:127.0.0.1','root','password');
        $db->{mysql_auto_reconnect} = 1;
        if ($db<=0){
            print "Error connecting to data server!!!\n" if $debug;
            exit;
        }
}

sub fsLog($){
     my $msg = shift;
     $con->api("log", "WARNING " . $msg);
}



################################################################################
#
#          CREATE TABLE `test_numbers` (
#               `id` int(11) NOT NULL auto_increment,
#               `number` varchar(25) NOT NULL,
#               `tries` int(11) NOT NULL,
#               `len_park` int(11) NOT NULL,
#               `enabled` int(11) NOT NULL,
#               PRIMARY KEY  (`id`)
#          ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
#
################################################################################



Good luck.

David

On Mon, Aug 13, 2012 at 4:54 PM, BookBag <asaad2 at gmail.com> wrote:

> yeah I see your dillemma, I dont know if vbilling allows you to get to
> fs_cli , if if it does then you can just enter a whole bunch of originate
> statements. you can probably use excel to create a massive csv file then
> copy and paste that into fs_cli which will then call the range of phone
> numbers you need.
>
>
> On Mon, Aug 13, 2012 at 9:50 AM, BookBag <asaad2 at gmail.com> wrote:
>
>> no, mine was a set amount of numbers that were already know and they
>> played a wav file, also my provider only handled 2 concurrent channels at a
>> time. so it would dial 2 numbers at time. Thats why fusionpbx was such a
>> help because it allowed me to do that and all I had to do was cut and paste
>> the numbers I was going to call.
>>
>>
>> On Mon, Aug 13, 2012 at 7:33 AM, Jakub Tencl <info at pripojtese.net> wrote:
>>
>>>  The requests is from 10 to 50 concurent calls with specify call
>>> duration and to specify range of the numbers, if this is what do you have,
>>> kind of similar thing, can you afford it for some conditions please?
>>>
>>> Thanks
>>>
>>> Jakub Tencl
>>>
>>> Dne 11/08/2012 02:43, Brian Foster napsal(a):
>>>
>>> Newfies Dialer or have it contracted out. We've done something similar
>>> here.
>>>
>>> Brian Foster
>>> Endigo Computer LLC
>>>
>>> Sent from a mobile device.
>>> On Aug 10, 2012 5:45 PM, "Jakub Tencl" <info at pripojtese.net> wrote:
>>>
>>>>
>>>>
>>>> Hello,
>>>>
>>>> i am quite new with freeswitch. Can anybody tell me if Freeswitch has
>>>> module for generating bulk calls and if not can you afford some template
>>>> script for it or just some pointers where i have to go?
>>>>
>>>> Thank you
>>>>
>>>> Best Regards
>>>>
>>>> Jakub
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> 
>>>> 
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://wiki.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>
>>> --
>>> This message has been scanned for viruses and
>>> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and
>>> is
>>> believed to be clean.
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>>>
>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>>>
>>> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
>>>
>>> Join Us At ClueCon - Aug 7-9, 2012
>>>
>>> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>>>
>>>
>>>
>>> --
>>>
>>> Kind Regards
>>>
>>> Jakub Tencl
>>>
>>> *Mobil:* +44 770 4734 834 or +420 774 430 010| *ICQ:* 262823686 | *
>>> Skype:* spycat108
>>>
>>> This message and any attachment are confidential and may be privileged
>>> or  otherwise protected from disclosure. If you are not the intended
>>> recipient,please telephone or email the sender and delete this message and
>>> any  attachment from your system. If you are not the intended recipient
>>> you  must not copy this message or attachment or disclose the contents to
>>> any other  person.
>>>
>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> Join Us At ClueCon - Aug 7-9, 2012
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120813/cd354f37/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 22265 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120813/cd354f37/attachment-0001.jpe 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list