Wednesday, 23 April 2008

RickRolling the Phone Network at Web 2.0 Expo

I built a little demo for Web 2.0 that rick rolls the phone network. If you haven't come across rickrolling, the basic concept came about when people started getting sent links to the below Rick Astley video

Most annoying. Some of the implementations refused to let you close the browser window as well.

Well, I thought that for the Web 2.0 Expo I'd do that to the phone network, and try and get folk to rickroll each other. So in a midnight-through 3am coding session, I came up with a cool app.

If I haven't taken it down yet (that'll happen on Friday 25th April) you can try it.

Just send an SMS with the word "rick" to +447800000320

If it's still working you'll get called back - press a key, and then you'll get the dulcet tones of Rick Astley crooning at you across the phone network.

So, how did I build this?

Using, of course, the fabulous Web21C services from BT, and CallFlow in particular.

I used a YouTube downloader to pull the Video down, and extract an mp3 file from the flv file. Then used Sony Acid Pro 6 to edit it and convert it to a suitable format (open source products such as Audacity may be used!).

I uploaded to the CallFlow platform the resulting wav file, rick.wav, and another one, press.wav. They need to be there so that they can be played back to the poor victim over the phone line.

Then I got hold of an Inbound SMS (Mobile Originated) number from my colleagues; if you want to use this service you have to register, and order a number through the web site. But once you've got it, implementing the rest of the code is dead easy, and will run off your laptop!

Wanna see some of the code? Here's some of the highlights. Written in C#, as a console app; BT has SDKs for Python, PHP, and Java too.

1. Retrieve messages and clear them down from the BT servers

Collection<Message> messages = smsIn.GetReceivedMessages();
Collection<string> mIds = new Collection<string>();

foreach (Message m in messages)
RickRoll(m.MessageText, m.SenderUri);
if (mIds.Count > 0) smsIn.ClearReceivedMessages(mIds);

2. The highlights of the RickRoll function, creating some XML for placing the call.

//create the callflow XML
StringBuilder sb = new StringBuilder();
sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
sb.Append("<callflow xmlns=\"\">");
sb.Append(String.Format("<call id=\"start\" target=\"{0}\" next=\"check\" />", roll.Target));
sb.Append("<prompt id=\"check\" audio=\"press.wav\" barge=\"true\" firstDigitTimeout=\"30\">");
sb.Append("<input pattern=\"0\" next=\"prank\"/>");
sb.Append("<input pattern=\"1\" next=\"prank\"/>");
sb.Append("<input pattern=\"2\" next=\"prank\"/>");
sb.Append("<input pattern=\"3\" next=\"prank\"/>");
sb.Append("<input pattern=\"4\" next=\"prank\"/>");
sb.Append("<input pattern=\"5\" next=\"prank\"/>");
sb.Append("<input pattern=\"6\" next=\"prank\"/>");
sb.Append("<input pattern=\"7\" next=\"prank\"/>");
sb.Append("<input pattern=\"8\" next=\"prank\"/>");
sb.Append("<input pattern=\"0\" next=\"prank\"/>");
sb.Append("<input pattern=\"#\" next=\"prank\"/>");
sb.Append("<default next=\"unprank\"/>");
sb.Append(String.Format("<announcement id=\"prank\" audio=\"{0}.wav\" />",roll.Prank));
sb.Append("<hangup id=\"unprank\" />");

//Call BT's Callflow Service and place the call
roll.CallFlowId= callFlow.StartCallFlow(sb.ToString());

There really isn't very much more to the code - a bit that monitors each callflow to check that the phone was answered - the script does a "Press 1 if you're not an answerphone" check

The entire code is downloadable here - you won't be able to run it straight of the bat, because of it's reliance on an inbound SMS number tied to my account, and certs referenced in a config file - get your own from BT - but it may be interesting to read.

Friday, 11 April 2008

Small Businesses and IT

One thing that I am 100% convinced of, is that over the course of the second half of 2008 a new class of application will begin to emerge in anger. Rather than being based on an underlying Single Machine Operating System, it will be composed of “cloud” services.

So where EC2 and S3 provide compute units and storage in the cloud, the next stage is to compose higher level functionality into cogent solutions, and no longer worry, from a development platform, what Single Machine Operating System lives underneath. The platforms to support these are currently divergent – , Google AppEngine, the platform that MSFT are clearly about to launch – these allow you to create generic functionality on fully hosted platforms, but from a 50,000 foot view they provide automatically scaled out, redundant platforms, generally with storage, data, and UI components.

Add a bit of Google Gears, or Microsoft FeedSync, two different techniques for occasionally connected apps (and, the piece often forgotten, occasionally unavailable Platforms-In-The-Cloud!)

Mix in a bit of Hosted Exchange, which you can buy from all over the place, or Google Calendar.

Throw in some oAuth and OpenID for decentralised delegation and authentication.

Add some hosted IVR or SMS from solutions like that from my employer, and you too can have CTI like the big players.

And it looks like the applications that SMBs will buy in 2008/2009 will look very different to the ones they bought in 2007.

This leads me to the conclusion that both sales and reward, and software development processes for small ISVs will start to look very different from today's models. Instead of on-premise based software, or even ISV hosted solutions, generic, composable mashups will be assembled from cloud based primitives through an oDesk type model (no more staffing issues!), and then “mashups of mashups” will probably get sold through a network of affiliates who do highly localised (both geographically and vertically) marketing and the small amount of custom integration work – which will be largely graphical – required for an end customer. Reward models could be based on subscription payments from end customers, and revenue share to the affiliate channels

The problem is working out which generic functionality, and which SMB verticals to address first!

Are you an SMB? Would you like me to come and build you some software? What's the itch you have that needs scratching? Which of your staff could be replaced by a clever machine? How can you empower your customers to interact with your business in ways that benefit both you and them?

Trust me, small business software is easier, quicker, and less risky then it used to be. If you want to know more, I can be reached, in the first instance through this blog.

Saturday, 5 April 2008

Nicest Airport Experience Ever

I'm in Israel for Microsoft TechEd where I'm speaking with a friend of mine, Shy Cohen.

Microsoft have really done their best to make me welcome here. As I stepped out of the door of the plane at Ben Guiron airport in Tel Aviv, there was a friendly chap waiting for me (first time I've ever been met by a stranger with my name on a piece of paper), who escorted me past all the queues for immigration, wheeled my luggage through customs and got me across to the domestic terminal.

Now OK, I've got a 4 hour wait for my next flight south to Eliat, which is dull, but, joy of joys, there is FREE Wi-fi in the airport terminal. And I think I'm the only person using it, as the terminal is largely empty; today is the Sabbath and it seems this is taken pretty seriously around here.

Next to find somewhere to plug the power in - this may be a little trickier... I hope I brought a suitable power adapter.

Tim Stevens

Tim Stevens
Be Silent