Categories
General blog entries

Asterisk PBX ramblings

As I am playing with AsteriskNow in a virtual machine to see how I can extend our current PBX (old, analogue, missing lots of options and has zero flexibility) to use the power of a virtual PBX and all its options.

First off I want to explain some terms, you will find these plastered over guides and they confused me as first. This is what I distilled from all that.

VoIP – Voice over IP, internet telephony. Everyone is talking about it and while the name is accurate (you send voice or phone data over a switched IP network, the internet or LAN), it does not describe how this is done. Most people assume VoIP is a technology on its own, it is not.
SIP – SIP stands for Session Initiation Protocol. This is an actual implementation of VoIP. Although SIP has a lot of advanced features (deterring new users to dive in and understanding how it works, like it did me), most people will only use a very, very small subset. See below for more information.
FXO – Foreign eXchange Office, in a nutshell this is an adapter to hook up to a phone line or PTSN (it acts as a client on a line).
FXS – Foreign eXchange Station, this is an (internal) line used to run to a phone or fax machine. The FXS port powers the line, enabling phones to function as well as provide the dial tone and ringing features.
PTSN – Public Switched Telephone Network, this means a phone line. Either a line to a PBX or to the outside world. Also called a trunk.
POTS – Plain Old Telephone System, the old analogue phone system as we know it. The counterpart of this is of course VoIP.
Trunk – A trunk is a phone line, usually only used to denote lines to the outside world. These days a SIP account allowing you to call to the outside world is called a trunk (as it has the same usage as the old physical lines that were connected to a PBX).
DID – Direct Inward Dialling usually denotes the service that connects the POTS telephony system to the digital world of the internet. In other words, it allows you to have a normal phone number which is converted into a VoIP number, which in turn can be hooked up to a VoIP phone or PBX. Usually this is nothing more than a SIP account at a service provider, making usage pretty simple.
Presence – SIP Presence is a technique where a phone tells the PBX it would like to monitor a certain extension or trunk. Normally this is used to light up LEDs on the phone if an extension or trunk is busy. Asterisk has full support for this but most entry-level phones do not sport this feature (more expensive phones targeted for corporate usage have this).

The biggest downside to the VOIP hype is the confusion that it creates in its wake. Like I said, everyone has heard of the phrase internet telephony and most know the term VoIP. Most people there for buy products with big labels on them, marking them as “VoIP phones” and such. The problem is that not always all products work together.

The upside is that most systems fully support SIP which in turn is pretty much a global standard. SIP works by connecting a client to a server, where the client is usually the phone and the server usually is a PBX. The phones are full computer systems on their own, working on the LAN most offices already use. After a phone registered itself with the server using its name and password (a SIP account), the server can reach the phone and vice versa when needed.

When the user picks up the horn and starts dialing, the phone generates a fake dial tone (there is no dial tone as this is a digital system) and waits for the user to start pressing buttons. Every status change (pick up, press number etc) is passed to the server/PBX and is processed to determine who the user is attempting to call. The PBX will then forward the call to another extension or to a trunk and the sound data is transmitted between caller and callee as soon as the connection is complete.

The reverse also holds. After the extension is registered at the server, the PBX can let it ring and after the user picks up the horn, the audio connection is made in order to complete the calling sequence.

So far, this is a simple client-server setup and the only choices one has to make is to determine which audio compression is chosen. The rule of thumb here is that better audio quality comes at a higher bandwidth cost. Most PBX-es like Asterisk convert audio codecs on the fly if for example the remote SIP trunk not supports a certain encoding.

Finally there is the option to call directly to a SIP server or PBX. For example, you hook up your server to the DNS name sip.myoffice.com. This has to be a valid domain and accessible from the outside world. You then open port 5060 for protocol UDP (very important, this is NOT the same as TCP!) on your outside firewall or server and connect that to the virtual PBX. This allows telephones to register themselves from remote locations such as home or a 2nd office but also allows you to call straight into the office.

