Hi there.
The last three weeks has been very exciting and the future is going to bring even greater things. You will probably ask you self why I would write this and to answer this I will use a few lines to explain.
My name is Peter and for the last few years been working in the telecommunication business. A month ago I was lucky enough to get employed by Inceptio to do consulting and development on the UC platform (E.g. OCS and Exchange).
For some time I have being reading and fooling around with the Office Communicator 2007 API SDK and it has been fun and at times frustrating. The reason for this post is to share ideas and possibilities provided by Microsoft UC platform. So to start from the beginning I thought of bringing a small and simple example and I will then continue to post more advanced samples based upon my own experiences with UC development. Below is my first example that shows how to hookup to some of the events that the Office Communicator 2007 Client exposes. Basically it writes a message in the console every time a new conversation windows starts or closes.
The example down below can be the foundation for an application that helps in retrieving information about the incoming caller. Information like calling history, email conversations, location information, billing information, project information. As one se the possibilities is endless.
In my next blog entry I will start to add functionality to retrieve some of the above mentioned information types.
Until then...
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace EventFun
{
class EventHookUp
{
CommunicatorAPI.Messenger mCommunicator = null;
static void Main(string[] args)
{
EventHookUp hu = new EventHookUp();
hu.InitializeEventHocks();
Console.ReadKey();
}
public void InitializeEventHocks()
{
mCommunicator = new CommunicatorAPI.Messenger();
mCommunicator.OnIMWindowCreated += new CommunicatorAPI.DMessengerEvents_OnIMWindowCreatedEventHandler(mCommunicator_OnIMWindowCreated);
mCommunicator.OnIMWindowDestroyed += new CommunicatorAPI.DMessengerEvents_OnIMWindowDestroyedEventHandler(mCommunicator_OnIMWindowDestroyed);
}
void mCommunicator_OnIMWindowCreated(object pIMWindow)
{
CommunicatorAPI.IMessengerConversationWndAdvanced stpIMWindow = pIMWindow as CommunicatorAPI.IMessengerConversationWndAdvanced;
long Hwnd = (long)stpIMWindow.HWND;
Console.WriteLine("New IM Window Created : {0}", Hwnd);
//Listing Frindly name of the caller.
CommunicatorAPI.IMessengerContacts contactList = (CommunicatorAPI.IMessengerContacts)stpIMWindow.Contacts;
StringBuilder sb = new StringBuilder();
foreach (CommunicatorAPI.IMessengerContact imc in contactList)
{
sb.Append(imc.FriendlyName);
sb.Append(Environment.NewLine);
}
Console.WriteLine(sb.ToString());
}
void mCommunicator_OnIMWindowDestroyed(object pIMWindow)
{
Console.WriteLine("IM Window Destroyed.");
}
}
}
If you want to read more about the API’s then take a look at these posts/blogs
Chris Mayo -> http://blogs.msdn.com/cmayo/
Michael Dunn -> http://blogs.msdn.com/midunn/
George Durzi -> http://blogs.claritycon.com/blogs/george_durzi/default.aspx