My long time friend and client Peter Jenkins presents on the business benefits of host VoIP and the VoIP Advantage offering.
Joel's SharePoint Architect Blog
SharePoint 2010, MOSS & WSS Tips and Consultancy Tales
Subscribe
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk
Posts Tagged ‘Telephony’
Making Phones Ring with One Line of Code – Tim Stevens
Wed, 14 Nov 2007 13:54:27 GMT
Tim Stevens
BT Web21C
Web 21 C from British Telecom is an interesting entity. As you can see from http://web21c.bt.com, they’ve been busy building Web 2.0 telephony technology.
What is It?
The package is a services plus services offering: they host the telephony infrastructure to perform conference calling, SMS messaging, hooking phones together, and they also host web services you can invoke to make it happen.
In fact, BT is touting this service as “Make Phones Ring with One Line of Code.”
Platform
The developer client libraries target .NET, Java, PHP and a bundle of others. Additionally you can have access to the raw SOAP services if you can role your own WS-*.
The .NET side requires a few other things to be installed to work, which brings me to the point of this blog entry.
Making Phones Ring…
This bit works. You can write very simple code to start hooking phones together. If you want to implement a Web 2.0, call-me-back, call-centre type scenario, then it’s a very simple matter of invoking an API method and supplying it with a couple of phone numbers. Both phones ring, and when they pick up, the Carbon Units at the end of the phone lines are able to talk to each other. Also, SMS and conference calling all works a treat.
…with One Line of Code
This is where the promise falls down.
Yes, I can hook my stuff together with 1 line of code. Procedural code, that is.
The sales pitch makes no mention of how much declarative code you have to write. Yes, I count configuration as declarative code. So… How far away from “one line” of code are we?
- Register your new application with BT – i.e. submit a web for tell them that you want to use their service (OK, at some point you’ve got to pay per click, so this is reasonable)
- Step 1 will result in you receiving a new application certificate (.PFX file) – you need to register this on your machine (and possibly your production machines too)
- Double click the PFX file
- Follow the 4 step wizard
- Download the BT SDK
- Install the SDK certificates on your dev (and therefore production) machines – there are 3 of them:
- cacert.cer – to Trusted Root Certification Authority
- btsdkservercert-acorn.cer – to Trusted People
- btsdkservercert-oaktree.cer – to Trusted People
- Install the BT libraries and reference them in your application
- Create a WSE Policy file using the BT SDK – run WSE3PolicyGenerationWizard.exe which comes with the SDK
- Configure your application for WSE 3 – apply settings and point WSE at the policy file “wse3policyCache.config) we created in step 5
Edit app.config like this:
<configSections>
<section name=”microsoft.web.services3″ type=”Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
</configSections>
<microsoft.web.services3>
<security>
<x509 storeLocation=”CurrentUser” />
</security>
<policy fileName=”wse3policyCache.config” />
</microsoft.web.services3>
Install Web Service E
xtensions 3Now you’re getting ready to write code
Show Me the Code!
So after this 9 step process (more like 20-or-so if you count them properly), you can start writing code properly. The code snatch below is my little wrapper to their API. It shows one tiny part of the API – how to send a text message.
public static string SendSMS(string recipient, string from, string message)
{
MessagingOneWayManager manager = new MessagingOneWayManager();
Message messageObject = manager.SendMessage(“tel:” + recipient, from, message);
// not sure if we actually need this Sleep(), but it’s in the sample!
Thread.Sleep(2000);
// Check the status of the sent message
Collection<MessageDeliveryStatus> statuses =
manager.GetMessageDeliveryStatuses(messageObject.MessageId);
if (statuses.Count > 0)
return statuses[0].MessageStatus.ToString();
else
return “”;
}
Summary
It’s nice, but it’s not really nice. The amount of extra faff you have to do means you can’t just start hitting their web services. BT ran a little competition during TechEd 2007 this week to drum up some developer enthusiasm over this offering. I knocked together a little app to pull all my contacts with mobile phone numbers from Outlook, populate a .NET listview, double click to select, then fill in a form to send a text message to the selected contact. The coding took 15 minutes. The setup took 2 hours to get just right – the supplied SDK help is a little terse.
SMS is obviously a trivial example, and their platform is capable of a lot more. However, here’s how to do it with a random SMS provider I found of the Interweb, 10 seconds ago:
http://www.tmcsms.co.uk/api/SendService.aspx?
method=SendMessage&email=[email]&pwd=[pwd]&recipients=[recipients]
&body=[body]&reference=[reference]&source=[source]&confirm=[confirm]
Now, I have no idea who these guys are, but their API is much better documented and really obvious.
I’m sure the BT offering has a compelling story, but that story isn’t the developer one.
[DISCLOSURE: My app won a prize from BT :)]