The details of this I still have to work out (I’ll update this article as I go) but it comes down to this: the caller calls 1234@sip.myoffice.com. His PBX will know that it has to connect to sip.myoffice.com on port 5060 and ask the PBX at that address to ring up number 1234. The office PBX recognises that the incoming call request is not from a registered internal extension and determines how the call should be handled. If all goes well, the right trunk will be activated which in turn will ring the extensions you have linked to that line. This way, the POTS system is not used at all, and as another benefit, the call is absolutely free as only the internet is used.

I hope this helps others out there to determine which hardware they should buy and how most things fit together. Most devices marketed as “VoIP adapters” are not quite accurate labelled as they normally have a small SIP server (making it in fact a mini-PBX) and one or more FXS and FXO ports. The type of ports restrict you to their usage and it is very important to decide what you need. If you want to hook up a number of old telephones you need FXS ports, if you want to connect your physical telephone line to your virtual PBX, you need an FXO port.

In another article I will continue my findings as I just ordered some VoIP hardware to start experimenting with it.

Categories
How-To's

Adding PBXes.org to Nokia N95

So you want to use your Nokia N95 with the popular PBXes.org service to start using VOIP calls? You have come to the right place. Note that these instructions will most likely apply to all Symbian S60 phones, like the Nokia E65. Also note that in case of the N95, this even works for phones without a SIM card, making it possible to call with those phones as well!

In this article I assume that you already have a PBXes.org account and have set up an extension for your Nokia N95, if not please look at this guide.

Let create the SIP profile to connect to PBXes.org:

  1. Create the profile:

    1. Open the menu
    2. Open Tools
    3. Open Settings
    4. Select Connection
    5. Scroll down and select SIP Settings
    6. Click Options
    7. Select New SIP profile
  2. Set up the new profile:

    1. Select Use default profile
    2. Change the profile name to something familiar: PBXes.org
    3. Leave Service Profile set to IETF
    4. Set Default access point to your current Wifi network
    5. Set Public user name to myuser-800@pbxes.org where you substitute myuser for your account name and 800 for the extension number you created for this phone
    6. Leave Use compression set to No
    7. Set Registration to Always on to force the phone to connect to the SIP service when starting up (or leave it if you are not planning on using it all the time)
    8. Leave Use security on No
    9. Leave Proxy server empty
  3. Set up the registrar:

    1. Enter Registrar server
    2. Set Registrar server address to sip.pbxes.org
    3. Set Realm to pbxes.org
    4. Set User name to myuser-800 and substitute like before
    5. Set Password to the password you set on pbxes.org for this extension number
    6. Set Transport type to UDP
    7. Leave Port on 5060
  4. Set up internet calling:

    1. Click Back to return
    2. Click Back to return to SIP Settings
    3. Click Back to return to Connection
    4. Select Internet tel
    5. Click Options
    6. Select New profile
    7. Change the name if desired.
    8. Select the SIP profiles to use, if you only added PBXes.org it will be selected by default.
    9. Click Back to “Internet telephone”
    10. Click Back until you reach the “Tools” menu.
    11. Select Internet tel.
    12. Click Options.
    13. Select Connect to service

The phone will now connect to the Wi-Fi network you specified earlier and a globe with phone icon will appear showing that the registration was successful. When you want to call using the SIP account, use Options and Internet call to activate the SIP mode.

To switch to SIP calling by default do the following:

  1. Open the menu.
  2. Open Tools.
  3. Open Settings.
  4. Select Phone.
  5. Select Call.
  6. Scroll down and set Default call type to Internet call

Next time you will call a number it will use your SIP account automatically! (Note: if the SIP account fails – no Wi-Fi etc – the phone will switch back to normal calling modes).

Common pitfall: ‘Address not in use’ when you try to call a number (meanwhile you can receive calls fine). This happened to me because I did not specify a Default route for the newly added extension, after making the standard route truly global all was well.