Playing with callerid again

Back in April last year I started playing with an old external serial-attached modem to read the callerid of incoming calls. My intention was to intercept calls from direct marketeers. The concept was good, but I ran into problems with the modem; it took up a lot of space, kept overheating, and lacked any voice facilities, limiting what I could do with it. In addition (probably because of the modem constantly overheating) the software I was running kept crashing.

So in the end, I gave up on the idea.

But recently we seem to have had a spate of annoying calls from direct marketeers based in India, selling products for UK companies that are cynically avoiding the UK’s regulations around direct marketing opt-outs. The straw that broke the camels back was the call that came through at 6am on a Saturday morning.

The problem here is that the phone companies don’t care about this. They make money from all these calls, so its not in their interest to block them. They’ll sell me a service to block “withheld” numbers, but not numbers that show as “unavailable”. Unfortunately, these days the majority of the problem calls come from India, and show as “unavailable” because the Indian call centers are using VoIP systems to place their calls to the UK, and they deliberately ensure that their callerid is “unavailable”.

So I’m back on the idea of making my own solution to this problem. So first off, I purchased a USR 5637 USB fax modem that is compatible with the UK callerid protocols. Even better, this is a voice modem too, so it can interact with a caller, sending audio as well as data down the phone line, and recognise touchtones. It’s also small, self-powered, cool-running and very reliable.

Next I spent some time looking to see what other people have done in this space, and eventually found this webpage, that describes a simple Bash script that intercepts calls that are not on a whitelist, and plays modem tones to them before hanging up. Recognised callers are allowed to ring the phone as normal, progressing to an answerphone if necessary. It’s not exactly the functionality that I want, but the simplicity is beguiling, and it’s trivial to extend it to do something closer to what I do want. And anyway, anything more sophisticated is going to require something like Asterisk, and switching my whole phone system over to VoIP, which is not going to be very family-friendly.

So for now, I’m gathering lists of all incoming calls to establish a basic whitelist, before moving on to do some really basic screening of calls.

VoIP update

I’ve been meaning to provide an update on the Tesco Internet Phone (“TIP”) saga for a while, but never quite got around to it. The last you heard from me was here, where I was waiting for a voucher code. So, with apologies for the tardiness, here’s the current state of play:

TIP sent me the voucher code through the mail; it took about a week to arrive, but it did actually arrive. Entering the code into their website caused the promised upgrade to take place, allowing me to upgrade my Pay As You Go account to a pay monthly all inclusive UK calls plan. This works quite well, though the quality of the call is generally no better than a normal POTS line, and sometimes lower, which is rather disappointing. But then it is only costing £3 a month, so I don’t feel I can complain too much 🙂

I now have my Siemens Gigaset phones set up with both the POTS line and the TIP line, and they are working well. Incoming calls on the POTS line ring 4 of the handsets, while an incoming call on the VoIP line rings just the other handset. Unanswered POTS calls go to the POTS voicemail, while unanswered VoIP calls go to the in-built answering machine. This setup means the kids can have a handset dedicated to them, with the rest of the handsets remaining “ours”. Outbound calls currently default to the VoIP line (ie, free) but overriding this and using the POTS line (eg, when calling a non-geographic number, or if the VoIP line is already in use) is as simple as holding down the call button rather than just briefly pressing it.

Calls to numbers that would incur charges (non-geographic) are currently barred on the VoIP line, but there is a simple call routing system built into the phones which looks like it could be sufficient to automatically route such calls to the POTS line, which is currently unrestricted. That’s something I need to spend an hour or two playing with.

Update: 10 minutes this morning have shown that the dialing plan function built into the Gigaset is very basic, but enough to allow me to effectively route outgoing calls between the POTS and VoIP lines. So, calls to 07* and 08* numbers now go via the POTS line, as do local calls (because the VoIP service needs the full STD code, and none of us remember to enter it!) and the access codes for the POTS answerphone. 09* calls (premium rate stuff) are now blocked too.

