Archive for June, 2009

Things to consider when building a home VoIP system

Tuesday, June 30th, 2009

Over the months that I’ve been playing with VoIP I’ve come to the conclusion that there are many things that are not that obvious but which certainly need considering when you setup a VoIP system even at home.

The Dial Plan

It’s interesting but it’s not something I see that’s mentioned as being the first thing you shoud think about. The dial plan is however so important.

For those of us playing with Asterisk or Freeswitch this really should be something that’s thought about quite carefully. My home phone system is setup in such a way so that my wife really doesn’t notice that our phone is not actually talking directly to the phone line. That’s probably the way it should be as otherwise it’s just confusing and silly and upsets her that I’m playing with her way to talk to friends and family. In her opinion it should just work and no differently to normal.

Of course installations of Asterisk or Freeswitch come with their own default dial plan so you can see how features work. However if you’re going to use this software this really needs to be adjusted to that it works.

Most of the example dial plans of course don’t fit non-US countries and I’ve been living in the Netherlands and am back in Spain so actually it’s important to ensure that you can dial certain numbers.  So now this is as follows:

  • 00XXXX. international calls
  • 010 Madrid town hall
  • 061 Medical Emergencies (InSalud)
  • 062 Guardia Civil (military branch of police force)
  • 091 National police
  • 092 Local police
  • 1004 Telefonica help number (free)
  • 10NN direct dial via another telco
  • 112 emergency calls (almost never used, not good to test, but should be setup)
  • 6NNNNNNNN Spanish mobile numbers
  • 7NNNNNNNN personal numbers
  • 800NNNNNN Freephone numbers
  • 8NNNNNNNN Spanish fixed line numbers (new)
  • 900NNNNNN Freephone numbers
  • 901NNNNNN “local” rate numbers
  • 902NNNNNN more expensive than local rate numbers
  • 90[567]NNNNNN peak rate numbers ?
  • 9NNNNNNNN Spanish fixed line numbers

Although this list is not complete you get the idea. The point is that if you want to make Asterisk or Freeswitch usage transparent then you need to set up a dial plan to allow local users to dial these numbers. They also get very upset if trying to dial a normal number simply does not work. So try to avoid this frustration.

Internal Extension numbering

The internal extensions is another issue. What range do you use? Freeswitch supplies as an example 4 digit extensions beginning with 1. Looking at my dial plan above this will not work.

Instead I chose to use 2XX as the internal extensions. I don’t expect to have 100 phones and I can also setup a few fast dial numbers in this range. It also allows me to connect from the Internet when I’m not at home and still use my own phone system. That’s nice.

Then of course we want to have a mailbox system of some type and we need to reach it. I chose 500 to get there. That fits my plan.

So these things really are quite necessary to look at before you even begin. It also probably requires you to delete the default dial plans after doing initial testing so it doesn’t do things that you don’t expect.

Connecting to the PSTN

Outgoing calls using the above dialplan need to work. Since I’ve bought a Linksys SPA3102 I use it for dialing out to through my PSTN line. While this is a nice piece of kit it’s really a bit of a pig to configure. It took a while to get things working, though now it does.

Incoming calls go to ALL extensions

So far so good. A difference with normal phone switchboards is that normally you want incoming calls to go to ALL extensions not just to one specific phone. (I have four.) That led me to explore asterisk queues and rather than forward incoming calls to a specific extension to forward them to the queue which would then call all extentions. This idea isn’t mentioned on any sites that I’ve seen yet on a home system seems like a good thing to do. It’s also what most people expect at home.

Setting up Alternate VoIP gateways

One you get this far you’re doing pretty well. This is where I started looking at making cheaper calls through different SIP provider accounts. This can be quite important especially for me where I talk to family who live outside of Spain.  While trying out different providers it has become quite clear that some providers do give a better service than others. They may be a bit more expensive, but if the service does not work some of the time I’m rather reluctant to use it. That just irritates my wife so is best avoided. So again another clear recommendation: Test your VoIP providers thoroughly and at different times of the day. The service they provide may vary and may not always be what you expect.

The other option which you may want to do is simply route some of your calls through a different telco provider through your PSTN line. That’s quite easy to do in either Asterisk or Freeswitch. Add the telco’s prefix and then dial the number through the PSTN connection as normal.

