Sunday, December 19, 2010

Configuring trixbox and voip test

Hi, and thanks for reading part III of this tutorial.

In this part, I'm going to introduce you to setting up SIP extensions in
trixbox, and establishing voip calls.

We'll test VoIP calls between X-lite, a Windows based Software VoIP Phone,
and Sipdroid, a voip client for Android.

The purpose of this test is to verify our networking with trixbox is
operational just a tad before we lay out the big guns.

Configuring IP


If you're not satisfied in the IP automatically assigned to your VM, you can
modify it, if it's fine go ahead and skip to the next section.


  1. Launch VirtualBox if it's not up yet.

  2. In the login screen use root as user name
    and the password you entered during the installation (I hope you remember it!).

  3. Type system-config-network-tui to enter
    networking configuration screen:



  4. Choose Edit Devices and hit Enter, then choose your device and hit Enter again:



  5. You can modify its parameters. If you'd like to change to static IP, hit the spacebar when cursor is on Use DHCP to uncheck it, and customize parameters as needed:

    trixbox eth0 configuration

  6. Save everything by choosing OK and at the end, Save&Quit.

  7. We're not done yet, now we have to restart our network card, type
    (assuming eth0 is your NIC):

    ifdown eth0
    ifup eth0

    Then to verify your IP was indeed set type:
    ifconfig





Setting up extensions in trixbox

Before we start, I assume you've configured your IP, if not return to the previous section.
I'll be using [trixboxip] notation instead of a true IP in the examples follow.

In thie section we'll be setting up two SIP extensions.
Extension are basically endpoints that interface with asterisk.
You can configure extensions manually by editing various configuration scripts
and typing in some terminal commands, but trixbox comes with a very versatile
web interface to do almost everything through GUI.
For our purposes it is more than sufficient.


  1. Browse to http://[trixboxip] OR https://[trixboxip] for SSL secured page in your
    favorite browser to enter the web interface.
    Click switch at the top right corner of the page
    to enter Administration mode.



  2. The default credentials are:

    user: maint
    password: password



    NOTE: You can change the password using the command passwd-maint in the terminal.
    I suggest you do so for security purposes.

  3. To create new extensions head into PBX>PBX Settings:


  4. Now, head into Extensions:

  5. In the Add an Extension page make sure
    Generic SIP Device is selected (should be the default) and click Submit.

  6. Create an extension and later create another one in the same manner.
    The fields which are relevant are the following:

    User Extension - it's analogous to User Name.
    Display Name - optional, but nicer for SIP Caller Id.
    secret - account's password.



    Click Submit when you're done.

  7. After you've created 2 extensions click Apply Configuration Changes at the top of the page.

    The idea behind this approach is that you can do as much changes as you'd like
    to asterisk, and submit them, and all this without reloading the asterisk server.
    When you are ready to commit those changes the server is reloaded by clicking
    that button.



  8. Confirm reloading of the PBX:




OK, now that we've set-up extensions we're ready to test them out.

Configuring X-Lite and Sipdroid



First of all, we'll install X-Lite and connect to the server as the
first extension we've setup - I named it's user 500.
Second, we'll install Sipdroid on Android from the Market, and connect as the
second extension - I named it's 600.

  1. Download X-Lite from here

  2. Launch it, and right click on the display screen, choose SIP Account Settings:


  3. Now, choose Add... on the right:


  4. Fill in user first user's credentials:

    Display Name - Anything you'd like, its internal to X-Lite.
    User Name - First user's name.
    Password - Second user's password.
    Domain - trixbox's server url.




  5. Confirm you entries, wait a few moments and if everything's OK it should look like this:




Let's get to installing and configuring Sipdroid.
I'm assuming you have WiFi since this test is performed in a local network, in later tutorials,
I will explain how to expose to server outside of the LAN and through out NAT.

NOTE: If your phone supports SIP (I know some Symbian phones have
support built in, iPhone users should look for SIP client in the AppStore, Windows Mobile users should
do the same).


  1. First, enter the Market app and type in sipdroid in the search box, and download it (as of writing the article, the latest
    Sipdroid version was 2.0.1 beta).

  2. Open Sipdroid:
    Sipdroid main screen

  3. Press the phone's Menu button and choose Settings, fill in:

    Authorization Username - Second user's name.
    Password - Second user's password.
    Server or Proxy - trixbox's server url.
    Use WLAN - Check this checkbox so WiFi dialing will be enabled.

    Sipdroid account settings

  4. Now, press the phone's Back button to return to main screen and
    slide down the Notifications Bar to see if registration succeeded, if it does you should
    see [userName]@asterisk Registered:

    Sipdroid registered notification Android

    NOTE:
    If registration failed due to:

    • Timeout - make sure you've entered
      the proper server address, that the used port is 5060 and
      the protocol is UDP (in Sipdroid's settings).

    • Unauthorized access - make sure the user name and password entered in
      settings are correct.







Dialing from Sipdroid to X-Lite



If you've reached here you've just set-up a basic VoIP configuration, let's test it by
dialing from Sipdroid:


  1. Head into your phone's dialer and type in the user name you used in X-Lite and dial:


    NOTE: I once encountered an issue that seems to be an X-Lite bug which cause the call to fail,
    restart X-Lite in retry in such case.

  2. Answer the incoming call and make sure voice passes on each end:



    NOTE: If there's a problem recording within
    X-Lite you can configure recording device by right clicking it's display,
    and going into Options>Device and
    choosing the proper Microphone Device.



Excellent, now we've tested our quickly assembled VoIP system in our nifty
in-house WiFi.

In the next tutorial section we'll connect and configure the Linksys SPA3102 to
a router and an analog phone line.
Then, we'll create an extension for it in Asterisk and
configure its gateway to work for our VoIP to Analog Phone line
conversion purposes.

Stay tuned,
Max.

8 comments:

  1. Awesome tutorial!!!

    You are really great!!!

    Perfectly explained for a new user like me!!!

    It really works!!!

    Thank You so much :)

    Regards
    sahadevan

    ReplyDelete
  2. Here's my tribute video but the IP address that TB ce gave me never loaded.

    Your static IP information in the config... are there generic settings that will work on anyone's virtualbox? I tried
    10.0.0.1
    255.255.255.0
    192.168.1.1

    with no joy. Your help is much appreciated!

    ReplyDelete
  3. http://www.youtube.com/watch?v=DVuDgJKBLK4

    ReplyDelete
  4. Hey Dennis, thanks for reading, try changing your static IP and Netmask through the
    system-config-network-tui
    tool from within trixbox.

    Set your static IP, for instance to 10.0.0.4.
    And match your Netmask to your current netmask (To see it, type ifconfig eth0 outside trixbox in your linux shell)

    Hope it helps.

    ReplyDelete
  5. Hey Max
    Thanks. I never did get the virtualbox to play nice so I dusted off an older computer and now TB ce works fine. Working through your tuts and making vids as I go. Thanks a bunch! Your tuts are the best I've found!

    Dennis

    ReplyDelete
  6. Here's the tribute video! Thanks again!
    http://www.youtube.com/watch?v=Z0rHB7tbTqY

    ReplyDelete
  7. You can make phone calls from your tablet/ipad (without sim card) using voip app. I use Smartgroshen app, good quality of voice! At start you get 0,50 euro gratis!

    ReplyDelete
  8. Your tutorial is great, but I'm still having challenge connecting my Grandstream GXP1200 to trixbox. I need your help please

    ReplyDelete