Automatic Dialer With Asterisk And GNUDialer - Page 2
MySQLNow, we have to create the database: mysqladmin –u root –p create dialer We will be prompted for a password, enter the same password from the installation, this server should not be public, hence disabling the root user is not mandatory (but equally recommended), if you want to disable it, you can follow these steps: mysql -u root -p
AsteriskNow, we have to patch and install our Asterisk sources. If you already have am asterisk server in place, make sure you have the correct sources.
cd /usr/src Aplying the patches: cd /usr/src/gnudialer If you are using asterisk 1.2.x you need to replace the file previous for manager.c.both-patches.txt. When asked for a file to patch, write /usr/src/asterisk-1.4.24.1/main/manager.c If you are using Asterisk 1.2.x: patch -p1 < channel.c.hangup_callerid_ast12.diff When asked for a file to patch, write /usr/src/asterisk-1.2.x/main/channel.cIf you are using Asterisk 1.4.x: wget http://dynx.net/ASTERISK/gnudialer/channel.c.hangup.1418.diff.txt When asked for a file to patch, write /usr/src/asterisk-1.4.24.1/main/channel.c Now, we can compile asterisk, if you have not succesfully applied the patches, the GNUDialer will not work.
cd .. We now test our asterisk, it should say "Asterisk Ready", then we escape with CTRL+C asterisk -vvvvvvvc Start it withasterisk AstCRM 1.1.6AstCRM is the web frontend for the agent, is written in Java and is where the Agent logins so he can start receiving calls.
mkdir /var/www/cgi-bin [...] DOCROOT=/var/www/html/ [...] and leave as [...] DOCROOT=/var/www/ [...] Open the file get.h and under #include <string> add #include <cstdlib>. #include <iostream> #include <string> #include <cstdlib> Same for submitinfo.cpp and under #include <string> add #include <cstdlib>. #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <vector> #include <signal.h> #include <sys/time.h> #include <mysql.h> #include "cam2closer.h" Now, compile and install: make Open the file /var/www/cgi-bin/astcrm.conf and configure: leave-this root # If you change it, put the real MySQL username 1234 # The password from the install localhost # The database host dialer # The database
GNUDialer Puff r181Once we have all the requirements in place and working, we can install the dialer. First we add the dialer contexts to Asterisk:
cp /usr/src/gnudialer/dialer.conf.14 /etc/asterisk/dialer.conf Now, we have to open /etc/asterisk/manager.conf and make sure it looks like this (back up before saving): [general] displaysystemname = yes enabled = yes port = 5038 bindaddr = 0.0.0.0 displayconnects = yes timestampevents = yes [dialer] secret = 1234 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user permit=0.0.0.0/0.0.0.0 [crm] secret = 1234 read = call,agent,user write = call,agent,user permit=0.0.0.0/0.0.0.0 Open the file /etc/gnudialer.conf and configure: 1234 # GNUDialer admin Password root # If you change it, put the real MySQL username 1234 # The password from the install localhost # The database host dialer # The database name dialer # The username from manager.conf 1234 # The secret from manager.conf localhost # host of the asterisk (yes, we can control remote machines) 5038 # The manager port cd /usr/src/gnudialer Look for [...] DOCROOT=/var/www/html/ [...] and leave as [...] DOCROOT=/var/www/ [...] We now have to add some stuff to the source code, this is because (I think) the different gcc versions used in the debugging process. Open dialeradmin.cpp and leave it like this: #include <iostream> #include <sstream> #include <string> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <fstream> #include <mysql.h> #include <time.h> #include "post.h" #include "queue.h" #include "agent.h" #include "adminwork.h" #include "settings.h" #include "itos.h" #include "stoi.h" #include "log.h" #include "dispo.h" #include "abnhelper.h" //#include "etcinfo.h" Then, around line 36 of the same file, look for: static char *dispo2short(int dispo); static char *dispo2long(int dispo); and replace with const char *dispo2short(int dispo); const char *dispo2long(int dispo); Open the file dispo.h, and around line 76 look for static char *dispo2short(int dispo); and replace with const char *dispo2short(int dispo); Again around line 87 look for static char *dispo2long(int dispo); and replace for const char *dispo2long(int dispo); Open log.h and modify it: #include <iostream> #include <fstream> #include <stdio.h> #include <mysql.h> #include <stdlib.h> #include <algorithm> Open queue.h and modify it: #include <string> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <vector> #include <iterator> #include <iostream> #include <fstream> #include <sstream> #include <unistd.h> #include <time.h> #include "agent.h" #include "call.h" #include "abnhelper.h" #include "exceptions.h" Open stoi.h and modify it: #include <string> #include <sstream> #include <stdio.h> #include <stdlib.h> #include <algorithm> Now, we can compile and install:
make Now, you can test the installation by executing: gnudialer --no-daemon If you see d1:/usr/src/gnudialer# gnudialer --no-daemon Then you are all set, you have a working automatic dialer. The last thing to do is configure Apache so you can execute the proper cgi scripts. Open /etc/apache2/sites-enabled/000-default and look for ScriptAlias and change it accordingly: ScriptAlias /cgi-bin/ /var/www/cgi-bin/ <Directory "/var/www/cgi-bin"> Finally, restart Apache: /etc/init.d/apache2 restart and using your web browser go to http://your_machine/gnudialer/dialerlogin.html log in by entering the string from the first line of /etc/gnudialer.conf as it is your gnudialer admin password. That's it! There is a lot of documentation on how to use the dialer in the many README files from the sources and in the forums. GNUDialer is licensed under the GNU/GPL license written by Heath Schultz, Richard Lyman and Jamerson Medley. This how to was originally written in Spanish by Mario Hernández and it is available in http://bleh.spooky.cl/2009/05/discadores-automaticos-con-gnudialer.html
|

![Creative Commons Attribution License [Creative Commons Attribution License]](http://creativecommons.org/images/public/somerights20.gif)


Recent comments
16 hours 7 min ago
16 hours 13 min ago
21 hours 11 min ago
1 day 3 hours ago
1 day 4 hours ago
1 day 5 hours ago
1 day 10 hours ago
1 day 16 hours ago
1 day 20 hours ago
1 day 22 hours ago