Adsense 1

Monday, April 06, 2009

AsteriskNow 1.5 + installation and configuartion

AsteriskNow 1.5 was recently released. I already had a box with 1.0.2 version and thought of giving the new version a try. Downloaded the ISO from the site and burned it to a CD. The new version is built on CentOS 5.3. I installed the new version in the same system overwriting 1.0.2. Note that the installation did not detect the old version nor did it give me any option for upgrade. Since my server was not in production i went ahead removing all the partitions and reinstalled the new version. If you have a production box backup the configuration files or install the new version in a test system and then copy the existing setup/accounts. You have been warned.

I installed AsteriskNow with the default partitions schema ( it creates all partitions under a single LVM). Once installation is complete, remove the CD and click reboot. After the OS boots it asks to configure the following:

Authentication, Firewall, Network, System Services

Authentication - Configure any extra authentication such as ldap.
Firewall - You can enable firewall (remember to allow all required ports like sip, iax & zap) if needed.
Network - Configure you network interfaces. This config sets the IP address of all interfaces in the system. Note that eth0 alone is enabled by default. Other interfaces must be enabled manually(Edit /etc/sysconfig/network-interfaces/ifcfg-ethx and set ONBOOT=yes).
System Services - Disabled any unwanted services.

After the above is done exit the wizard to login to the box. You will also have to restart the network service to enable all interfaces after login to the system as root. Immediately after the first login i ran a update

# yum update.

This installed a new version of kernel(2.6.18-128.1.6.el5), asterisk and dahdi modules. So i rebooted the box.(Default kernel is 2.6.18-128.1.1.el5).

After the system reboots, open the web interface in your favourite browser: http://<your-asterisk-server-ip>. When you click the FreePBX Administration link it asks you to enter the password. Asterisk 1.5 by default has two administrator user accounts with default password as specified below.
Username admin, Password - admin
Username freepbx, Password - fpbx

We will now change the default password of both admin accounts and secure the system. First let us change the admin user's password. In the web interface select Administrators tab in the Basic section. Click the admin user (in the top right) and give the new password of your choice. We are done.

Note: I did the following changes from root login in the asterisk box. The web interface prompts you to reload the config after every change you do. You can reload the config after all the changes are done.

To change freepbx user's password you have to change the entries in two files (we will backup the original files) and also change the mysql password.
# cd /etc/
# cp amportal.conf amportal.conf.orig
# vi amportal.conf
AMPDBPASS=<new password>

# cd /etc/asterisk
# cp cdr_mysql.conf cdr_mysql.conf.orig
# vi cdr_mysql.conf
password=<new password>
Now we will change the password for mysql:
# mysql -p  (Just press enter in the password Prompt)
mysql > SET PASSWORD FOR freepbx@localhost=PASSWORD('new password');
The web interface reports the following errors at this point (Yes, these errors are there in the fresh installation itself).

Notice Memory Limit Changed - To fix this edit /etc/php.ini and change memory_limit=100M. (You have to restart httpd after this).

Default Asterisk Manager Password Used:

You have to change this in two files
# cd /etc/
# vi amportal.conf
AMPMGRPASS=<new password>

# cd /etc/asterisk
# cp manager.conf manager.conf.orig
# vi manager.conf
secret = <new password> (Must be same as what you gave for AMPMGRPASS in amportal.conf).

No email address for online update checks - Go to General Settings Tab under Basic and give an email address in the Update Email: text box. (I have given my email id here).

Could not reload FOP server - For this we will first install the newest FOP version and then setup httpd to run as asterisk user (By default httpd runs as apache user).
# cd /root
# wget http://www.asternic.org/files/op_panel-0.29.tar.gz
# cd /var/www/html/panel
# cp op_server.pl op_server.pl.orig
# cp operator_panel.swf operator_panel.swf.orig
# tar zxfv /root/op_panel-0.29.tar.gz
# cp op_panel-0.29/flash/operator_panel.swf .
# cp op_panel-0.29/op_server.pl .
# cd /var/lib/asterisk/bin/
# ./retrieve_conf

# cd /etc/httpd/conf
# cp httpd.conf httpd.conf.orig
# vi httpd.conf
Find the line User apache and change it to User asterisk. Save the file and exit.
# service httpd restart

After this click on Apply Configuration Changes in the web interface. Then the webinterface reports about module upgrade. Goto Module admin tab and click Check for upgrade online. Click Upgrade all and then click Process. Press Confirm. All modules will upgrade automatically.

