Friday, January 27, 2006

Ring Ring!

Ok. Not content with Media Center, and distributing it to all the TV's in the house, it was time to add some gadgetry to the telephone.

Caller ID to Media Center

There are a number of caller-id interfaces for the British telephone system, which present the callers number to a serial port interface while the phone is ringing. Apparently UK Phones use a different system to most of the rest of the word, which renders many 'worldwide' modem cards no use to us for caller-id data.

Automated Home (www.automatedhome.co.uk), had a number of posts where people had figured out that many of the stand-alone caller-id display units available actually presented the number data in serial format, and it just needed interfacing to the PC. So armed with Google, I found this : http://www.amarok.demon.co.uk/dl/cd50_mod/ which documents a *very* simple circuit to interface a CD50, or other similar caller-display unit to provide a serial output to your PC. ... Step one .. I built this.

Next was the software side of things. This hacky little circuit is not TAPI compatible , which is the standard that the internal Caller-ID support in Media Center uses, so its back to the home workshop for this also.

I ended up building a small Visual Basic application ,that runs on the machine with the Caller-ID connected, and monitors the serial port for incoming calls. This then takes the number, looks it up in a file, and, if the 'name' of the caller is in the file then the name is used in stead of the number.

I have a number of devices in my house, that (predictably) are completely incompatible, and I wanted to build something that was 'extensible' for future displays and things to allow me to put the caller info up on the TV etc.

Interfacing to MediaCenter 2005

Firstly, I needed a way of displaying messages on the MediaCenter TV screen, in the nice 10 foot interface. I found MCE-YAC (yet another callerid) at http://www.byz.org/~ethanz/mce-yac which is essentially a media-centre network client application for MediaCenter, which can take messages from the popular YAC application (www.sunflowerhead.com/software/yac), which is a fully featured Caller-ID program.

Now this seemed like it would all work nicely, but I then discovered that MCE-YAC acts as a network listener, using a TCP Socket 10629, so I wrote a quick .NET app which can send on TCP ports, and called that from a command script.

I then modified my VB caller-id app which listens to the caller-id unit, to call out to a command script which then notifies all my devices - this allows easy addition of other devices and stuff via a command script. The script below also sends the caller info to my Roku Soundbridge M1000.

The vb app calls this script, with 2 parameters, a message and a name, but you could modify this to say anything, and it will appear on the MCE screen, as well as the Roku Soundbridge M1000.

Sample script:

@echo off
if exist c:\cid\ locked.flg goto end
echo locked > c:\cid\locked.flg
c:\cid\socketsend (mce-ipaddress) 5150 pause
c:\cid\socketsend (mce-ipaddress) 10629 %1 %2
c:\cid\rocku-display (roku-ipaddress) scroll pause %1 %2
del c:\cid\locked.flg

You can download my nasty hacked-together utilities: socketsend, or roku-display, I make no claim to quality coding with these, nor originality, as most of the code is sample stuff available on the internet. It took a little while to get the Roku to behave, and sometimes it doesnt quite work properly - make of it what you will.

I will post the VB Caller-ID app if there is demand, but it will need re-writing slightly, as I use a 3rd party socket OCX in there which is not distributable - and you wont be able to build it.- post a comment if you are interested and I'll do something with it if anyone is interested....

Going further...

It also seemed logical that if the phone rang, the MCE 2005 machine should 'pause' whatever it is doing and let you answer the phone. This was fairly easy once I discovered the excellent
MCE Controller app (www.kindel.com/products/mcecontroller). this allows you to send any supported remote-control command to MCE via the network.. and seeing as I already had a nice little TCP sender program, that was easy:

c:\cid\socketsend 5150 pause

Now the MCE machine pauses when the phone rings, and displays the caller ID info if there is any. The only slight issue with this is that 'pause' is a toggle, so if you're 'paused' when the phone rings, it will play again! - this is not an issue for me, as I've never suffered from it, but you could work around it with sending repeated vol- commands to turn it down I suppose.

