Update 1.3.0 > 1.7.1

Discussion in 'General' started by chimo, Jun 8, 2010.

  1. chimo

    Joined:
    Apr 24, 2010
    Messages:
    71
    Likes Received:
    0
    Hello to all,
    It wanted to update the version of 1.3.0 to 1.7.1

    I need instructions

    I have tried with several systems that encontre but then not finciona and I have to format and to begin again.

    Thank you for the HELP.

    Hola a todos,
    Quisiera actualizar la version de 1.3.0 a la 1.7.1

    Necesito instrucciones

    He intentado con varios sistemas que encontre pero luego no finciona y tengo que formatear y comenzar de nuevo.

    Gracias por la AYUDA.
     
  2. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    I have just finished a procedure to install the a2billing 1.7.1, as I said, to install NOT to update.

    I have based the following steps based on the information provided by saleh at:
    http://www.elastix.org/index.php/en/com ... astix.html

    Code:
    1. yum -y install perl-DBD-Pg subversion
    
    
    2. mkdir /usr/local/src/a2billing
    
    
    3. cd /usr/local/src/a2billing
    
    
    4. svn co --username guest --password guest http://svn.a2billing.net/svn/asterisk2billing/trunk/ /usr/local/src/a2billing
    
    
    5. cp /usr/local/src/a2billing/a2billing.conf /etc/
    
    
    6. vim /etc/a2billing.conf
    Inside the database section, leave those values, like these ones:
    port = 5432
    user = a2billinguser
    password = a2billing
    dbname = mya2billing
    
    
    7. chown asterisk:asterisk /etc/a2billing.conf
    
    
    8. chmod 664 /etc/a2billing.conf
    
    
    9. cd /usr/local/src/a2billing/DataBase/mysql-5.x
    
    
    10. mysqladmin drop mya2billing -u root -peLaStIx.2oo7
    
    
    11. mysql -u root -peLaStIx.2oo7 < /usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-createdb-user.sql
    
    
    12.
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/a2billing-schema-v1.4.0.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.0-to-v1.4.1.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.1-to-v1.4.2.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.2-to-v1.4.3.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.3-to-v1.4.4.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4.1-to-v1.4.5.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.5-to-v1.5.0.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.0-to-v1.5.1.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.5.1-to-v1.6.0.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.0-to-v1.6.1.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.1-to-v1.6.2.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.6.2-to-v1.7.0.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.0-to-v1.7.1.sql
    mysql mya2billing -u root -peLaStIx.2oo7 </usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.7.1-to-v1.7.2.sql
    
    
    13.
    rm -f -R /var/www/html/a2billing/
    rm -f -R /var/www/html/a2customer/
    rm -f -R /var/lib/asterisk/agi-bin/a2billing.php
    rm -f -R /var/lib/asterisk/agi-bin/libs_a2billing/
    rm -f -R /var/lib/asterisk/agi-bin/lib/
    rm -f -R /etc/asterisk/additional_a2billing_iax.conf
    rm -f -R /etc/asterisk/additional_a2billing_sip.conf
    rm -f -R /var/www/html/agent/
    rm -f -R /var/www/html/common/
    rm -f -R /usr/src/a2billing/
    
    
    14.
    cp -rf /usr/local/src/a2billing/customer /var/www/html/a2customer
    chmod 777 /var/www/html/a2customer/templates_c
    cp -rf /usr/local/src/a2billing/agent /var/www/html
    chmod 777 /var/www/html/agent/templates_c
    cp -rf /usr/local/src/a2billing/admin /var/www/html/a2billing
    chmod 777 /var/www/html/a2billing/templates_c
    cp -Rf /usr/local/src/a2billing/common /var/www/html
    cp /usr/local/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/
    cp -rf /usr/local/src/a2billing/common/lib /var/lib/asterisk/agi-bin/
    chmod +x /var/lib/asterisk/agi-bin/a2billing.php
    chown -R asterisk:asterisk /var/lib/asterisk/agi-bin
    
    
    15.
    mkdir -p /var/lib/asterisk/mohmp3/acc_1
    mkdir -p /var/lib/asterisk/mohmp3/acc_2
    mkdir -p /var/lib/asterisk/mohmp3/acc_3
    mkdir -p /var/lib/asterisk/mohmp3/acc_4
    mkdir -p /var/lib/asterisk/mohmp3/acc_5
    mkdir -p /var/lib/asterisk/mohmp3/acc_6
    mkdir -p /var/lib/asterisk/mohmp3/acc_7
    mkdir -p /var/lib/asterisk/mohmp3/acc_8
    mkdir -p /var/lib/asterisk/mohmp3/acc_9
    mkdir -p /var/lib/asterisk/mohmp3/acc_10
    chmod 777 /var/lib/asterisk/mohmp3/acc_*
    chown -R asterisk:asterisk /var/lib/asterisk/mohmp3/
    
    
    16.
    cd /usr/local/src/a2billing/addons/sounds
    ./install_a2b_sounds.sh
    
    
    17.
    cd /etc/asterisk/
    touch additional_a2billing_iax.conf
    touch additional_a2billing_sip.conf
    touch extensions_a2billing.conf
    echo "#include additional_a2billing_sip.conf" >> /etc/asterisk/sip_custom.conf
    echo "#include additional_a2billing_iax.conf" >> /etc/asterisk/iax_custom.conf
    echo -e >> /etc/asterisk/extensions_custom.conf
    echo "#include extensions_a2billing.conf" >> /etc/asterisk/extensions_custom.conf
    
    
    18.
    chmod 666 /etc/asterisk/additional_a2billing_iax.conf
    chmod 666 /etc/asterisk/additional_a2billing_sip.conf
    chmod 666 /etc/asterisk/extensions_a2billing.conf
    chown -R asterisk:asterisk /etc/asterisk/
    chown -R asterisk:asterisk /var/www/html/common
    chown -R asterisk:asterisk /var/www/html/a2billing
    chown -R asterisk:asterisk /var/www/html/a2customer
    chown -R asterisk:asterisk /var/www/html/agent
    chown -R asterisk:asterisk /var/lib/asterisk/
    
    
    19.
    echo "
    # Automatically added for A2Billing
    0 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_alarm.php
    0 12 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_archive_data_cront.php
    0 10 21 * * php /usr/local/src/a2billing/Cronjobs/a2billing_autorefill.php
    #Batch process at 00:20 each day
    20 0 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_batch_process.php
    #Bill DID usage at 00:00 each day
    0 0 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_bill_diduse.php
    #Remind users of low balance every day at 06:00
    0 6 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_check_account.php
    #Generate Invoices at 7am everyday
    #0 7 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice2_cront.php
    #0 7 * * * php /usr/local/src/a2billing/Cronjobs/a2billing_invoice_cront.php
    #Check if balance below preset value, and email user if so.
    1 * * * * php /usr/local/src/a2billing/Cronjobs/a2billing_notify_account.php
    #Charge subscriptions at 06:05 on the 1st of each month
    0 6 1 * * php /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php
    #Update currencies at 01:00 each day
    0 1 * * * php /usr/local/src/a2billing/Cronjobs/currencies_update_yahoo.php
    " >> /var/spool/cron/asterisk
    
    
    20.
    mkdir -p /var/log/a2billing
    touch /var/log/asterisk/a2billing-daemon-callback.log
    touch /var/log/a2billing/a2billing-daemon-callback.log
    touch /var/log/a2billing/cront_a2b_alarm.log
    touch /var/log/a2billing/cront_a2b_autorefill.log
    touch /var/log/a2billing/cront_a2b_batch_process.log
    touch /var/log/a2billing/cront_a2b_bill_diduse.log
    touch /var/log/a2billing/cront_a2b_subscription_fee.log
    touch /var/log/a2billing/cront_a2b_currency_update.log
    touch /var/log/a2billing/cront_a2b_invoice.log
    touch /var/log/a2billing/cront_a2b_check_account.log
    touch /var/log/a2billing/a2billing_paypal.log
    touch /var/log/a2billing/a2billing_epayment.log
    touch /var/log/a2billing/api_ecommerce_request.log
    touch /var/log/a2billing/api_callback_request.log
    touch /var/log/a2billing/a2billing_agi.log
    chown asterisk:asterisk /var/log/asterisk/a2billing-daemon-callback.log
    chown -R asterisk:asterisk /var/log/a2billing
    
    
    21. vim /etc/asterisk/manager_custom.conf
    Add the following lines at the end of the file
    [myasterisk]
    secret = mycode
    deny=0.0.0.0/0.0.0.0
    permit=127.0.0.1/255.255.255.0
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user
    
    
    22. asterisk -rx "module reload"
    
    
    
    NOTE:
    User: root
    Password: changepassword
    
    I havent yet test a2billing functionality, you will need to test it, and tell me if there is any issue
     
  3. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Nice update jgutierrez

    I suspect you might need to append:-

    mysql_fix_privilege_tables --password=eLaStIx.2oo7

    for a "new" install, on an Elastix box.

    I might also suggest that lines 2-"the end of section 12" could be replaced effectively with:-


    touch -t 1001130600 /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql

    # that to fix a temporal discontinuity at a2billing

    for i in `ls -X /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.*`;do (/usr/bin/mysql mya2billing -u root -peLaStIx.2oo7 < $i ) ;done

    seeing as you are svn'ing the trunk and this directory will unlikely remain static (it changed a couple of times in the last few weeks)

    regards

    dicko
     
  4. bhallottawa

    Joined:
    Jun 6, 2010
    Messages:
    14
    Likes Received:
    0
    this worked great except...

    using root / changepassword I cannot log in.

    suggestions?
     
  5. bhallottawa

    Joined:
    Jun 6, 2010
    Messages:
    14
    Likes Received:
    0
    I ran this command:
    update cc_ui_authen set pwd_encoded='410fc6268dd3332226de95e42d9efa4046c5463769d7493b85e65cfa5c26362dc2455cc23c0bc5831deb008def4ab11a9eaa9b76ba3f377da134f39ec60dd758' where login='root';

    to change the password for root to "password" MySQL returned 1 row matched but didn't do the update.
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    You probably shouldn't have done that, that was for 1.4, by my math 1.4 <> 1.7, things change, so do concepts of security. It always helps to know what you are doing. It should just work after you use the UI to do the changes, but if you are struggling try the a2billing forum, they will likely be more authoritative. Or in your case I suggest you start over AFTER doing that RTFM thingy :)

    dicko
     
  7. chimo

    Joined:
    Apr 24, 2010
    Messages:
    71
    Likes Received:
    0
    Thank you for the good realized work, all the steps OK.

    The problem is that when I introduce the user and the password he says the following message to me:

    Error : A2Billing configuration file is missing!

    Solved copying again the file /etc/a2billing.conf

    THANK YOU VERY MUCH.


    -------------

    Gracias por el buen trabajo realizado, todos los pasos OK.

    El problema es que cuando introduzco el usuario y el password me dice el siguiente mensaje:
    Error : A2Billing configuration file is missing!

    Solucionado copiando de nuevo el fichero /etc/a2billing.conf

    MUCHAS GRACIAS. :woohoo:
     
  8. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    Yes, that is correct, that was why on step #5 and step #6, you will see that a2billing.cong is placed under the /etc/ directory
     
  9. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    jgutierrez escribió:
     
  10. chimo

    Joined:
    Apr 24, 2010
    Messages:
    71
    Likes Received:
    0
  11. bhallottawa

    Joined:
    Jun 6, 2010
    Messages:
    14
    Likes Received:
    0
    Re: Re:Update 1.3.0 > 1.7.1

    Dicko;

    thanks for your help on this.
    the good news is that for no reason other than strange luck it worked this morning BEFORE i started from scratch.

    I laughed on the RTFM comment considering that's what I preach to my own customers... sadly what seems simple needs a manual :)

    Bob
     
  12. westalex

    Joined:
    Jun 5, 2010
    Messages:
    1
    Likes Received:
    0
    Hi,

    Please go easy on me as this is my first post and I'm fairly new to linux and Elastix.

    The script ran fine for me, but I've notice that the a2billing.conf is quite different after the installation. I only noticed this when I needed to change the base_currency settings which for some reason is no longer present in the new a2billing.conf file.

    I've been trying to search on the forum and on google, but to no avail... Can you please help? Thanks Alex
     
  13. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    Re: Re:Update 1.3.0 > 1.7.1

    After step number 10, I get the following message: "mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'"
    What is wrong?
     
  14. slguru

    Joined:
    Dec 7, 2007
    Messages:
    4
    Likes Received:
    0
    Hello,

    what version of Elastix you are using,


    if you are using the latest version then you had to select a different password than the default one, hence you will have to change the passwords given the script accordingly.
     
  15. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    Re: Re:Update 1.3.0 > 1.7.1

    Version 2.0.1, 32 bits, I understood that I must add -p to ask me the password, eg "drop mya2billing mysqladmin-u root -peLaStIx.2oo7 -p"

    Thanks
     
  16. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    dicko escribió:
    Where do you recommend running "mysql_fix_privilege_tables --password=eLaStIx.2oo7"...As a first step?
     
  17. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    westalex escribió:

    Read http://bit.ly/bwBv6e
     
  18. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Re: Re:Update 1.3.0 > 1.7.1

    almost, you have ". . . -peLaStIx.2oo7 -p . . ."
    the first -p uses the old password the second overrides and as it is empty asks for a password.

    In Elastix 2.0 and above I suggest that the install script could be improved by replacing that bit with



    -p`cat /etc/elastix.conf |grep mysqlrootpwd|cut -d "=" -f 2`

    this wherever in the script it needs mysql access

    (notice the back-ticks, it will pull the mysql root password form /etc/elastix.conf)

    dicko
     
  19. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    jgutierrez escribió:
    The problem is; in step 5, a2billing.conf was copied to /etc/ and the step 13 line 8 is deleted,
     
  20. Chileno

    Joined:
    Dec 2, 2009
    Messages:
    63
    Likes Received:
    0
    Re: Re:Update 1.3.0 > 1.7.1

    dicko escribió:
    Do you mean, replace the last 2 lines of section 12 with "touch -t 1001130600 /usr/local/src/a2billing/DataBase/mysql-5.x/UPDATE-a2billing-v1.4.4-to-v1.4.4.1.sql" ?
     

Share This Page