This isn’t perfect as it will make it less simple to use both outgoing lines simultaneously, but at least it makes the phones work the way everyone expects them to, which stops the frustrated shouts of “The phones aren’t working again!”. Once I get a better dial plan working (ie Asterisk) then I can route everything by cost & line availability, adding in STD codes for local calls as necessary.

Update 2: It occurred to me that if we had all our frequently called local numbers entered in the handsets phone directories, with the STD areas codes pre-filled in, then almost all our calls would go via the free VoIP line. It also turns out that you can provision the handsets attached to the Gigaset base-station over the network using a file of VCARDs. The system is very picky about the format of the files, but once that was cracked (it requires file with MSDOS line terminations, not Unix ones) it was a simple but tedious job to create the 140-odd VCARD entries, and about 5 minutes to provision all the handsets.

And this simple solution now all works pretty much perfectly.

Meanwhile my plans to integrate Asterisk are still ongoing. I have my Asterisk 1.6 installation up and running, and defining another VoIP service on the phones to connect to the Asterisk server is trivial. I just need to spend more time on understanding, configuring and documenting a basic Asterisk system. As the moment I feel I’ve over-complicated the issue by adding the Asterisk GUI to the system, as this seems to do a lot of automatic configuration of the system, complicating the system considerably and making it much harder to understand. Removing this, and getting back to basic configuration files seems like the right way forward here. The good news is that the way the Gigaset system implements VoIP connections means that I can connect specific handsets to my Asterisk server, and whilst they are easy for me to access, they will not interfere with the (concurrent) normal use of the handsets. Which is probably a good thing for family harmony!

So, in the short term it’s working well, but longer term Asterisk can clearly add a whole new level of intelligence to the system, if only I can get my head around it all.

DECT phones arrive

Back in this post (was it really that long ago?) I laid out my plan to create an all-singing, all-dancing phone system for the home, with the first step being to get some Siemens Gigaset S685IP DECT phones. Having made the decision, and told you all about the plan, I’d then had a serious bout of prevarication over the price of the things. At £260 they are definitely not what you could call the “budget” end of the market.

However, earlier in the week I noticed that IBM had decided to file another of my patent disclosures, and a previous patent filing has finally been issued by the US patent office. The awards that IBM gives me to recognise those events will more than cover the cost of the phones, so I flexed the credit card, and ordered them from LiGo, who are based in Scotland. The ordering process was trivial, with lots of updates on the order progress, with the phones finally turning up yesterday in the form of a base unit and pre-registered handset plus four additional (unregistered) handsets.

As someone who has never had DECT phones before, I have to say that they are nothing like the DECT phones that I remember looking at (admittedly many years ago). They bear more resemblance to (chunky) mobile phones, in both appearance and capabilities. They also no longer require custom battery packs, which I seem to remember always being a problem with early DECT phones. These just use a pair of (supplied) AAA NiCad rechargeables.

Impressions of the handsets are that they are a nice size, weight and “feel”, with more features than most people (including me!) will ever need. And the internal (paging) call clarity is simply amazing, probably as a result of the wide-band digital codecs that they are able to use. It will be interesting to see what the call quality is like over the PSTN and VoIP networks as I start to get everything hooked together.

The base station on the other hand, is an extremely flimsy affair with a combination of ports on the side and rear, which makes it rather difficult to neatly cable up – especially to the house LAN. However, since it’s being tucked out of sight in our case, that probably doesn’t matter too much.

Being NiCad powered, I charged all the batteries up overnight last night and now have four of the handsets running internal speakerphone calls to fully discharge the batteries again, at which point we can start using them normally. In theory this should minimise any memory effects in the batteries and give a longer service life, though I’m dubious of the actual value in practice. Meanwhile the fifth handset is acting as our main phone, and will have to be discharged separately once the other handsets are conditioned. According to the manuals, talk time is about 10 hours or so, so we should be ready to start playing more seriously with the phones this evening.