Now there won't be any errors or other warnings in the web interaface. You can create extensions, inbound/outbound settings as required.

I found fixes from the following links:
http://www.freepbx.org/forum/freepbx/users/freepbx-panel-flashing-red-and-green
http://www.asternic.org/
http://www.freepbx.org/support/documentation/faq/changing-the-asterisk-manager-password

61 comments:

  1. Great posting!

    A little bit strange that AsteriskNOW and its included components does not just work out of the box...

    But I did follow these steps. The "Could not reload FOP server" remains. And there is an new error: "Failed to copy from module agi-bin", with lot's of similar messages like this:

    Retrieve conf failed to copy file(s) from a module's agi-bin dir: copy(/var/lib/asterisk/agi-bin/recordingcheck): failed to open stream: Permission denied.

    Frode

    ReplyDelete
  2. Ignore previous posting. Now everything works :) For some reason ;)

    Frode

    ReplyDelete
  3. Glad to know that it worked.

    Me too got the "Failed to copy from module agi-bin" error in the middle. But that went away after a reboot of the server.

    ---
    SK

    ReplyDelete
  4. Fantastic. Great job! Thanks for the help.

    ReplyDelete
  5. Though, a little odd, not sure why, but immediately after changing the default fbpx user's password and mysq password, the web interface gives an immediate error:

    "FATAL ERROR
    DB Error: connect failed"

    I assume the password to the DB isn't working properly but reviewing the two altered conf files, it appears that the passwords are in fact identical. Not sure what I'm missing here.

    ReplyDelete
  6. Me too got that error after setting the password in the files and just before setting the mysql password for freepbx user.

    It will go away once you set it up with:
    SET PASSWORD FOR freepbx@localhost=PASSWORD('new password');

    'new password' in the above command must be same as what you set in the amportal.conf & cdr_mysql.conf

    HTH
    SK

    ReplyDelete
  7. This is nice Saravana, but I have a few comments.

    Some of the issues you're facing are my fault - I'm the author of AsteriskNOW 1.5 - so I'm going to see what I can do to fix them in the future.

    The first and biggest problem I saw was running apache as user 'asterisk'. I went through quite a bit of effort to make it so this isn't required. It ends up being a security nightmare, and you just don't want to do it. If there's a problem that requires it, please let me know and I can fix it.

    The other thing was the agi-bin copy errors. Somebody recently pointed out that the 'asterisk' user is being added in the post-install section of the RPM rather than pre-install. When I change this for future builds, that problem should go away.

    ReplyDelete
  8. I don't think there is any security risk in running httpd as User asterisk. As far as i can see, asterisk is just a normal user like apache.

    The error "Could not reload FOP server" doesn't go away unless httpd is setup to run as asterisk. It may be because op_server.pl itself is running as user asterisk?

    ---
    SK

    ReplyDelete
  9. Hi,

    Thanks for the Post,Following your steps it was Perfect.
    Please keep update your Blog.
    Also can you guide me to configure asterisk for me.

    Thanks,
    Balaji S

    ReplyDelete
  10. I can guide you through. Let me know your requirements.

    ---
    SK

    ReplyDelete
  11. Thanks dude!

    ReplyDelete
  12. I followed the mysql changes to try to get past the DB Error to connect but was unable to do so.

    The following changes worked for me modified from here (http://www.trixbox.org/forums/trixbox-forums/open-discussion/change-default-sql-password-freepbx-version-2-6)

    Step 1) mysql -u root –p [ENTER]
    Step 2) Enter password: [ENTER]
    Step 3) mysql> use mysql; [ENTER]
    Step 4) mysql> update user set password = PASSWORD('NEW_PASSWORD') where User = 'freepbx'; [ENTER]`
    Step 5) mysql> grant all privileges on *.* to freepbx@localhost identified by ''NEW_PASSWORD ' with grant option; [ENTER]
    Step 6) mysql> exit [ENTER]

    ReplyDelete
  13. I have installed asterisknow-1.5.0 . In the freepbx admin screen, i couldn't see the IVR or voice menu options can you please help me configuring IVR

    ReplyDelete
  14. IVR is available as module. You can go to Module Admin and click on Check for updates online.

    I haven't configured it myself so can't be of much help.

    ReplyDelete
  15. Thanks for the help. I got the module

    ReplyDelete
  16. Thanks a lot ! helpful :)

    ReplyDelete
  17. I'm having serious problems trying to browse to the GUI via IE or Firefox after a complete install. I can go in via SSH to command line but I get no web based GUI. :( help me please.

    Carl

    ReplyDelete
  18. i have new installation using asterisk pbx server butt i want to logon system configuration i dont know whts default pasword of system configuration
    plz help m

    ReplyDelete
  19. Thanks a ton for this information.
    I did notice when I ran the mysql command it said 0 rows affected so I changed the password through webmin which I installed. While the phone systems have been running great it is nice to get the nag messages off of the front screen.

    ReplyDelete
  20. Hi, thanks for your step by step information..............I am currently having an issue with the calls done. I am making calls thru Xlite softphones and when I look the traffic in wireshark it shows me that the RTP packets are going to server and then to destination. How can I change this so that the Packets get delivered directly to the phone

    ReplyDelete
  21. This was a very clear step by step. Thank you very much for the post my 2 cents would be the link for the FOP is now op_panel-0.30.tar.gz. It is difficult to see hte underscor between op_panels since this is treated as a link in the post

    ReplyDelete
  22. How can I make both the Xlite softphones to communicate directly while rtp....

    ReplyDelete
  23. I a RHEL 4 administrator with no Asterisk experience. I download AsteriskNow and thanks for your BLOG entry! It took only an hour to get a
    clean system.

    I also had to do a reboot, and then a reconfig, to clear the FOB and bin errors reported above.

    THanks a million!

    ReplyDelete
  24. Super useful post, thanks so much. This information is essential when doing a fresh install! Great work!

    ReplyDelete
  25. Is a good post, but a CDR report always empty.
    Do anybody helps?

    ReplyDelete
  26. ok IT WORKS NO ERRORS but i have to say to get rid of the FOP Server thingy you need to go and install the framework on the module admin check for updates. If it's not installed won't work. Now i have a quetion: I am trying to setup a machine that has public ip and i need to connect with 2 cell phones using WIFI internet on them, both phones have SIP ( NOKIA E71 ). How do i do the rest of the server configurations for 2 extensions let's say 1000 and 2000. Thank you.

    ReplyDelete
  27. Hi Thanks for this help.
    I changed the user from apache to asterisk in httpd.conf
    This solves the problem of "could not reload FOP server" however now no records are present in the CDR database.
    I changed back to apache as user and CDR records returned ?

    ReplyDelete
  28. Did you try this? http://techsk.blogspot.com/2009/05/reports-work-in-asterisknow-15.html

    ReplyDelete
  29. You can setup extensions under Setup->Basic->Extensions.

    You can add SIP/IAX2/ZAP extensions and then setup the account in your WIFI phone.

    I haven't configured wifi phones myself, so i am sure how/whether they work.

    ReplyDelete
  30. Thanks yes I did try this yum update asterisk-addons-mysql as I had to do this to get it working in the beginning with a fresh install.
    After the above changes it stopped working again

    ReplyDelete
  31. You say: After the above changes it stopped working again

    I assume you are talking about reports. If you have done something that made stopped the reports then it is better to revert it back.

    If you have installed new asterisk-addons package then you may also have to reset the password.

    The above setup worked for me. Did you get any error message?

    ReplyDelete
  32. Hi... great post...

    I am having problem with my softphone... I am using Idefisk softphone but unable to connect it to asterisk .. can you please guide me on that?

    ReplyDelete
  33. Great post.

    ReplyDelete
  34. excellent information!.

    I have the same problem: "FATAL ERROR DB Error: connect failed"

    I have the same password in amportal.conf & cdr_mysql.conf but when I do the "SET PASSWORD FOR freepbx @ localhost = PASSWORD ( 'new password');" says 0 rows affected.

    anyone can tell me what can I do?

    ReplyDelete
  35. About: "FATAL ERROR DB Error: connect failed"
    after SET PASSWORD with 0 rows

    I'm Sorry, but I do nothing and IT'S WORKING AGAIN, only restarting both computers.

    Thanks a lot!

    ReplyDelete
  36. I found what I needed to fix the cdr no records issue mentioned above
    chown -R asterisk:asterisk /var/lib/php/session
    solved it

    ReplyDelete
  37. after changing the password for the Asterisk Manager I have the NEXT error:

    retrieve_conf failed, config not failed appliedReload Because retrieve_conf encountered an error: 126
    Added 5 minutes ago
    (freepbx.RCONFFAIL)

    please help me!!!

    ReplyDelete
  38. hi..
    a newbie to asterisk and just try to play around with it. I just installed asteriskow 1.5 to my pc nad try to test the extension.

    I just want to initiate a call from an extension to another extension in the same network. I have one Xlite and 2 analog phones. analog phones are connecting to tdm400p(which is plug in the asterisk server). I already make sure it connected to FXS port. after i connect it to port, i receive no dial tone but when i press buttons, i heard the tone.but it doesnt have dial tone. Xlite have no problem. it connected to server. but when i try to call to the analog phone, i'll receive whether voicemail, busy or num not available..

    can someone help me? is it i need to doing some command setting to make extension connected to each other?

    TQ..

    ReplyDelete
  39. Can anyone guide me on setting up Call recording in *now 1.5 ,please .

    ReplyDelete
  40. Check Feature Codes under Setup in the web interface.

    ---
    SK

    ReplyDelete
  41. thank you... this helped a lot

    newbie in Belgium

    ReplyDelete
  42. Hi Saravana
    Quick Question
    is this possible t create realtime/Dynamic in AsteriskNow 1.5

    ReplyDelete
  43. Please help me I am having a problem connecting my softphone i.e. Idefisk 1.37 to asterisknow 1.5, it keep giving me error "Failed registration for 101@192.168.15.26" please help me

    ReplyDelete
  44. Hi,
    Does AsteriskNOW 5.1 or AstriskWin32 0.66b supports SIP over TCP ?

    ReplyDelete
  45. Try checking logs for errors shown regarding connection problems. That should give you some clue.

    If you are using IAX in Idefisk read this: http://techsk.blogspot.com/2009/09/asterisk-updates.html

    ---
    SK

    ReplyDelete
  46. This was a great help. Thanks. I couldn't log in at all until I read this. Most of the posts I found indicated that the default password was wmp111 and it was very frustrating. Thanks again.

    ReplyDelete
  47. Still having problems with FOP error messages. Using the new Asterisk now. Even on a fresh install, the errors are already there.

    ReplyDelete
  48. Million thanks, got it working great. :)

    ReplyDelete
  49. Excellent info, well presented. This was extremely helpful. Thank you.

    ReplyDelete
  50. Excellent info and well presented! Great thanks! !

    ReplyDelete
  51. Hi great post, you said earlier "(Edit /etc/sysconfig/network-interfaces/ifcfg-ethx and set ONBOOT=yes).
    System Services - Disabled any unwanted services.
    "

    How? I am unable to do this i can see ifcfg-eth1 but can't editit!

    ReplyDelete
  52. Hello,

    Thanks for the guide! It is indeed very helpful. I changed the msql password to something I made up and now nothing works any more. Of course I was following along and did not remember to check what the existing password was.

    Sooo... why change the password and where else do I need to change it? Do I need to change it to something in particular?

    Thank you!

    ReplyDelete
  53. Hi, I am having a problem with AsteriskNow 1.5 installation, I am trying to install it on my IBM server, the problem is that when I start the installation it shows that its looking for the SCSI driver the it ask me for the CentOS CD, I thought the ISO image CD is all I need to install the AsteriskNow.
    Thank you

    ReplyDelete
  54. I am new to AsteriskNow and trying to test system with a POTS line. I have a TDM40o with 2ea FXS & 2ea FXO modulkes. What configuration is needed to have the system use the board?

    ReplyDelete
  55. Very usefull.
    And also all the comments are usefull.

    Thank you all!

    ReplyDelete
  56. SUPER THANK YOU...GREAT...GOOD JOB.

    ReplyDelete
  57. I followed these instructions over a month ago
    and they worked.
    I performed an yum on the asterisknow 1.5 box
    and freepbx was updated from 2.5.x to 2.7.0.

    Now the thing doesn't work.

    I trashed the box, when through the instructions
    here.

    As of today, the yum update contains freepbx 2.7
    which has stopped sipgate.co.uk and phone access
    working.
    Still get the FOP error.

    http://www.freepbx.org/forum/freepbx/installation/freepbx-2-7-0-2-asterisk-now-update-no-sipgate-or-phone-access

    ReplyDelete
  58. Noob from NYC, thank you!
    Concise, Accurate &
    even better follow up!

    please post a first steps manual : \

    ReplyDelete
  59. Asterisk Now 1.7 with latest FreePBX.
    There is no way default admin password will change. I followed your instructions and in both config files new pass is inserted but Im still able to log on as: admin/admin
    (I did clean the browser cache).
    Any idea how to disable default admin user?

    ReplyDelete
  60. Fantastic.Great job! Thanks for sharing.


    Network support Chiswick

    ReplyDelete