FreeSWITCHover Update

In my last post, I talked about “The Great FreeSWITCHover” happening this weekend.  So here is a status update:

  • All the live numbers are now moved onto FreeSWITCH (fs for short) and the phone rings (which is always a good start)
  • Incoming and outgoing calls work
  • Voicemail for external numbers works
  • Conference bridge set up (but not allocated to any external numbers yet)

So, a good start.  As far as I know, there is nothing left to do which will stop me making and receiving phone calls, so the switchover has been relatively painless.  What’s left to do now is to find a way of doing all the fiddly but non-essential features that I can do as and when I’ve got time.  Although the most urgent of these is to be able to change the outgoing caller ID to any one of my numbers, but hopefully that shouldn’t take too long to implement.

All in all, a big success so far and I think I can now officially say that Asterisk has been fired!  Goodbye and thanks for all the fish…

The Great FreeSWITCHover

I am “ringing the changes” this weekend.  Over the past few months I have been getting, frankly, quite frustrated with a relatively new piece of software called FreeSWITCH which is a software PBX (or, in English, a telephone exchange).  Up until recently, I’ve been using a piece of software called Asterisk to do the job, and in many ways it’s worked very well.  But over time I’ve been getting increasingly frustrated by its bugs.  So I’ve been having a look round to see if there is anything “better”.

I decided there were three probable open source software candidates for the job: Kamailio, Asterisk 1.8 or FreeSWITCH.  All three are quite capable in their own little ways, but it was more a case of which one to choose.  So, I installed them all and gave them a try.

Kamailio

Firstly, I tried Kamailio.  This particular product is a derivative of what was originally SIP Express Router.  This product, it is claimed, handles hundreds and hundreds of call setups per second, so it is very suitable for use in large telcos.  Out of the three packages, it is probably the closest thing to what is known as a softswitch in telecoms terms, and is also the closest thing to how the SIP protocol was envisaged to work when it was created.  Unlike the other two products, what Kamailio is best at is setting up, tearing down and routing calls.  Which is great, but unfortunately people expect “features” in their PBXes these days, such as voicemail or conferencing and so on!  With a softswitch, this is typically done by handing off to “feature” servers (which, ironically, are quite often run by PBXes!)

What really put the nail in the coffin for me as far as Kamailio was concerned, was how complex the configuration file was.  It seemed necessary to understand the SIP protocol at a very low level to even begin to understand how to use it.  Whilst I have a good book on this subject, I felt it was massive overkill to need to configure a softswitch at that low a level for what is basically a small home PBX.  A pity, because I think it is probably very good at what it does, but just wasn’t for me.

Asterisk 1.8

This is the very recently (at the time of writing) released version of the existing software that I was using.  Despite the fact that I have been using this software ever since version 1.0, and that’s years and years, over the past few months, I have become increasingly frustrated at the rather stupid bugs that Asterisk (or * for short) contains.  In particular, its SIP support is frankly rubbish.  Until now this hasn’t really been a problem since my service provider offered IAX2 connections to the PSTN, but since they have commissioned a new server, which is SIP only, I felt it was time to move away from IAX2 (which although published as RFC 5456, has never really gained acceptance much beyond the * community) and talk pure SIP.  So I bought myself a good book on the subject, and tried to learn it.  It was mainly through this that I was seeing more and more shortcomings in the SIP implementation in *.  Also, there was in the previous version no IPv6 support (which is going to become increasingly more important in the next year or two), and it is only the SIP stack which is IPv6 enabled – none of the other modules yet support it.

Asterisk is still a hugely popular PBX, and I know many people that use it, but it is fast becoming the “last resort” choice for me now that I am only too painfully aware of its shortcomings.  It’ll be sad to leave it in a way, because I’ve had a lot of fun with it, starting off with a single ISDN2e (Euro-ISDN) line and graduating all the way up to SIP phones with IAX2 trunks and all kinds of fancy features enabled over the years, but enough is enough.  Asterisk is badly in need of a rewrite and needs to start being compliant with some actual standards, and then it may usable again.  It was fun while it lasted though!

FreeSWITCH

So, having been disappointed by Kamailio because it was too complex, and disappointed by Asterisk because it was too buggy, that really only left FreeSWITCH.  I remember getting the source code for the first time and trying to compile it.  It was a nightmare.  Then I discovered that you had to run bootstrap.sh first and then the Makefile appeared.

This must be about my fourth go at installing FreeSWITCH.  The first three times I gave up in disgust.  But, there is something about it that I like, and that is the architecture of it.  FreeSWITCH (fs for short) is designed from the ground up to be modular, and not only that, to use third-party libraries as much as possible.  This is good news because it means that it can use industry-standard libraries like libsofia (derived from code originally written by Nokia) which are fully RFC compliant.

The initial big downside of FreeSWITCH is its XML configuration, and the fact that there is stuff-all documentation supplied with the thing.  In my opinion, it’s a classic case of “programmer-itis”, where the documentation is the code, except that’s no good if you’re not a hotshot programmer (i.e. me).  The wiki does have some documentation on it, but there’s a lot missing, and that’s frustrating.

