How to install AsterCRM and integrate it with external CRM

Steps for install AsterCRM and integrate it with external CRM

1) Download and unzip the source (assuming your WEB root is /var/www/html)

Get the software from

cd /var/www/html


mv astercc-X.X astercc

/var/www/html/astercc/astercrm                 # main directory and PHP scripts of astercrm
/var/www/html/astercc/asterbilling              # main directory and PHP scripts of asterbilling
/var/www/html/astercc/sql                          # sql to create database tables
/var/www/html/astercc/script                      # astercc daemon and some other script files
/var/www/html/astercc/index.html               #guide page
/var/www/html/astercc/astercc_full_logo.png  #logo

2) It is highly advised that the whole script directory be moved to a more secure location like /opt and out of the WEB root directory


mkdir -p /opt/asterisk/scripts/astercc
mv /var/www/html/astercc/scripts/*  /opt/asterisk/scripts/astercc
chmod +x /opt/asterisk/scripts/astercc/*


3) Create the MySQL database and tables, asterCRM need mysql 4.1 or above

Note: here we create the database named astercc, it both used for astercrm and asterbilling, you could use whatever db name you want use your configration to replace “yourmysqluser” and “yourmysqlpasswd”


mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercc
mysql -uyourmysqluser -pyourmysqlpasswd astercc < /var/www/html/astercc/sql/astercc.sql

4) Update /etc/asterisk/manager.conf to enable Manager connections

Note:allow asterisk on different server .Add something like this to the manager.conf file:


enabled = yes
port = 5038
bindaddr =
;displayconnects = yes

;the following line could be changed by yourself
secret = astercc
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
; if you want to run astercc on another server
; use your astercc ip to replace or add a new line


5) Modify config file

for asterCRM:
modity /var/www/html/astercc/astercrm/astercrm.conf.php to fit your configration
for asterCC:
modity /var/www/html/astercc/asterbilling/asterbilling.conf.php to fit your configration

6) Start Asterisk and daemon

There are two daemon modes you can choose, astercc mode or eventsdaemon(can be used for astercrm only) mode.

A) For astercc mode(can be used for both astercrm and asterbilling.

try start astercc:
modify /opt/asterisk/scripts/astercc/astercc.conf to fit your configuration mainly database setting and AMI setting.

run astercc for test




if you could read like following line:


“Connecting to mysql database on
Database connection successful.
Connecting to asterisk on port 5038:
Asterisk socket connection successful.
Check asterisk username & secret:
Monitor Start:
…(some log message)…”

congratulations, your astercc works well, use ‘ctrl + c’ to exit
or else, please check your database/AMI configration in astercc.conf


Start up astercc (default settings):
modify /var/www/html/astercrm/astercrm.conf.php set eventtype to curcdr


/opt/asterisk/scripts/astercc/astercc -d


Start up astercc daemons when system startup:
Note: This option can only fit to redhat-release system. If you want astercc daemons to start automatically when you boot your machine, you need to :


cp /opt/asterisk/scripts/astercc/asterccd /etc/rc.d/init.d
chmod 755 /etc/rc.d/init.d/asterccd
chkconfig –add asterccd


Advice: Configure your astercc restart once everyday, it’s not necessary, but it ‘s good for your astercc operation for install AsterCRM and integrate . for example: you want to restart astercc at 0’clock everyday, just do the following line as root.


crontab -e
add a new line:
0 0 * * * /etc/rc.d/init.d/asterccd restart
the first “0” figures minutes and the second “0” figures hours.


B) For eventsdaemon mode(can be used for astercrm only) try start eventsdaemon:
modify to fit your configuration mainly database setting and AMI setting.

if you could read:

“Message: Authentication accepted”

congratulations, your eventsdaemon works well
use ctrl + c to exit
or else, please check your database/AMI configration in


Start eventsdaemon (default settings):
modify astercrm.conf set eventtype to event


/opt/asterisk/scripts/astercc/ -d


At some point it may be desirable to delete unwanted events from the database table. The eventsdaemon is also designed for this. please check for parameter “log_life” .also we provide a “watch dog”, it would help you restart eventsdaemon when it shutdown add this shell to your start-up file, for example:


echo /opt/asterisk/scripts/astercc/ >> /etc/rc.d/rc.local


so that everytime your server start, eventsdaemon would be loaded

7) Set file & folder access for astercrm

chmod 777 /var/www/html/astercc/astercrm/upload
chmod 777 /var/www/html/astercc/astercrm/astercrm.conf.php


If asterisk and astercrm running in one server, you could make a soft link to astercrm web directory for listening monitor records online.
ln -s /var/spool/asterisk/monitor/ /var/www/html/astercc/astercrm/monitor
note: astercrm support listen monitors online only can be wav format file.

8 ) Web browsing

For astercc:


or http://YOUR-WEB-SERVER-ADDRESS/astercc


For astercrm:



or http://YOUR-WEB-SERVER-ADDRESS/astercc/astercrm


login with admin/admin

Integration of External CRM With AsterCRM

In your astercrm, go to
Manager-> preference

install AsterCRM and integrate  EXternal cr

If asterCRM use external CRM software install AsterCRM and integrate , change the value of enable_external_crm to 1. When using external CRM, the default page to be displayed is specified in external_crm_default_url .Value of external_crm_url specifies, when asterCRM need to pop up, which url would recevie the event, %callerid: %calleeid: %method dialout or dialin. Save the changes made by clicking Save button.

Leave a Comment

Your email address will not be published. Required fields are marked *