Getting yourself set up with SmoothTorque

While we prefer to get things set up for you so that we can be sure that SmoothTorque meets your needs and is installed correctly, we realise the need to get something now and try it out.

If you would like us to set up a demonstration for you, please send us a note and we'll get everything set up as soon as possible.

Steps to try out SmoothTorque

If you have a clean Debian Linux machine, you can use the automatic installer script

Alternatively, just follow the instructions below

  1. Install prerequisites

    You will need to have the MySQL client libraries and server as well as valgrind and screen installed. You can do this on Debian (which we recommend) by typing:

    apt-get install mysql-server
    apt-get install valgrind
    apt-get install screen
    apt-get install apache2
    apt-get install php5
    apt-get install php5-cli
    apt-get install php5-mysql
    apt-get install php5-gd
    apt-get install subversion
    apt-get install sox
    apt-get install rsync
    /etc/init.d/apache2 restart
    rm /var/www/index.html
    touch /stweb.conf

    If you prefer to use a Redhat based OS (i.e. RedHat EL, CentOS, Fedora etc) you can install these by typing:

    yum install mysql
    yum install mysql-devel
    yum install mysql-server
    yum install valgrind
    yum install screen
    yum install httpd
    yum install php
    yum install php-cli
    yum install php-mysql
    yum install php-gd
    yum install subversion
    yum install sox
    yum install rsync
    /etc/init.d/httpd restart
    touch /stweb.conf

    Note: if you are using a 64 bit operating system you will need to perform some extra steps.

    The easiest way is to replace SmoothTorque with SmoothTorque_64 in the wget command and then once you've downloaded it, type:

    mv SmoothTorque_64 SmoothTorque

    Ok, so let's continue with a normal install.

  2. Download and install SmoothTorque

    mkdir /SmoothTorque
    cd /SmoothTorque
    wget http://www.venturevoip.com/SmoothTorque
    wget http://www.venturevoip.com/vg
    chmod +x ./SmoothTorque
    chmod +x ./vg
  3. Download and install the web controller

    Debian/Ubuntu:
    cd /var/www
    svn co --username web svn://data.venturevoip.com/trunk/SmoothTorqueWebsite .
    CentOS/Fedora/Redhat Enterprise:
    cd /var/www/html
    svn co --username web svn://data.venturevoip.com/trunk/SmoothTorqueWebsite .

    Just press Enter for password

    Next you will need to copy the upload.cgi file to your cgi-bin directory (normally /usr/lib/cgi-bin)

    Debian/Ubuntu:
    cp upload.cgi /usr/lib/cgi-bin
    CentOS/Fedora/Redhat Enterprise:
    cp upload.cgi /var/www/cgi-bin
  4. Get a demo license

     

  5. Edit the vg script

    You will need to edit the vg script you have just downloaded to add in your username and license key.

    nano /SmoothTorque/vg
    

    Change the usename and license key values and press CTRL-x. It will ask you if you want to save your changes. Press y for yes.

  6. Log into the website

    Once you connect to the website you can use the username admin and the password adminpass.

    Don't forget to change the password by going to the customers section. Tutorial Video

    Add an Asterisk Server

    The next thing you're going to want to do is create a MySQL account for Asterisk to log in to (replace CDRPASS with a password you'd like Asterisk to use):

    mysql
    grant ALL on SineDialer.cdr to 'cdr'@'%' identified by 'CDRPASS';
    flush privileges;
    quit

    You will need to change MySQL to listen on 0.0.0.0 rather than 127.0.0.1. You can do this by editing /etc/mysql/my.conf and changing bind-address from 127.0.0.1 to 0.0.0.0

    After you've done this you will need to restart MySQL by typing:

    /etc/init.d/mysql restart
    
  7. Set up automatic cron jobs
    Ok, the next thing you'll need to do is set up a cronjob. This will copy any files that are uploaded to the web server to the Asterisk server(s).

    It's a few steps:

    • Set up SSH no password
      This is possibly outside the scope of this document, but the idea is that you want the web server to regularly rsync the uploads directory with /var/lib/asterisk/sounds on the Asterisk machines.

      I've taken the instructions for this from http://linuxproblem.org/art_9.html

      Let's call the apache server A and the Asterisk server B. So, on machine A you need to type:

      cd ~
      ssh-keygen -t rsa

      Just press enter for all the prompts.
      Next you need to create the .ssh directory on the Asterisk server (repeat for multiple servers and replace B with the ip address of the Asterisk machines):

      ssh root@B mkdir -p .ssh
      cat .ssh/id_rsa.pub | ssh root@B 'cat >> .ssh/authorized_keys'

      While you're doing this you will need to enter passwords, but once you've done the last step above you should be able to SSH to the Asterisk machine from the apache machine without enterring a password.

    • Set up the cron job
      Okay, this one is pretty easy. Just type crontab -e and then add the following line to the bottom, replacing B with the IP address of your Asterisk machine - repeat for multiple machines. This should be all on one line.

      * * * * * /usr/bin/rsync -rae 'ssh -p 22' /var/tmp/uploads/ B:/var/lib/asterisk/sounds/
    • Additional cronjobs
      There are a few extra cronjobs you can run if you like. First is the billing. There are some files in the cron/ directory inside the web site which you can use for this. If you are expecting heavy load, you can also set up a script to create a .png file from the statistics rather than generating it for every viewing - if you'd like to do this, get in touch with us.

  8. Set up your Asterisk server

    You can follow this link to explain how to set up and install Asterisk.

  9. Set up and run the backend

    Go back to your SmoothTorque machine and type the following

    cd /SmoothTorque/
    screen ./vg


    to disconnect press CTRL-a then press d
    to reconnect type screen -x