So I really need to do some research this morning into which VoIP provider I’m going to select – probably either Tesco or Vonage – and get an account or two arranged.

Update: The Tesco offering is now £2.89 a month for “unlimited” calls of up to 70 minutes duration to geographical UK numbers, ie, those starting 01, 02 or 03. Beyond 70 minutes, there is a 2p per minute charge. There is also a monthly fair use limit of 3000 minutes (about 33 hours) on those “unlimited” calls. Calls to mobiles are about 10p per minute, and non-geographic numbers are subject to complex rules to determine the costs. International calls vary significantly too … from 2p per minute upwards depending on destination. The inbound number can be chosen from a long (but not complete) list of area codes. For me, the nearest area code to my house is Southampton, which is close enough to count as local to anyone likely to want to call me.

Overall it looks like it will meet my needs, so I’ll probably go with it, though at the moment the Tesco website is failing to allow new registrations, so I can’t sign up until they get that fixed (they’re aware and “urgently working on it”)

Home PBX

Back in this post I mentioned that I was going to teach myself Asterisk, as part of a project to build a home PBX system. I thought it would be useful to outline what I’m trying to achieve, and why, before I start posting progress reports that might make little sense otherwise.

So, at the moment I have a single PSTN line into the house, which in addition to providing my phone service, also carries my ADSL service. Inside the house I have a series of extensions to various rooms, on which we currently have two old-fashioned wired telephones. Voicemail is provided at the exchange by our service provider. This works OK as far as it goes, but with five of us in the house, contention over the use of the one phone line is becoming an issue. In addition, despite being on the UK telephone preference service “opt-out” list, we still seem to get a lot of annoying cold-callers, mostly dialing in from abroad where UK legislation cannot affect them.

So, in an ideal world, my plan would be to initially add 2 more lines to the house using VoIP technology to alleviate the contention. Both would have geographic numbers associated with our local PSTN exchange, to allow me to nominally declare one inbound VoIP line for the children to share, and one for me to use primarily for when I’m working at home. However, outbound calls would make use of any of the available lines based on availability and a least cost routing algorithm.

I’d also replace the two wired telephones with several DECT handsets. My intent would be that each handset would operate independently of the others, and the system would support multiple parallel active calls. In addition, I would want to be able to conference together multiple handsets and/or multiple lines as needed.

Voicemail would be provided internally by the system, with individual accounts for each user, with messages forwarded to the user by email if required.

The system would also need to do time-based routing of incoming calls, so that after a specific time at night, all calls would go straight to voicemail, unless they come from a known and authorised number.

International callers, and callers with no CLI would always get trapped by the system and passed to an IVR system that would allow the caller to identify themselves. If they identify themselves as an authorised number then they would be passed on to the phones/voicemail, otherwise the call would be automatically terminated.

To create such a system I figure I need something like the following:

  • My existing PSTN line
  • 2 x geographic numbered VoIP lines
  • Asterisk to handle the signalling, with a fairly complex configuration
  • 1 x Linksys SPA3102 linking the PSTN line to Asterisk, and providing a fallback wired PSTN phone on one of its FXS ports
  • A Polycom Kirk Wireless Server 300 to provide the interface between Asterisk and the DECT handsets
  • A PoE injector to power the KWS300
  • As many DECT handsets as eventually needed

However, the outlay on that is a little on the high side, and the learning curve very steep indeed before I’d get to a working phone system. So I propose to do this in two phases, and start with:

  • 1 x PSTN line
  • 2 x geographic numbered VoIP lines
  • 1 x Quint package Siemens Gigaset S685IP

The Siemens Gigaset can handle some of my requirements out of the box, allowing me to get a basic working system up and running. It can also be interfaced to Asterisk, allowing me to start experimenting with Asterisk, before adding the SPA3102 and optionally upgrading the S685IP base station with the Kirk Wireless Server, reusing the handsets from the S685IP package as needed.

Well, it’s the current plan anyway 🙂