A2billing 1.4 upgrade instructions !

Discussion in 'General' started by Ichorcom007, Aug 24, 2009.

  1. Ichorcom007

    Joined:
    Apr 16, 2008
    Messages:
    52
    Likes Received:
    0
    While the first pre-Alpha release of Elajoom works with A2billing 1.3 the rest will work with A2billing 1.4 here are the upgrade instructions for a2billing 1.4. Follow them to the tee. This works fine and have had no trouble using the Elastix server at all with the a2billing.

    Upgrade procedure from a2billing 1.3.0-2 to 1.4.1 in elastix 1-5-2-2


    1) Uninstall the a2billing RPM package:

    # rpm -e elastix-a2billing

    2) Download the a2billing tar package from asterisk. Create a a2billing folder under /usr/local/src

    #mkdir /usr/local/src/a2billing
    #cd /usr/local/src/a2billing
    #wget http://www.asterisk2billing.org/downloa ... 4.1.tar.gz


    3) Untar the package:

    #tar zxvf A2Billing_1.4.1.tar.gz

    4) create a MySQL database (mya2billing) for the billing software.
    The file a2billing-createdb-user.sql includes a script that creates the database with the correct access control users and permissions.

    #cd /usr/local/src/a2billing
    #mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
    (the elastix mysql root´s password is: eLaStIx.2oo7)

    The script with create a database, username and password with the following default values

    Database name is: mya2billing
    Database user is: a2billinguser
    User password is: a2billing
    After creating the database structure, we will create a set of tables and insert some initial basic configuration data

    # mysql -u root -p mya2billing < DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
    #mysql -u root -p mya2billing < DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql

    5) Copy the a2billing configuration file to /etc folder

    #cp /usr/local/src/a2billing/a2billing.conf /etc/

    6) Edit the file.
    #vi /etc/a2billing.conf
    Change the "database" paramenter as follow, the other paramaters must remain unchanged:

    [database]
    hostname = localhost
    port = 3306
    user = a2billinguser
    password = a2billing
    dbname = mya2billing
    dbtype = mysql

    8) Create the additional files and setup the correct owner:

    #touch /etc/asterisk/additional_a2billing_iax.conf
    #touch /etc/asterisk/additional_a2billing_sip.conf
    #echo \#include additional_a2billing_sip.conf >> /etc/asterisk/sip.conf
    #echo \#include additional_a2billing_iax.conf >> /etc/asterisk/iax.conf
    #chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_iax.conf
    #chown -Rf asterisk:asterisk /etc/asterisk/additional_a2billing_sip.conf

    9) Install the sound files

    #/usr/local/src/a2billing/addons/sounds/install_a2b_sounds.sh

    10) Edit /etc/asterisk/manager.conf and add the necesary user as follow:

    [myasterisk]
    secret=mycode
    read=system,call,log,verbose,command,agent,user
    write=system,call,log,verbose,command,agent,user

    11) Copy the entire content of the AGI directory into asterisk agi-bin directory.
    #cd /usr/local/src/a2billing/AGI
    #cp a2billing.php /var/lib/asterisk/agi-bin/
    #cp -Rf /usr/local/src/a2billing/common/lib /var/lib/asterisk/agi-bin/

    #chown asterisk:asterisk /var/lib/asterisk/agi-bin/a2billing.php
    #chown -Rf asterisk:asterisk /var/lib/asterisk/agi-bin/lib
    #chmod +x /var/lib/asterisk/agi-bin/a2billing.php

    12) Installing the GUI interface

    #mv /var/www/html/a2billing /var/www/html/a2billing-old
    #mkdir /var/www/html/a2billing
    #chown asterisk:asterisk /var/www/html/a2billing


    # cp -rf /usr/local/src/a2billing/admin /var/www/html/a2billing/
    # cp -rf /usr/local/src/a2billing/agent /var/www/html/a2billing/
    # cp -rf /usr/local/src/a2billing/customer /var/www/html/a2billing/
    # cp -rf /usr/local/src/a2billing/common /var/www/html/a2billing/

    #chmod 755 /var/www/html/a2billing/admin/templates_c
    #chmod 755 /var/www/html/a2billing/customer/templates_c
    #chmod 755 /var/www/html/a2billing/agent/templates_c
    #chown -Rf asterisk:asterisk /var/www/html/a2billing/admin/templates_c
    #chown -Rf asterisk:asterisk /var/www/html/a2billing/customer/templates_c
    #chown -Rf asterisk:asterisk /var/www/html/a2billing/agent/templates_c


    13) Add the file /etc/httpd/conf.d/a2billing.conf with the follow lines:

    Alias /a2billing /var/www/html/a2billing

    Restart the apache service:

    #service httpd restart


    Now, to enter to new a2billing you must access it throught the follow URL:

    http://Elastix-IP-Address/a2billing

    the default user and password are:

    user: root
    pass: changepassword



    14) Add the file /etc/asterisk/extensions_a2billing.conf with the follow lines:


    [a2billing]
    ; CallingCard application
    exten => _X.,1,Answer
    exten => _X.,2,Wait,2
    exten => _X.,3,DeadAGI,a2billing.php
    exten => _X.,4,Wait,2
    exten => _X.,5,Hangup

    [did]
    ; CallingCard application
    exten => _X.,1,DeadAGI(a2billing.php|1|did)


    Add the follow line to /etc/asterisk/extension.conf at the top of the file:

    #include extensions_a2billing.conf

    15)Create a file with the jobs in /var/spool/cron/a2billing with the follow lines:

    # update the currency table
    0 6 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php

    # manage the monthly services subscription
    0 6 1 * * php /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php

    # To check account of each Users and send an email if the balance is
    less than the user have choice.
    0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_notify_account.php

    # To check all the accounts and send an notification email if the
    balance is less than the first argument.
    0 */6 * * php /usr/local/src/a2billing/Cronjobs/a2billing_check_account.php

    # this script will browse all the DID that are reserve and check if
    the customer need to pay for it
    # bill them or warn them per email to know if they want to pay in
    order to keep their DIDs
    0 2 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.php

    # This script will take care of the recurring service.
    0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php

    # To generate invoices and for each user.
    0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice_cront.php

    # to proceed the autodialer
    */5 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_autodialer.php

    # manage alarms
    0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php

    16) The callback daemon is written in Python. Install the python-setuptools and use easy_install to install the callback_daemon
    #yum install python-setuptools python-mysqldb python-psycopg2 python-sqlalchemy
    #cd /usr/local/src/a2billing/CallBack
    #easy_install callback-daemon-py/dist/callback_daemon-1.0.prod_r1527-py2.5.egg

    Install the init.d startup script
    #cd /usr/local/src/a2billing/CallBack/callback-daemon-py/callback_daemon/
    #cp a2b-callback-daemon.debian /etc/init.d/a2b-callback-daemon
    #chmod +x /etc/init.d/a2b-callback-daemon

    Make sure the daemon starts
    #chkconfig a2b-callback-daemon on
     
  2. cotaj

    Joined:
    Aug 25, 2009
    Messages:
    1
    Likes Received:
    0
    Hello Ichorcom007

    ive been looking forward for this post to come out.I have been wanting to upgradde Asterisk2billing long before
    i have already uninstalled the old one using command : rpm -e elastix-a2billing
    when i try to import sql files into database:
    #mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
    that one is imported successfully.
    when i try to import a2billing-schema-v1.4.0.sql like following

    # mysql -u root -p mya2billing < DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql

    it prompts me for the password. i type "eLaStIx.2oo7" which is default elastix box mysql password

    and i get the following error:
    ERROR 1054 (42S22) at line 573: Unknown column 'id_seria' in 'NEW'

    im running Elastix 1.5.2-2


    i would continue with the database update

    #mysql -u root -p mya2billing < DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
    using default mysql password but i get the other following error.
    ERROR 1146 (42S02) at line 16: Table 'mya2billing.cc_config' doesn't exist

    this probably is because we haven't imported a2billing-schema-v1.4.0.sql in the database yet.

    Can you find a solution for this please?

    Regards

    Cotaj
     
  3. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
    Hi, You should at first Drop the a2billing Db, you can use Webmin to do that, B)
     
  4. jammerz

    Joined:
    Sep 7, 2009
    Messages:
    75
    Likes Received:
    0
    thx..very detailed Have you seen a significant advantage to making the move to 1.4 or conversely with any limitations, broken items with elastix to urge moving up quickly?

    Saw this on the the A2B site: curious about your or others experience in making the move now or waiting til elastix.org adds...

    Version 1.4 - Agent Module - DB configuration (no more conf files) - Optimized version - PL/SQL function - Python CallBack? Daemon - New design - New Invoice Module - Notification customer - Internal Notification system - DashBoard? - Better internationalization - New reporting - Package offer redone - Customer Batch / Group - Support application - New Online payment : PnP - and much more...
     
  5. Ichorcom007

    Joined:
    Apr 16, 2008
    Messages:
    52
    Likes Received:
    0
    Thanks Hammed ,

    "Re:A2billing 1.4 upgrade instructions ! 1 Day, 10 Hours ago Karma: 7 Karma+ Karma-
    Hi, You should at first Drop the a2billing Db, you can use Webmin to do that"

    Jammerz,

    I have been developing the new Elajoom extension for joining Joomla and Elastix , and posted these upgrade instructions. I have had no issue with the new A2billing thus far with Elastix. The A2BILLING GUI will not show up inside of Elastix thru the Extras tab but you must go directly through the IP XXX.XXX.XXX.XXX/a2billing.

    By the way it is a AWESOME! Upgrade comes with sick DID management and call management and all those things you mentioned. and the GUI is much more smoother.

    I hope THE ELASTIX TEAM - Decide to upgrade both the a2billing and vtiger as it would help my project. When bridging both the vtiger joomla and a2billing i will be using the new vtiger as well and will post instructions like this for upgrade.

    In spare time will prepare scripts.



    Ichorcom
     
  6. techtra

    Joined:
    Sep 9, 2009
    Messages:
    5
    Likes Received:
    0
    Pardon my Ignorance I am a Beginner and I don;t know nothing about Programming.

    4) create a MySQL database (mya2billing) for the billing software.
    The file a2billing-createdb-user.sql includes a script that creates the database with the correct access control users and permissions.

    How do I do this ? if it's a sript where do I go and How to Trigger it ?

    In this Section Below < Database/msql-5.x do I replace Database by my Database name or this is exactly what to type ?

    # mysql -u root -p mya2billing < DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
    #mysql -u root -p mya2billing < DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql

    Thanks
     
  7. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
    Hi,
    you should exactly type this 3 line for sql creation.

    mysql -u root -p < DataBase/mysql-5.x/a2billing-createdb-user.sql
    mysql -u root -p mya2billing < DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
    mysql -u root -p mya2billing < DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql

    after enter each line the sql ask you for password and then enter eLaStIx.2oo7

    and don't forget before all you should uninstall(DROP) the last db of a2billing, you can do it simply with webmin,

    Good LuckB)
     
  8. senthilarasu

    Joined:
    Jun 29, 2009
    Messages:
    19
    Likes Received:
    0
    First, Thanks for detailed upgrade instructions

    I have few questions,

    1. Everything went fine...except the last step with a2b-callback-daemon. I got the following error when making the callback run as service

    Code:
    chkconfig a2b-callback-daemon on
    service a2b-callback-daemon does not support chkconfig
    2. When I tried to check the status of the service a2b-callback-daemon, I get the following error.

    Code:
    service a2b-callback-daemon status
    /etc/init.d/a2b-callback-daemon: line 26: /lib/lsb/init-functions: No such file or directory
    3. When I tried to login myelastixipaddress/a2billing.. I get to the index page. (Screenshot attached).

    Can you please help me to fix these issues.

    Thanks in advance

    Regards
    Senthil [​IMG]
     
  9. senthilarasu

    Joined:
    Jun 29, 2009
    Messages:
    19
    Likes Received:
    0
    DID SOME INSTALLED A2B CALLBACK DAEMON Successfully????

    I still have issues installing A2b callback daemon in 1.4

    I followed the steps mentioned above...everything was successfull until I configured Callback daemon. I get the following error


    Code:
    easy_install callback-daemon-py/dist/callback_daemon-1.0.prod_r1527-py2.5.egg
    Processing callback_daemon-1.0.prod_r1527-py2.5.egg
    Copying callback_daemon-1.0.prod_r1527-py2.5.egg to /usr/lib/python2.4/site-packages
    Adding callback-daemon 1.0.prod-r1527 to easy-install.pth file
    Installing a2b_callback_daemon script to /usr/bin
    
    Installed /usr/lib/python2.4/site-packages/callback_daemon-1.0.prod_r1527-py2.5.egg
    Processing dependencies for callback-daemon==1.0.prod-r1527
    Searching for callback-daemon==1.0.prod-r1527
    Reading http://cheeseshop.python.org/pypi/callback-daemon/
    Couldn't find index page for 'callback-daemon' (maybe misspelled?)
    Scanning index of all packages (this may take a while)
    Reading http://cheeseshop.python.org/pypi/
    No local packages or download links found for callback-daemon==1.0.prod-r1527
    error: Could not find suitable distribution for Requirement.parse('callback-daemon==1.0.prod-r1527')


    &


    Can someone please help me to resolve this issue.

    Thanks

    Senthil
     
  10. senthilarasu

    Joined:
    Jun 29, 2009
    Messages:
    19
    Likes Received:
    0
  11. zolt

    Joined:
    Sep 18, 2009
    Messages:
    1
    Likes Received:
    0
    Hello Senthilarasu,


    I stuck in the same spot as you 5 days ago,

    >
    >3. When I tried to login myelastixipaddress/a2billing.. I get to the index page. (Screenshot >attached).
    >
    >Can you please help me to fix these issues.
    >

    How you fix it, please help.

    Thanks

    Marv
     
  12. senthilarasu

    Joined:
    Jun 29, 2009
    Messages:
    19
    Likes Received:
    0
    Hi Marv,

    Still I have the issue. I couldn't fix it.

    Will let you know if I fix it.

    Incase, if you find some solution, please share with us

    Thanks

    Senthil
     
  13. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
    I have this problem with callback !...
    If i could found the solution i will share it.
     
  14. krull

    Joined:
    Sep 29, 2009
    Messages:
    2
    Likes Received:
    0
    In the step above for the a2billing.conf inside your apache, do this instead:

    Code:
    Alias /a2billing /var/www/html/a2billing/admin
    That will load the admin section of A2B in elastix.


    senthilarasu, instead of refering to the full install script for A2B at the link, I think it is fitting to show only the related part that fixed the A2B Callback Error we all have been getting from jessie's walkthrough:

    Code:
    LOAD_LOC=/usr/local/src/a2billing
    
    
    yum -y install python-setuptools.noarch
    yum -y install MySQL-python
    easy_install sqlalchemy
    
    
    cd $LOAD_LOC/CallBack/callback-daemon-py
    cp callback_daemon/a2b-callback-daemon.rc /etc/init.d/a2b-callback-daemon
    chmod +x /etc/init.d/a2b-callback-daemon
    
    
    
    cp dist/callback_daemon-1.0.prod-r1528.tar.gz /tmp
    cd /tmp
    tar xvfz callback_daemon-1.0.prod-r1528.tar.gz
    cd callback_daemon-1.0.prod-r1528
    
    python setup.py build
    python setup.py bdist_egg
    easy_install dist/callback_daemon-1.0.prod_r1528-py2.4.egg
    
    chkconfig --add a2b-callback-daemon
    service a2b-callback-daemon start
    chkconfig a2b-callback-daemon on
    
    Walking through the commands above from the script installs the Callback Daemon successfully.

    Also, version 1.4.2 of A2B was released yesterday (28th Sept.). I can report here that following this walkthrough with the Tar file of 1.4.2 instead works successfully with Elastix.

    Thank you all for your Contrib! It was fun!

    -krull
     
  15. pnaves

    Joined:
    May 27, 2009
    Messages:
    66
    Likes Received:
    0
    How about the webservice module? Should we copy the folder werservice to www/html to use this module?
     
  16. infolyseis

    Joined:
    Apr 6, 2009
    Messages:
    24
    Likes Received:
    0
    hi haamed
    install webmin but i'don't know the default username and password of mysql,
    i want to drop the a2billing DB

    thank's

    Dimitris
     
  17. infolyseis

    Joined:
    Apr 6, 2009
    Messages:
    24
    Likes Received:
    0
    ok
    install phpmyAdmin and job done

    thank's

    Dimitris
     
  18. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
    User: root
    Pass: eLaStIx.2oo7
     
  19. FreshConnexions

    Joined:
    Oct 22, 2009
    Messages:
    15
    Likes Received:
    0
    Hello,

    I have upgraded on a few servers following these instructions and it has worked perfect, however i have just done another upgrade and when i try to create a customer i get the error: Your new Card hasn't been inserted.

    I thought maybe i missed a step in the instructions and it had caused the permissions for a required file/folder to be incorrect so i attempt to start from the beginning again however when i run the command: rpm -e elastix-a2billing i get the error package elastix-a2billing is not installed so i am unable to start the install from the beginning.

    Should i be using a different comand to uninstall?

    Many Thanks

    Dan
     
  20. haamed

    Joined:
    Jul 23, 2007
    Messages:
    251
    Likes Received:
    0
    Hi,
    if you uninstall a2billing 1.3 and install 1.4 and now you want to uninstall 1.4 again..!
    you should know there is no elastix-rpm else...
    you should just drop a2billing Table in database for uninstalling..
     

Share This Page