Do you need a DID number?

Having a DID number is quite a handy thing to do.  DID (Dial in Direct) numbers are just normal landline numbers but of course do not need to be for the area or country where you live. Many VoIP providers offer these usually at a small monthly charge. I found Localphone.com who are quite nice, as they don’t charge you for the DID number and that does mean that you can have a number in a foreign country which allows perhaps relatives or friends to call you at what is a local rate for them and no cost for you. If you call out through the provider you pay the local rates and that’s fine. I have a DID number to allow me to recieve calls from my parents in the UK and another one to allow me to make and recieve calls to friends in the Netherlands.

Now which of these connections is the best one to use?

The final problem. After playing with different providers you suddenly start to realise that this is pretty hard to manage. If you look at all the different prefixes in the dial plan and have more than one potential provider you suddenly see that the price differences may be quite small. They may also change. If they change you may end up using the wrong dial plan and paying more than you need to.

This problem is something that I’d like to resolve but in a neat and tidy way. I’d like to have some sort of least cost dialing that would be able to collect the call rates to different locations offered by different providers and work out which is the cheapest plan and then route the call out through that provider. Doing this by hand is fiddly. I don’t yet know of any add on software which does this. While most voip providers do give you their call rates they don’t provide them in a format which you can use directly. They often just quote a rate for each country and perhaps mobile and fixed rate calls.  Often special numbers like freephone numbers to a foreign country aren’t allowed, and it’s not an issue of the price. They simply don’t work. That can be frustrating.

So these are some of the things that when you make your first steps into setting up a VoIP system need attention. None of them are technical issues, but more operational or practical issues which need to be considered if not initially later in the setup process. They are however often things that don’t seem to clearly mentioned in many articles where they are things that normally are assumed to be known or thought out already. I guess if you are building a system to sell to a company then they probably have been thought out, but many of us who are playing with this software may not consider them carefully enough.

This is what I’ve come across.

Have you had similar experiences or have they differed significantly from mine?

Discovering the cause of Asterisk jitter delays…

Monday, June 22nd, 2009

I’ve been running Asterisk pretty successfully for a few years now.  Successfully in the sense that I have it configured to talk to my Linksys SPA3102 for making outgoing calls and receving incoming calls from my local telco operator. I also have a DID number in the Netherlands which I still use for my visits there on business and also to talk to friends. Other international calls I route out through various VoIPs. And all is routed via Asterisk using a Linksys SPA941 “hard ip phone” and a pap2t connected to a cordless DECT phone. So all was fine?

Well no. I’ve been plagued for months with an issue I couldn’t resolve. My wife complained (rightly) that the phone calls had an unnaturally long delay when talking to people which made the conversation much more difficult. If you tried to interrupt someone who was talkng they didn’t hear you immediately and this broke up the flow of conversation completely.

So I looked at the Asterisk config and tweaked this and that. It didn’t seem to help. I looked on Google for complaints from others of similar symptoms but to be honest couldn’t really find the cause. There were some comments that referred to Asterisk RTP config being inflexible and requiring making adjustments on the ATA I was using but to be honest this didn’t make much difference.

I’ve been tempted to try and switch to another VoIP product like Freeswitch but that’s harder to configure (mainly through lack of experience with it, even if it looks promising).

Finally it seems (and I’m still not 100% sure), though the signs are promising, that the problem is something as simple as the SPA3102, PAP2T and SPA941’s default configuration having a high network jitter configuration. This is to improve things on an internet based voip call. However this adds loads of extra latency and if the phones are connected directly to Asterisk this default configuration adds a lot more latency than you would expect: latency from the phone to asterisk and then latency from the phone to the PSTN number (via the SPA3102), the combination being enough to destroy the usability of the call.

I’ve changed this now to low network latency and the results are promising, but I’m surprised not to have seen this problem mentioned in the Asterisks books I’ve bought, nor various forums and mailing lists I’ve been following.

So if you find that you have real problems with latency and you think it may be the pc, or it may be Asterisk then take a look at the soft or hard phones you are using and check the jitter configuration, at least on the Linksys products. This might make a huge difference and may your system usable.