PIONEERS VirtualBox: IncrediblePBX for XiVO

Discussion in 'Developers' Corner' started by wardmundy, Aug 19, 2016.

  1. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    If any of you have a little spare time this weekend, we could use a few pioneers to test out our new IncrediblePBXforXiVO.ova image for VirtualBox.

    The install and setup only takes a couple minutes and should ease the pain for those wanting to kick the XiVO tires. Should run on any VirtualBox platform including Windows, Mac, and Linux desktops.

    This will be our first turnkey installer for XiVO so it's probably wise to expect a few surprises. And, yes, we've had a few.:death:
     
    #1 wardmundy, Aug 19, 2016
    Last edited: Aug 20, 2016
    Sylvain Boily likes this.
  2. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    [​IMG]

    1. Install VirtualBox on your Windows, Mac, or Linux desktop computer.

    2. Download latest IncrediblePBX-XiVO.ova image to your desktop from SourceForge.

    3. Double-click on the .ova image to load it into VirtualBox.

    When prompted, be sure to check the Reinitialize the Mac address of all network cards box and then click the Import button. Once the import is finished, you’ll see a new Incredible PBX virtual machine in your VM List on the VirtualBox Manager Window. We need to make a couple of one-time adjustments to the VirtualBox VM configuration to account for differences in sound and network cards on different host machines.

    Single-Click on the Incredible PBX for XiVO Virtual Machine in the VM List. Then click Settings -> Audio and check the Enable Audio option and choose your sound card. Save your setup by clicking the OK button. Next click Settings -> Network. For Adapter 1, check the Enable Network Adapter option. From the Attached to pull-down menu, choose Bridged Adapter. Then select your network card from the Name list. Then click OK. That’s all the configuration that is necessary for your virtual machine. The rest is automagic. Complete setup only takes a minute or two.

    Once you’ve imported and configured the Incredible PBX Virtual Machine, you’re ready to go. Highlight IncrediblePBX Virtual Machine in the VM List on the VirtualBox Manager Window and click the Start button. The boot procedure will begin just as if you had completely installed and set up Incredible PBX for XiVO on a standalone machine. You’ll see a couple of dialogue boxes pop up that explaining keystrokes to move back and forth between host operating system desktop and your virtual machine. Remember, you still have full access to your desktop computer. Incredible PBX for XiVO is merely running as a task in a VirtualBox window. Always gracefully halt Incredible PBX just as you would on a dedicated computer.

    Here’s what you need to know. To work in the Incredible PBX Virtual Machine, just left-click your mouse while it is positioned inside the VM window. To return to your host operating system desktop, press the right Option key on Windows machines or the left Command key on any Mac. For other operating systems, read the dialogue boxes for instructions on moving around.

    Access the Linux CLI and login as root with the default password: password. Setup will be completed automatically after you login the first time.

    • Change your root password immediately: passwd (now handled as part of install)
    • Set your correct time zone: /root/timezone-setup (now handled as part of install)
    • Add WhiteList entries to firewall if needed: /root/add-ip or /root/add-fqdn
    • If you use add-fqdn, remember to add the FQDN entries to /root/ipchecker!
    • Store PortKnocker credentials in a safe place: cat /root/knock.FAQ
    • Login to your NeoRouter VPN server if desired: /root/nrclientcmd
    • Change XiVO GUI root password using admin-pw-change: (now handled as part of install)
    Once the initial setup is complete, access the XiVO GUI with a web browser. Username: root Password: as set during initial install procedure

    Continue on with final steps in the Incredible PBX for XiVO tutorial starting here to create users, trunks, and default routes.

    Google Voice scripts already are in place in /root. If you want to set up a Google Voice OAuth trunk, run: /root/add-gvtrunk.

    Feedback appreciated!
     
    #2 wardmundy, Aug 19, 2016
    Last edited: Aug 23, 2016
  3. Sylvain Boily

    Sylvain Boily Active Member

    Joined:
    Apr 30, 2016
    Messages:
    258
    Likes Received:
    143
    For information we use a lot virtualbox when we develop on XiVO. We also use KVM with virsh and Openstack.
     
    wardmundy likes this.
  4. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    DNS issue fixed. Password and timezone setup has been moved to installer. Install profile glitch fixed.
     
    #4 wardmundy, Aug 20, 2016
    Last edited: Aug 20, 2016
  5. wa4zlw

    wa4zlw Member

    Joined:
    Feb 14, 2008
    Messages:
    845
    Likes Received:
    22
    I'm going to give it a shot and virtualbox is on my laptop with 32gb ram!
     
  6. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    FYI: phpPgAdmin (for PostgreSQL web browsing/management) is included in this build. Go to http://IP address/phppgadmin/.

    For obvious reasons, DON'T EVER DISABLE YOUR FIREWALL!

    Credentials are asterisk:proformatique

    Don't Break Anything: Look But Don't Touch -- asterisk.Schemas.public reveals Asterisk RealTime Platform :idea:
     
    #6 wardmundy, Aug 20, 2016
    Last edited: Aug 20, 2016
  7. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    Sunday, 8/21 Update available NOW!

    • Added extension 701 with randomly-generated numeric password
    • Extension 701 credentials displayed at end of the one-minute install
    • Fixed *88 Alarm app which was broken during VirtualBox config
    • Removed duplicate xivo-extrafeatures-festival.conf from dialplan path
    • Installer now lets user set a PIN for 123 Telephone Reminders
    • Added ntpdate package
    I think we've finally mastered the art of resetting extension passwords programatically. See /root/incrediblepbx.sh for the secret sauce. :chef:

    Perfection* is just around the corner. :boat:
     
    #7 wardmundy, Aug 21, 2016
    Last edited: Aug 21, 2016
  8. Sylvain Boily

    Sylvain Boily Active Member

    Joined:
    Apr 30, 2016
    Messages:
    258
    Likes Received:
    143
    You know by default 7XX is use by parking? I'm not sure it's good idea to use this range. Or change the parking configuration.
     
    wardmundy likes this.
  9. briankelly63

    Joined:
    Nov 14, 2008
    Messages:
    1,401
    Likes Received:
    319
    I like 100,200,300 range for floors
     
    wardmundy and Sylvain Boily like this.
  10. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    Never dull. To avoid reworking the original installer AND the .ova design, I opted to move parking extensions to 751-799 range. This leaves 701-750 for extensions for those that want to use the turnkey design. Will adjust the original installer with all the nuggets we've discovered building this .ova image... including this one.

    Monday, 8/22 Update will be available at 8:30 a.m. EDT.
     
    #10 wardmundy, Aug 22, 2016
    Last edited: Aug 22, 2016
  11. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
  12. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    Last Minute Fixes That Didn't Make It Into Current Build

    Using AsteriDex Click-to-Dial. On the VirtualBox platform only, you'll need to update the line entry to match extension 701 with the following command:

    Code:
    sed -i 's|8zqnfdpw|m1hqy5f3|' /var/www/html/asteridex4/config.inc.php
     
    #12 wardmundy, Aug 24, 2016
    Last edited: Aug 28, 2016
  13. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,701
    Likes Received:
    2,512
    XiVO tends to be very chatty in its logs. You can turn most of this off once you are satisfied that you have a stable and secure server. This gets everything turned off except Asterisk and Fail2Ban errors plus the following XiVO logs: xivo-dxtora.log, xivo-provd.log, xivo-sysconfd.log, xivo-websocketd.log.

    Code:
    cd /etc
    echo 'logfile: "/dev/null"' > /etc/xivo-nologs.yml
    echo 'log_filename: "/dev/null"' >> /etc/xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-dao/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-agentd-cli/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-websocketd/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-dird/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-auth/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-amid/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-agid/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-purge-db/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-ctid-ng/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-confgend/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-dird-phoned/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-agentd/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-ctid/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-call-logd/conf.d/050-xivo-nologs.yml
    ln -s /etc/xivo-nologs.yml /etc/xivo-confd/conf.d/050-xivo-nologs.yml
    xivo-service restart
    systemctl daemon-reload
    
    mv /etc/asterisk/logger.conf /etc/asterisk/logger.conf.orig
    echo "[general]" > /etc/asterisk/logger.conf
    echo "queue_log = yes" >> /etc/asterisk/logger.conf
    echo " " >> /etc/asterisk/logger.conf
    echo "[logfiles]" >> /etc/asterisk/logger.conf
    echo "console => error" >> /etc/asterisk/logger.conf
    echo "messages => error" >> /etc/asterisk/logger.conf
    echo "full => error" >> /etc/asterisk/logger.conf
    echo "fail2ban => error" >> /etc/asterisk/logger.conf
    chown asterisk:www-data /etc/asterisk/logger.conf
    chmod 660 /etc/asterisk/logger.conf
    /etc/init.d/asterisk restart
    
    sed -i 's|/var/log/nginx/xivo.access.log|off|' /etc//nginx/sites-enabled/xivo
    sed -i 's|/var/log/nginx/xivo.error.log|off|' /etc//nginx/sites-enabled/xivo
    /etc/init.d/nginx restart
    
    You also can clean out your logs periodically by adding these lines to /etc/crontab:

    Code:
    10 1    * * *  root    rm -f /tmp/tts* > /dev/null 2>&1
    11 1    * * *  root    rm -f /var/log/asterisk/*.gz > /dev/null 2>&1
    11 2    * * *  root    rm -f /var/log/asterisk/*.1.gz > /dev/null 2>&1
    12 1    * * *  root    rm -f /var/log/*.1.gz > /dev/null 2>&1
    12 3    * * *  root    rm -f /var/log/*.2.gz > /dev/null 2>&1