Skype

Finally, it was time to join the VOIP revolution. Some time ago I concluded that the best WAF would be achieved if I could integrate the Skype with the home phones, and hey presto, this is exactly what the 'Yamamoto EasyBlue' USB interface does. http://www.yamamoto-group.co.uk/index.php?page=easyblue - available on Ebay, and lots of other places.

So, to summarise the way I set it up:



This makes all the house phones ring when there is a skype call , and they still work normally for standard phone calls. The incoming ring is slightly different (it's longer), when skype calls are received, so you can tell the difference.

To make a call, you just lift a handset, and dial normally, for a skype call, lift the handset and dial * followed by the short-dial for the skype contact you want (1-99) and then #.

Clearly, the PC has to be 'ON' for this to work, with SKYPE running, and the little 'callme' application that comes with the easyblue.

the solution works really well, the call quality to a friend in Australia recently was excellent.

I also added 'MCEPhone for Skype' to the Media Center, http://www.cbuenger.com/mcephone/ - as it's an excellent way to manage your skype from MCE, though with the EasyBlue connected you should really initiate phone calls with the phone handset and dial-pad to avoid calling people and have no way of hearing or speaking to them!

There's only one thing missing from Skype- the ability to 'sign-in' and 'sign-out' at specific times. Now if you have a PC and a headset with skype, I guess this isnt important, because you turn off the PC, or sign out of skype at night etc. But! - if all your phones are hooked up to it, it's quite important, because sooner or later someone will skype you at 2am in the morning, and all your phones will wake you up!

Enter 3rd nasty .NET utility: SkypeCommand. I'm too ashamed of the quality of the code in this to post it right now, I'll clean it up and post it soon. 8-o

This allows a really primative command-line interface to Skype. I only needed to be able to send
'SET USERSTATUS INVISIBLE' and 'SET USERSTATUS ONLINE', but there are many comamnds supported by the Skype Messaging API that probably work. This app is run from a scheduled task in Windows, and at the appropriate time I send the 'online' or 'invisible' command to skype, and I drop off the map when I want to get a peaceful nights sleep. Probably the only other recommendation is that you only allow skype calls from your contacts, but then if you've used skype you've probably learned that one already - unless you like random calls from people you dont know 8-)

More another time... Probably my experiences with the Harmony remote control....

3 comments:

Steve said...

I'm interested in what you did with the Caller ID interfacing with YAC... The IC required "MOCD217M" is discontinued what did you use?

Steve

mart said...

Hi Steve.
I did indeed use the MOCD217M, though it should be possible to get a replacement component that has compatible specifications, if you dig up the specs on the MOCD217M and then visit your local electronics store etc - if you're UK based (I'm assuming you are!), the local maplin store should be able to find something similar from the specs. I think the main thing is that it doesnt draw too much current, as you're running off the internal batteries in the CD50.

Either that or call the technical helpline at CPC where I got mine from (www.cpc.co.uk)

Let me know how you get on, sorry its taken so long to get back to you, I've been away on holiday.

I seem to recall ordering a bunch of them, so if I come across one in the next few weeks, I'll be happy to send it to you, I think they were all of 50p each, or less possibly!

There is an alternative circuit here: http://www.photon.dyndns.org/projects/btcd50conversion/old_index.html if you cant get a coupler, but I couldnt get this one to work-- it's a bit more complex thuogh, and I'm not renowned for my soldering skills!

Mart.

Anonymous said...

Hi Martin, I managed to get an IC and the hacked CID unit is outputting the telephone number ok when I view it with a serial logger program... My next part is to try to get it into YAC on my MCE box and other computers.. I am interested in a copy of your application if possible. I have little coding knowledge however along time ago I did do a basic VB course. If you want to drop me an email:- email@stevejones.org we can discuss remuneration.. Many thanks Steve