What is more frustrating is that the sample config is cram-packed full of features, none of which are explained, and no indications of what it’s safe to leave out.  After much experimenting, tearing out of hair and even buying the new FreeSWITCH book (which frankly wasn’t always an awful lot of help, since it just said “use the config we supplied and tweak it” a lot of the time.), I managed to get a very basic configuration going, and I used that as the basis of my experiments.

But … there’s no denying that FreeSWITCH does have a lot going for it, once you begin to understand it.  I found that once I’d got rid of all the dead wood in the configuration and built one up from scratch, it did begin to make a lot more sense.  Now I have it up to the point where it is quite usable, I can see that it actually has many advantages over Asterisk – the primary one being that it’s a cleaner, far better design and hence why I’m going to stick with it, despite the configuration taking weeks to do and involved a painful retraining process.  Give a while, and I think it’ll be a serious contender to Asterisk.

So, FreeSWITCH wins, but what’s happening this weekend?

So, what now?  This weekend marks the official switchover to FreeSWITCH.  Currently my “live numbers” are not on any PBX at all, going straight to the phone so that I can guarantee the calls can get through whilst the new server was being set up.  I have a couple of test numbers on the fs server from two different providers, so that I can test compatibility before I move all the numbers over.

The configuration isn’t finished yet, but most of it is done.  Voicemail is working, and the conferencing server is up, and I can route calls inbound and outbound to and from the PSTN.  Still left to do are conversions of a couple of old Asterisk scripts, plus implementation of ACR (anonymous call rejection) and other assorted bits and pieces like implementation of feature codes, but none of those will stop the incoming calls ringing the phones if they’re not in place.

So, if you can’t get through on the this weekend, that’ll be why … although I don’t expect the job will be too arduous, like most things of this nature, it’s fine if it doesn’t go wrong.  I expect I’ll be blogging again after the event to let you know how well it didn’t work … :)

Everything, Everywhere

Amongst the deeply exciting (!) things this week I’ve been doing was to enable the supposed marvellous new feature from Everything Everywhere Ltd , the joint venture company that owns Orange UK and T-Mobile UK.  It is now possible to ‘roam’, free of charge between the two networks if you are a customer of the two networks.  The advantage of this is that if you are in an area where there is (say) Orange coverage but not any T-Mobile coverage, the phone will automatically pick up the other network’s signal and start using it, all for no extra charge.

There is one caveat to all this, and that it is currently 2G only.  Eventually, 3G networks will be able to do the same thing but that is coming later, courtesy of an agreement by EEL and Hutchison 3G UK Ltd (Three) to form a company known as MBNL (Mobile Broadband Network Ltd).  This allows both companies to share masts, and eventually should permit Orange, T-Mobile and Three to share networks on both 2G, 3G (and who knows, maybe even 4G).

Another thing I’ve noticed is that you will have to enable roaming on your phone, and also data roaming as well.  Despite the dire warnings that may come up about excessive charges, that won’t happen between Orange and T-Mobile since the roaming is free.  Foreign network roaming will still cost an arm and a leg as usual, though.

To sign up, visit either http://www.t-mobile.co.uk/share or http://www.orange.co.uk/share – it isn’t automatically enabled.

Telecoms overload

I feel like I’ve got “telecoms overload” today.  I’ve just created a new virtual machine to hold the latest Asterisk (*) 1.8rc2 release.  That will bring the total number of PBXes running in this flat to three.  I’m also threatening to, if I ever find the time, to see if I can figure out one of the SER family (e.g. Kamailio, OpenSER, OpenSIPS etc.) just for good measure.  All I can say is I’m glad I don’t have to finance a real physical machine for each server – virtual machines were a great invention!

I’m still no further forward in deciding what I’m going to about my “telecoms infrastructure” (if you can call it that, since it sounds so pretentious).  There’s now so many products to choose from, and each has their advantages and disadvantages.  Asterisk, the open-source PBX that started it all, has nearly reached version 1.8 but I’m fast falling out with it on the basis that its SIP module is still far from RFC compliant.  FreeSWITCH, on the other hand, is a much more modular, clean design, and a standards-compliant SIP stack, but the XML configuration files drive me up the wall.  The OpenSER/SIPS/Kamailio family are also very capable and powerful softswitches, but you need a degree in RFC 3261 just to configure them!

My head hurts…

Birthday curry

Had a very pleasant evening last night with 12 other people celebrating my forthcoming birthday tomorrow in a nice little restaurant about five miles away from here.  The chicken madras I had was pleasantly on the hot side, and there was plenty to go round (in fact I think I was one of the few people to actually finish my curry!).  Highlight of the evening was the person who shall remain nameless – but you know who you are! – who phoned me up to ask where we all were.  I told him he was in the wrong restaurant, five miles the other way, to the amusement of everyone else on the table :)

Tired of tyres

