Install asterBilling on your server

By November 5, 2008asterBilling
  1. Download and unzip the source
  2. cd /var/www/html
    wget http://voxel.dl.sourceforge.net/sourceforge/astercc/astercc-0.09beta.zip
    unzip astercc-0.09beta.zip
    mv astercc-0.09beta astercc

  3. Create the directories and move astercc daemon scripts:
  4. mkdir -p /opt/asterisk/scripts/astercc/
    mv /var/www/html/astercc/daemons/* /opt/asterisk/scripts/astercc/
    chmod +x /opt/asterisk/scripts/astercc/astercc
    chmod +x /opt/asterisk/scripts/astercc/asterrc
    chmod +x /opt/asterisk/scripts/astercc/asterccd

  5. Create the MySQL database and table, asterCC need mysql 4.1 or above
  6. mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercc
    mysql -uyourmysqluser -pyourmysqlpasswd astercc <sql/astercc.sql

    Note: here we create the database named astercc, you could use whatever db name you want use your configration to replace yourmysqluser and yourmysqlpasswd

  7. Update /etc/asterisk/manager.conf to enable Manager connections
  8. Note: asterisk and astercc could be on different server

    Add something like this to the manager.conf file:

    [general] enabled = yes
    port = 5038
    bindaddr = 0.0.0.0
    ;displayconnects = yes

    ;the following line could be changed by yourself
    [eventsdaemon] secret = myeventsdaemon
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user
    deny=0.0.0.0/0.0.0.0
    ; only allow local access, if you want to run astercrm on another server
    ; use your astercrm ip to replace 127.0.0.1 or add a new line
    permit=127.0.0.1/255.255.255.0

  9. Modify /var/www/html/astercc/astercc.conf.php and /opt/asterisk/scripts/astercc/astercc.conf to fit your configration
  10. Start astercc daemons
  11. /opt/asterisk/scripts/astercc/asterccd start
    Note: If your astercc scripts in other directory,
    you need to modify script path in CONFIGURATION SECTION of asterccd and asterccdaemon
    to fit your script path (modify path of astercc,asterrc and asterccdaemon in asterccd;
    modify path of asterccd and monitor log in asterccdaemon).

    Start 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 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.

  12. Set folder access
  13. chmod 777 /var/www/html/astercc/upload

  14. Testing: browse to http://localhost/astercc
  15. browse to http://localhost/astercc

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

    login with admin/admin

  16. Set your first booth
    • go Reseller and add a reseller
    • go Group add a group belong to the reseller
    • go Clid add some clid for this group, then the account in asterisk with the clid would be billing as a user in this group
    • go Account add a account, usertype could be groupadmin and belongs to the group you just added
    • go Rate to Customer and add some rate for the group, if you dont select reseller or group, the rate could be the default rate all all resellers/groups
    • login as groupadmin account, then you should see some box as the attachments.
    • try make a call using the ip phone with the clid, you could see the calling and billing message in the box

53 Comments

  • Carlos says:

    Hi, I have a problem with the step 6, because when i start the asterccd, this message appears:
    astercc could not be started bad arg lenght for socket::pack_sockaddr_in, length is 0, should be 4 at /pearlapp/socket.pm line 376
    asterrc could not be started,
    asterccdaemon (pid 2405) already running

    Could you please help me about this issue?

    Thanks

  • Carlos says:

    Thanks for answer me, in astercc.conf , i just put this information:
    [database]
    dbtype=mysql
    dbhost=127.0.0.1
    dbname=astercc
    dbport=3306
    username=root
    password=passw0rd

  • admin says:

    [asterisk]
    server = 127.0.0.1
    port = 5038
    username = admin
    secret = amp111

    did u set asterisk section?

  • validyne says:

    Hello, i have problem with paypal payment : i have this message when i enable the paypal payment

    the system does not support online payment.

    PLease let me know if i miss somethings.

    best regards.

  • Riyaz says:

    Hi, i installed astercc on personel ubuntu pc, I have a problem, with the step 6,when i start the astercc daemons, this message appears:

    /opt/asterisk/scripts/astercc/asterccd start: astercc could not be started
    /opt/asterisk/scripts/astercc/asterccd start: asterrc could not be started
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon started

    Here are my 3 files configuration, respectively :

    – manager.conf : http://paste.ubuntu.com/414574/

    – astercc.conf.php : http://paste.ubuntu.com/414575/

    – astercc.conf : http://paste.ubuntu.com/414576/

    I pased more than one week to troubleshout it, sincerly i can’t, Could you please help me about this issue? thanks advanced

    • admin says:

      hi
      in your astercc.conf. change debug=20 and add a line under debug
      internal_debug = 1
      then
      /opt/asterisk/scripts/astercc/asterccd stop
      /opt/asterisk/scripts/astercc/astercc
      see what you get

  • Riyaz says:

    Thanks for your quick reply, this is what i got after changing debug=3 to debug=20, adding this line under debug : internal_debug = 1 and running the script :

    http://paste.ubuntu.com/414843/

  • Riyaz says:

    Thx, using this information : mysql -uroot -pvoippassword
    astercc, i can able to connect to my database

  • Riyaz says:

    you mean i have to restart everything from the step 3 ? if yesn, is it the right command is :

    mysqladmin -uroot -pvoippassword create astercc

    OR
    mysqladmin -uroot -pvoippassword rebuild astercc

    • admin says:

      sorry, i think i missed something here, so please do as following
      mysqladmin -uyourmysqluser -pyourmysqlpasswd drop database astercc
      mysqladmin -uyourmysqluser -pyourmysqlpasswd create astercc
      mysql -uyourmysqluser -pyourmysqlpasswd astercc < sql/astercc.sql
      also i updated the post, also please notice that the latest a2billing is in astercc 0.13 and this post is a kind of old

  • Riyaz says:

    can’t able to run this command :
    mysql -uroot -pvoippassword astercc <sql/astercc.sql

    it says :

    -su: sql/astercc.sql: No such file or directory

  • Riyaz says:

    yes, from there, i run that cli, plz see this one :

    http://paste.ubuntu.com/414869/

  • Riyaz says:

    i choose all kind of possibility, no success
    http://paste.ubuntu.com/414900/

  • admin says:

    mysql -uroot -pvoippassword astercc /var/www/html/astercc/sql/astercc.sql

  • admin says:

    sorry, should be
    mysql -uroot -pvoippassword astercc < /var/www/html/astercc/sql/astercc.sql i suggest you can use astercc box if you dont have much linux and asterisk experience

  • Riyaz says:

    This one now : http://paste.ubuntu.com/414906/

    can we gtalk ?

  • Riyaz says:

    Hello, i success to set my server, but when i point to URL :

    http://82.243.x.x/astercc/login.php

    i got kind of popup error message like this :

    ” Error: the XML response that was returned from the server is invalid.
    Received:
    DB Error: connect failed ”

    what information i have to check it again ? thx

  • admin says:

    check asterbilling.conf.php and astercrm.conf.php see if database scrtion is correct

  • Riyaz says:

    Hi, this is what i got once after the configuration of my asterbilling,

    http://paste.ubuntu.com/524054/

    seriously i still not find what’s wrong with that since two days, thanks in advanced

    cdt,

  • md. eftekhar says:

    ” Error: the XML response that was returned from the server is invalid.
    Received:
    DB Error: connect failed ”

    Please install php-mysql via
    yum install php-mysql

  • kourosh says:

    hello
    tanx for your good support, when i want to start astercc, faced some error …

    {{{Thu Oct 4 14:40:34 2012 Connecting to mysql database on 127.0.0.1:
    Thu Oct 4 14:40:34 2012 Database connection successful.
    Thu Oct 4 14:40:34 2012 Connecting to asterisk on 127.0.0.1 port 5038:
    Thu Oct 4 14:40:34 2012 Asterisk socket connection successful.
    Thu Oct 4 14:40:34 2012 Check asterisk username & secret:
    Thu Oct 4 14:40:35 2012 Failed
    Connection failed, please check the log file for detail. }}}

    i dont remember that set any username and password in during installation, what is default username and password(secret) ?

    • admin says:

      check /opt/asterisk/scripts/astercc/astercc.conf
      make sure the username/secret under asterisk match the one you config in /etc/asterisk/manager.conf and it’s enabled

  • Adnan says:

    Dear Admin,

    can we loadbalance two astercc servers over opensips? my preferred structure will be openips cluster–>asterisk+astercc cluster—> MySQL DB Cluster.

    I have few opensips running that are doing load balancing for other billing systems. could oyu tell me where can I start for astercc load balancing?

    Best Regards

  • sangreal says:

    Hi! I try to install astercc-0.22. All config files I corrected. When I try to start script /opt/asterisk/scripts/astercc I got this message
    [root@asterisk astercc]# ./eventsdaemon.pl
    Fri Nov 28 11:02:50 2014 Connecting to mysql database on 127.0.0.1:
    Fri Nov 28 11:02:50 2014 Database connection successful.
    Fri Nov 28 11:02:50 2014 Connecting to asterisk on 127.0.0.1 port 5038:
    Fri Nov 28 11:02:50 2014 Asterisk socket connection successful.
    Fri Nov 28 11:02:50 2014 Check asterisk username & secret:
    Fri Nov 28 11:02:50 2014 Success
    [warn] Connect to Asterisk now at ./eventsdaemon.pl line 106, line 2.
    [warn] Connect successful, Waiting for the message! at ./eventsdaemon.pl line 118, line 2.
    [warn] Login in Asterisk Manager at ./eventsdaemon.pl line 123, line 1.
    RECEIVE : Message: Authentication accepted ———–
    RECEIVE : Event: FullyBooted Privilege: system,all Status: Fully Booted ———–

    And when I try to connected http://192.168.0.178/astercc/astercrm/ I saw just white screen. What I’m doing wrong? Please help me

  • sangreal says:

    Thanks! It works!

  • Mark says:

    Hi
    I can not see daemon scripts in my astercc folder
    This is for second step second command
    please let me know
    Thank you

  • Bardwell says:

    Hi all ,

    I am getting the same issue on CentOS with freepbx , i got not errors during install but when i try to access http://192.168.0.11/astercc/ I get a blank page. I am new to asterbilling any ideas what i can check please …

    • admin says:

      Hi

      Did you check apache log? or check the source of the blank page, if you could see php code, enable short tag in php.ini

  • Bardwell says:

    Hi ,

    what do i check in /opt/asterisk/scripts/astercc ??

    I am also getting a recurring message on screen

    /opt/asterisk/scripts/astercc/events2filedaemon.pl line176

    password

    login incorrect

    Is there a password i miss matched or ….

  • Bardwell says:

    Looks like this

    /opt/asterisk/scripts/astercc/asterccd start: asterrc (pid 18935) already running
    Connection failed, please check the log file for detail.
    /opt/asterisk/scripts/astercc/asterccd start: astercclock started
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon (pid 1912) already running

  • Bardwell says:

    Am also getting this from asterisk -vvr

    Connected to Asterisk 11.14.1 currently running on localhost (pid = 2950)
    == Connect attempt from ‘127.0.0.1’ unable to authenticate
    [2015-01-22 12:32:27] NOTICE[11358]: manager.c:2666 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
    [2015-01-22 12:32:28] NOTICE[11370]: manager.c:2666 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
    [2015-01-22 12:32:28] NOTICE[11380]: manager.c:2666 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
    [2015-01-22 12:32:28] NOTICE[11388]: manager.c:2666 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
    == Connect attempt from ‘127.0.0.1’ unable to authenticate

  • Bardwell says:

    Hi ,

    From the apache logs , this is what im getting

    [Wed Jan 14 11:26:03 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterCC
    [Wed Jan 14 11:26:30 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterCC
    [Wed Jan 14 11:27:49 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterCC
    [Wed Jan 14 11:32:57 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterCC
    [Wed Jan 14 11:33:08 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterbilling
    [Wed Jan 14 11:33:22 2015] [error] [client 192.168.0.37] File does not exist: /var/www/html/asterbilling
    [Wed Jan 14 11:53:48 2015] [error] [client 192.168.0.37] PHP Fatal error: Class ‘Localization’ not found in /var/www/html/astercc/asterbilling/login.common.php on line 24
    [Wed Jan 14 11:54:03 2015] [error] [client 192.168.0.37] PHP Fatal error: Class ‘Localization’ not found in /var/www/html/astercc/asterbilling/login.common.php on line 24
    [Wed Jan 14 11:54:23 2015] [error] [client 192.168.0.37] PHP Fatal error: Class ‘Localization’ not found in /var/www/html/astercc/asterbilling/login.common.php on line 24

  • Bardwell says:

    When i try to follow the links in a browser , it presents a blank page ..

  • Bardwell says:

    Hi again ,

    Which log file is being referred to here :

    /opt/asterisk/scripts/astercc/asterccd start
    eventsdaemon will in daemon start! at /opt/asterisk/scripts/astercc/events2filedaemon.pl line 176.
    /opt/asterisk/scripts/astercc/asterccd start: events2filedaemon started
    /opt/asterisk/scripts/astercc/asterccd start: astercc started
    /opt/asterisk/scripts/astercc/asterccd start: astercctools started
    Connection failed, please check the log file for detail.
    /opt/asterisk/scripts/astercc/asterccd start: asterrc could not be started
    /opt/asterisk/scripts/astercc/asterccd start: astercclock (pid 16423) already running
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon (pid 1845) already running

  • Bardwell says:

    Hi ,

    I checked as you said , seems many of the errors have now gone ..

    [root@localhost ~]# /opt/asterisk/scripts/astercc/asterccd start
    /opt/asterisk/scripts/astercc/asterccd start: events2filedaemon (pid 3329) already running
    /opt/asterisk/scripts/astercc/asterccd start: astercc (pid 3342) already running
    /opt/asterisk/scripts/astercc/asterccd start: astercctools (pid 3531) already running
    /opt/asterisk/scripts/astercc/asterccd start: asterrc (pid 3132) already running
    /opt/asterisk/scripts/astercc/asterccd start: astercclock (pid 3143) already running
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon (pid 1841) already running
    [root@localhost ~]#
    [root@localhost ~]#

    Not sure what this means though :

    [root@localhost ~]# asterisk -vvvr
    Asterisk 11.14.1, Copyright (C) 1999 – 2013 Digium, Inc. and others.
    Created by Mark Spencer
    Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
    This is free software, with components licensed under the GNU General Public
    License version 2 and other licenses; you are welcome to redistribute it under
    certain conditions. Type ‘core show license’ for details.
    =========================================================================
    Connected to Asterisk 11.14.1 currently running on localhost (pid = 3094)
    == Manager ‘admin’ logged on from 127.0.0.1
    == Manager ‘admin’ logged off from 127.0.0.1
    == Manager ‘admin’ logged on from 127.0.0.1
    == Manager ‘admin’ logged off from 127.0.0.1
    == Manager ‘admin’ logged on from 127.0.0.1
    == Manager ‘admin’ logged off from 127.0.0.1
    == Manager ‘admin’ logged on from 127.0.0.1
    == Manager ‘admin’ logged off from 127.0.0.1
    == Manager ‘admin’ logged on from 127.0.0.1

    Seems the only issue now is the white page i get when i try to access via browser .. any ideas here …

  • rick says:

    the only issue now is the white page i get when i try to access via browser .. any ideas here?

    asterisk 13.4.0

  • Carlos says:

    Hi,
    I have this issue when i run this:

    root@voip-carlos:/opt/asterisk/scripts/astercc# ./asterccd
    ./asterccd start: events2filedaemon (pid 12499) already running
    No astercc in /opt/asterisk/scripts/astercc/astercc
    No astercctools in /opt/asterisk/scripts/astercc/astercctools
    No asterrc in /opt/asterisk/scripts/astercc/asterrc
    No astercclock in /opt/asterisk/scripts/astercc/asterrc
    ./asterccd start: asterccdaemon (pid 12511) already running

  • Carlos says:

    Hi,

    I get this from asterisk
    root@voip-carlos:/etc/asterisk# rasterisk
    Asterisk 11.20.0, Copyright (C) 1999 – 2013 Digium, Inc. and others.
    Created by Mark Spencer
    Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
    This is free software, with components licensed under the GNU General Public
    License version 2 and other licenses; you are welcome to redistribute it under
    certain conditions. Type ‘core show license’ for details.
    =========================================================================
    Connected to Asterisk 11.20.0 currently running on voip-carlos (pid = 23122)
    == Manager ‘astercc’ logged on from 127.0.0.1
    == Manager ‘astercc’ logged off from 127.0.0.1
    == Manager ‘astercc’ logged on from 127.0.0.1

    and this from asterccd

    root@voip-carlos:~# /opt/asterisk/scripts/astercc/asterccd start
    /opt/asterisk/scripts/astercc/asterccd start: events2filedaemon (pid 23265) alre ady running
    /opt/asterisk/scripts/astercc/asterccd start: astercc (pid 9552) already running
    /opt/asterisk/scripts/astercc/asterccd start: astercctools (pid 23273) already r unning
    /opt/asterisk/scripts/astercc/asterccd start: asterrc (pid 9579) already running
    /opt/asterisk/scripts/astercc/asterccd start: astercclock (pid 9588) already run ning
    /opt/asterisk/scripts/astercc/asterccd start: asterccdaemon (pid 9599) already r unning

    The only issue now is the white page i get when i try to access via browser.

  • Carlos says:

    Dear Admin,

    When i put this on the browser :http://172.30.7.44/astercc/login.php

    This is what happens

    Not Found

    The requested URL /astercc/login.php was not found on this server.

    Apache/2.4.7 (Ubuntu) Server at 172.30.7.44 Port 80

    you have any ideas about this.

    Thanks

Leave a Reply