simple asterCRM installation guide for asterisk

By September 11, 2008asterCRM

for asterCRM 0.047beta

    1. Download asterCRM package from, unzip it and put all files/folders to your WEBroot folder

cd /usr/src wget unzip mv ./astercrm-0.047beta /var/www/html/astercrm It is highly advised that the whole eventsdaemon directory be moved to a more secure location like /opt and out of the WEB root directory (in step 2)

    1. Create the directories and move eventsdaemon scripts:

in 0.047 beta, there’re several daemon scripts in the package:

  • astercc, asterccd, asterccdaemon are for users who would use astercc to catch asterisk call records
  •, are for users who would use eventsdaemon to catch asterisk AMI events

Users could choose either method to use, is for scheduler calls, but it’s not fully tested in 0.047beta yet mkdir -p /opt/asterisk/scripts/eventsdaemon mv /var/www/html/astercrm/eventsdaemon/* /opt/asterisk/scripts/eventsdaemon chmod +x /opt/asterisk/scripts/eventsdaemon/ chmod +x /opt/asterisk/scripts/eventsdaemon/ chmod +x /opt/asterisk/scripts/eventsdaemon/astercc chmod +x /opt/asterisk/scripts/eventsdaemon/asterccd chmod +x /opt/asterisk/scripts/eventsdaemon/asterccdaemon

    1. Create the MySQL database and tables, asterCRM requires mysql 4.1 or above

mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercrm mysql -uyourmysqluser -pyourmysqlpasswd astercrm </var/www/html/astercrm/sql/astercrm.sql here we create the database named astercrm, you could use whatever db name you want use your configration to replace “yourmysqluser” and “yourmysqlpasswd”

    1. Update /etc/asterisk/manager.conf to enable Manager connections
[general] enabled = yes port = 5038 bindaddr = ;displayconnects = yes ;the following line could be changed by yourself [asterccdaemon] secret = myasterccdaemon read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user deny= ; only allow local access, if you want to run asterCRM on another server ; use your asterCRM ip to replace or add a new line permit=

    1. Modify astercrm.conf.php to fit your configuration

Mainly first you need set database connectoin parameters in section [database] so that you can login, then u can set other parameters via web pages.

    1. Start Asterisk and daemons you use

There are two daemon modes you can choose, eventsdaemon mode or astercc mode.

  • using (eventtype = event in astercrm.conf.php)

open using some editor, then modify for database setting and AMI setting. try start the using /opt/asterisk/scripts/eventsdaemon/ 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 then start eventsdaemon as a daemon: /opt/asterisk/scripts/eventsdaemon/ -d At some point, for better performance, it may be desirable to delete old events from database, you can check for parameter “log_life”, which is for such purpose. Also we provide a “watch dog”, it would help you restart eventsdaemon when it’s down, like asterisk restart. Add this line to your start-up file /opt/asterisk/scripts/eventsdaemon/ so that everytime your server start, eventsdaemon would be loaded

  • using astercc (eventtype = curcdr in astercrm.conf.php)

modify /opt/asterisk/scripts/eventsdaemon/astercc.conf to fit your configuration try start astercc using /opt/asterisk/scripts/eventsdaemon/astercc 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: Success Monitor Start: …(some log message)…” congratulations, your astercc works well then use ctrl + c to exit or else, please check your database/AMI configration in astercc.conf then start astercc as a daemon: /opt/asterisk/scripts/eventsdaemon/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/eventsdaemon/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 example: you want to restart astercc at 0’clock everyday,just do the following line as root. crontab -e add a line: 0 0 * * * /etc/rc.d/init.d/asterccd restart end of this file, the first “0” figures minutes and the second “0” figures hours. a asterCC installation guid could be found here.

    1. Set file&folder access

set upload foler permission, so that you can upload your csv/excel files then import data chmod 777 /var/www/html/astercrm/upload set configratoin file permission, so that you can modify asterCRM perference via web chmod 777 /var/www/html/astercrm/astercrm.conf.php

    1. Test

open your browse, then enter this address http://localhost/astercrm or http://YOUR-WEB-SERVER-ADDRESS/astercrm login with admin/admin


  • This is really great piece of program for Asterisk. Will it work with Asterisk 1.6?

  • paco says:

    Hi, i would like to have ONLY the CRM asterCRM installed, i’m not interested in the billing part, is that possible in this version or i should install an older one? thanks.

  • paco says:

    Hi, first of all thanks for your answer. i have one more question, in the older asterCRM the popup was with any asterisk channel and now it only popup if i have an agent on a queue logged in (so the channel is AGENT/…), is that right? Is there an option to change this setting back as the older version of asterCRM? Thanks!

    • admin says:

      hi, it works with no difference as the old version, just when u are using dynamic agent, you need to put the agent number in agent filed like put 5000 when it’s agent/5000, if u are not using dynamic agent, just leave the field blank

  • admin says:

    what version are u using? if it’s astercc 0.1 +, we provide a auto installation script named ‘’ or u can follow the README.txt to install manually

  • Robert says:


    Any procedures on installing astercc v0.13 on trixbox v.2.8?

  • ahmed says:

    dears i use Elastix 1.6-12 but i have problem on asterCrm as the following
    at step one that says mv ./astercrm-0.047beta /var/www/html/astercrm
    i dont have this directory astercrm under path /var/www/html … so
    i created it then complete the steps so on the step 2 that says
    mv /var/www/html/astercrm/eventsdaemon/* /opt/asterisk/scripts/eventsdaemon i dont have this directory eventsdaemon or any thing under it so i creat it and complete the steps but when i try to startthe using /opt/asterisk/scripts/eventsdaemon/ on step 6 it my elastix says failed: Can’t connect to MySQL server on ‘’ (111) at /opt/asterisk/scripts/eventsdaemon/ line 133

  • Adam says:

    This is what displays login.php page 🙁
    Everything on the installation went fine, but website doesnt work.
    PHP 5.3.10
    Is there anything missing ?

    filePath = “language/”.$page.”_”.$language.”_”.$country.”.php”; } function Translate($str){ $source = $str; $filePath = dirname(dirname(__FILE__)).”/include/”.$this->filePath; if (file_exists($filePath)){ require $this->filePath; $str =str_replace(” “,”_”,strtolower($str)); if ($$str != “”) return $$str; else return $source; }else{ return $str; } } } ?>

    • admin says:

      in your php.ini
      short_open_tag = Off to short_open_tag = On
      then restart http

      sed -i “s/short_open_tag = Off/short_open_tag = On/” /etc/php.ini

  • Adam says:

    Thanx, that helped, but im still not in there 🙁
    [Sat M/ 17 20:52:20 2012] [error] [client] PHP Notice: Undefined index: curuser in /var/www/html/astercrm/include/common.class.php on line 30, referer:
    [Sat Mar 17 20:52:20 2012] [error] [client] PHP Notice: Use of undefined constant LOG_ENABLED – assumed ‘LOG_ENABLED’ in /var/www/html/astercrm/config.php on line 4, referer:
    [Sat Mar 17 20:52:20 2012] [error] [client] PHP Notice: Use of undefined constant FILE_LOG – assumed ‘FILE_LOG’ in /var/www/html/astercrm/config.php on line 5, referer:
    [Sat Mar 17 20:52:20 2012] [error] [client] PHP Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in /var/www/html/astercrm/include/phpagi.php on line 1184, referer:

  • Adam says:

    I found tha this i just php warning, but while trying to access login.php it pops up
    Error: the server returned the following HTTP status: 500
    Received: (nothing here)
    How do i debug i those lines above will not help ?

  • Adam says:

    Downgraded php to 5.2* from zend repo and it works now.
    Thanx for attention.

    • admin says:

      for php5.3 , you need change a function in phpagi, from goto to astercc_goto or just remove that function, and set display_errors=no in php.ini

  • Mustafa Mahmoud Afiifi says:

    Thanks for your post ,,

    I choose the installation using eventsdaemon mode and followed all steps of the post , but I have a problem now when I go to http://YOUR-WEB-SERVER-ADDRESS/astercrm I found this Error: the XML response that was returned from the server is invalid.
    DB Error: insufficient permissions

    Please need your help !!

    Thanks ,,
    Best Regards .

  • Maurice says:

    I want know how if Astercc can be installed without using Virtual Machine.
    I installed it on VM but I have a problem to connect FXO card to Freepbx.
    Please help!

  • Abdelhak says:

    i have the same problem as Adam (Error: the server returned the following HTTP status: 500) where can i find phpagi file ?

  • aicha says:

    bonjour, j’ai un probleme avec la configuration de astercc.
    j’arrive pas à lancer le fichier executable de astercc qui se trouve dans eventsdaemon.
    je crois qu’il est corrompu.

  • aicha says:

    hello, the problem is that when do I start the script asterccd with the / opt / asterisk / script / astercc / asterccd restart it return me the following error:
    ****************the contents of the directory eventsdaemon I renamed astercc.********************
    zamoha root @: / opt / asterisk / scripts / astercc # ls
    astercc asterccd asterccmonitor.log
    astercc.conf asterccdaemon eventsdaemonlog.txt
    *************I tried to start the script asterccd but return me the following erreure******************
    zamoha root @: / opt / asterisk / scripts / astercc # / opt / asterisk / scripts / astercc / asterccd start
    / opt / asterisk / scripts / astercc / asterccd: 68: / opt / asterisk / scripts / astercc / asterccd: / opt / asterisk / scripts / astercc / astercc: not found
    / opt / asterisk / scripts / astercc / asterccd start: astercc couldn’t be started
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon (pid 2444) already running
    root@zamoha:/opt/asterisk/scripts/astercc# /opt/asterisk/scripts/astercc/asterccdaemon: 27: [: x: unexpected operator
    /opt/asterisk/scripts/astercc/asterccdaemon: 27: [: x: unexpected operator
    /opt/asterisk/scripts/astercc/asterccdaemon: 27: [: x: unexpected operator
    I believe that my script is corrupt or encrypt.
    I also apologize for the delay.
    if you will help me.

  • Tchango marcelin says:

    It work for me, i’ve use this tutorial. It seems to be the same

  • Guy says:

    Is this installation method still functional with the newest versions of asterisk?

  • diegoD says:

    Hi admin , im new on aster CC i got a complete instalation , but how do i get service , fo calls ,
    i mean where to setup the trunks ? and how to point to different providers , by tech prefix.