A foot pump is a foot pump is a foot pump, yes?  Well, no.  It would appear that foot pumps (and especially their pressure gauges) are not necessarily as accurate as you might think.  About a month and a bit ago, my “trusty Halfords foot pump” decided to split in half.  Fair enough – time for a new one.  Nearest place to get one was Tesco (a good few miles away from where I was at the time), so off I go and buy a new foot pump.  “That’s odd”, I thought, when attaching the new pump on the car tyre to check its pressure.  The gauge, compared to the Halfords one, was overreading by some 0.4 bar (5.8 psi).  So which one was right?  The answer, of course, was that I didn’t know.  Given that I was going to be driving back some 400 miles a few days later, I was a bit concerned, but there was nothing I could do about it, so when I got back home I decided to do a bit of research.

The first thing to do was to get the trusty old Woolworths (remember them?) digital tyre pressure gauge out, just as a quick check.  And sure enough, that was reading quite a bit lower than I thought.  This got me wondering if there were actually some standards for tyre pressure gauges.  A quick search on the Internet revealed that there was – and it’s called BS EN 12645:1999.  EU Directive 86/217/EEC states that for gauges that measure  tyre pressures up to 4.0 bar (58 psi), the maximum error must be no more than 0.08 bar (1.16 psi).

So it appeared my not-very-trusty Tesco foot pump was reading outside that range, so the hunt was on to find a pump, foot or electric, that was at least that accurate.  I tried looking through some reviews on the Internet.  It appears that some foot pumps were very very off in their readings; one review of a Draper footpump claimed it was 5 psi out compared to their reference gauge.  So I quickly came to the conclusion that all footpumps were rubbish, except maybe the Michelin which according to the reviews had a very accurate gauge – the only trouble was that many of the reviews said that despite the 30 quid price tag the pump fell to bits very quickly.

So who makes accurate gauges?  Well, my first stop was to the company that produces many of the ‘pro’ tyre pressure gauges you find in garages, tyre fitters, etc.  That company is called PCL, based in Sheffield.  The one you’ve probably heard of and may well have used at a petrol station is their Mk3 pressure gauge.  This is not only BS EN 12645:1999 compliant but comes with a calibration certificate to prove it too!  OK, so that’s got to be accurate, but no doubt dead expensive.  Although not as expensive as I thought… ££ rather than £££.  And anyway, that’d be no good since I would actually need to connect it to an airline.

A friend of mine suggested the Ring Automotive pumps, which are available in most of the usual suspects (Halfords et al), but I wasn’t sure how accurate it was – the web site certainly wasn’t going to mention it.  So my friend ended up emailing the company, and they replied it was accurate to +/- 5%.  This equates to a max error of 0.11 bar (or 1.58 psi) – which is still worse than the EU directive.

Could I find anything better?  Well, it appears it’s PCL to the rescue.  As well as making tyre pressure gauges that cost £££s, they also do a range of cheaper ones, and also an electric pump model.  Their manual gauges are actually calibrated to BS EN 12645:1999 and cost about a fiver, but of course that’s only a gauge.

But…. hidden deep in their web site is an apparently little-known product that they do called the ATT741.  It’s a “consumer” tyre inflator in that it comes in a box, with a cigarette lighter plug on one and and the thing to put on your tyres (no idea what that’s called in reality) on the other, and a box in the middle with a digital display.  The good news is that the web site claims it has a reading accuracy of 1 psi.  That’s 0.069 bar, which is actually better than the EU directive.  Bingo! I might have found one at last!  So I found a supplier on the Internet and ordered it over the weekend.

Today, it arrived.  (For some reason a couple of my colleagues at work wanted a go on it as well when they discovered what it was… which was just as well because they both had quite underinflated tyres as it turned out…)  So, it’s been given a good test.  Reading the instruction book, the manual claims it’s the reading accuracy is 5 kPa, or 0.05 bar, which in English money is 0.72 psi, actually better than the 1 psi the web site claims.  No way to prove this of course, since there is no BS EN 12645:1999 calibration, but I’m sure it can’t be that bad, after all PCL are used to making accurate gauges.

So, I’ve used it on my tyres now, which were quite a bit underinflated as well it turns out, and the car certainly handles a lot better now.  And at least I can be reasonably confident that the real tyre pressure is something close to what the gauge says it is.  Although, if I’m feeling particularly paranoid, I could always check it against a BS EN 12645:1999 calibrated gauge (!)

Details of the PCL ATT741 can be found on the PCL web site.  And yes, the Tesco foot pump is going back to Tesco.

Kernel exploits

Big panic in the Linux world after an article on Slashdot here alerted me to the fact that a 2-year old exploit had just been found in the Linux kernel. This only affects 64-bit (amd64) kernels, but the trouble is that all of my machines and virtual machines run a 64-bit kernel. Panic!! So, I spent a little while last night upgrading about 8 kernels, then rebooting them all, then finding out they wouldn’t start up again properly because of an error in another script, fix that…. all a bit painful. But it’s done now, and hopefully that’ll be the last emergency kernel patch I’ll need to for a while.