Thursday, April 22, 2010

Create a UCMA application with presence aware workflow

In a webcast which I did together with Joachim Farla about Unified Communications Development For Non Professional Developers I talked about creating a UCMA workflow. It is based on the inbound/outbound sample which you can download from

It is a pretty simple application; it starts a collaboration platform, registers an OCS endpoint and begins listening for incoming calls (or IMs). In this example, it uses client credentials. For production usages, take a provisioned application to do this.


At the same time it also starts a Windows Workflow runtime. When a message is received, it is passed to this workflow so it can be handled. The workflow is the standard XOML workflow of the Windows Workflow Foundation but enhanced with a communications service and OCS activities.


It will first accept the call, determines the presence of a configured SIP address and with an if/else construction choices the right branch. If the user is online, an instant message is send with a question and answer activity. if the user is offline, a outgoing voice call will be created. Using the text to speech functionality, the user will hear some text spoken to him/her and a question is being asked. After giving an answer, the call is disconnected. Meaning you can still reach the user over the phone but use IM primary when he/she is available.

You can configure the actions with your own answer/question systems, call other users, disconnect the call or use speech. There are a lot of OCS activities to pick.


Very simple, but it shows how to use the workflow to make interactive sessions with a user.

To run this sample, make sure you have Visual Studio 2008/2010 and the UCMA SDK installed. You can create an OCS test account at or use your own.

Please see the video for a demonstration of the code.

Presence Aware Workflow with OCS 2007 R2 from e-office on Vimeo.


yang said...

You mention Visual Studio 2010 but I couldn't manage to install UCMA SDK without Visual Studio 2008 SP1 installed.

Copied the UCMA dlls from another machine but always receiving "BadImageFormatException" although I set the project framework version to 3.5.

Any help is greatly appreciated...

Marc Wetters said...

Try setting to version 2.0

Regards Marc

Adam said...

Great post, How would you go about extracting arbitrary text from a user message. Is this possible once in the workflow. Thanks