Microsoft Office Live Communications Server 2003


Microsoft Office Live Communications Server 2003 replaces the Exchange IM server. With Live Communications Server, you administer your users through Active Directory, just as you do with Exchange, and you can easily enable or disable Live Communications Server for users through the Active Directory graphical management interface, as shown in Figure 19-2.

click to expand
Figure 19-2: The user interface to enable or disable RTC for users in Active Directory

Once you enable a user for Live Communications, the Server will fill in properties for the user in Active Directory, such as msRTCSIP-PrimaryHomeServer , msRTCSIP-PrimaryUserAddress , and msRTCSIP-UserEnabled . You can query for these properties using Active Directory Service Interfaces (ADSI), which you learned about in Chapter 13.

Live Communications Server uses SIP and the related SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE). Live Communications Server allows users to register the presence information with the server and query for other users' presence information. The SIP and SIMPLE standards are owned by the Internet Engineering Task Force (IETF).

The most common way to program against Live Communications Server is by using the Windows Messenger library or the Live Communications Client API. If you are running on client platforms other than Windows XP, you should use the Messenger API because that client is supported on other platforms. The Live Communications Client API is supported on other platforms, but with limited capabilities. However, if you have Windows XP, you can leverage the Live Communications Client Library, which is integrated directly with Windows XP.

I will show you the basics of using the Live Communications Client API, but you can find full documentation of this rich object model on MSDN. You should refer to this documentation to build more advanced Live Communications Client Library applications. Furthermore, if you want to build server-side Live Communications Server applications, you should install the server and its companion SDK to learn how to build extensions to the server for your particular application.

The Live Communications Client Library

The Live Communications Client Library is a COM-based library. In the library, the main objects are the Client, Session, Participant, Buddy, Watcher , and Profile objects. The Client object is used to set up the Session object with the correct settings. The Session object allows you to create a session with another user, answer a session from another user, or terminate a session. The Participant object contains all the information about a session participant.

The Buddy and Watcher objects work together to provide presence querying and details information. Using these objects, you can look for the presence of people in your buddy list. You can also listen for when others add you to their buddy list and request the status of your presence information.

Finally, the Profile object is used to maintain your client provisioning information, such as your server, your display name , your logon alias, and other information about the current user's profile.

Building Your First Live Communications Client Application

The sample code we will look at is written in Visual Basic. When you program against the Live Communications Client Library, you must add a reference to the Live Communications Core 1.0 Library (also known as RTC Core 1.0 Library), which contains the objects we want. Figure 19-3 shows this step in Visual Basic. You can also use the Live Communications Client Library from .NET, using the COM interoperability mode of .NET.

click to expand
Figure 19-3: Adding a reference to the Live Communications Core 1.0 Library in Visual Basic

The next step is to start your coding. With the Live Communications Client Library, you must initialize the object library before attempting to program against it. You do this by calling the Initialize method on the Live Communications Client object. Once you initialize the library, you can display personal information about the currently logged on user or send instant messages to other users. The following Visual Basic code shows how to use the Real Communications Client Library:

 Dim WithEvents oRTCClient As RTCClient      Private Sub Command1_Click()     Dim oRTCClient As New RTCClient     Dim strDestURI As String        '(for example, someone@example.com)     Dim strDestName As String       '(for example, Neil Charney)     Dim strMsgHeader As String      '(specify message header)     Dim strMsg As String            '(specify message)     Dim lCookie As Long             '(Application-provided cookie used for                                     ' pairing the notifications with the                                     ' messages sent)     Dim oParticipant As IRTCParticipant     Dim oSession As IRTCSession          Set oRTCClient = New RTCClient          'Initalize the client     oRTCClient.Initialize          'Put out some basic information     MsgBox ("Username: " & oRTCClient.LocalUserName & vbLf _             & "URI: " & oRTCClient.LocalUserURI)          oRTCClient.ListenForIncomingSessions = RTCLM_DYNAMIC          strDestURI = "thomriz@thomrizex03dom.extest.microsoft.com"     strDestName = "Thomas Rizzo"          'Create an IM session.     Set oSession = oRTCClient.CreateSession(RTCST_IM, vbNullString, _                                             Nothing, 0)          'Add a participant to the IM session.     Set oParticipant = oSession.AddParticipant(strDestURI, strDestName)          strMsg = "Test!"     strMsgHeader = "MIME-Version: 1.0\r\nContent-Type: text/plain; " _                  & "charset=UTF-8\r\n\r\n"          'Send a message.     oSession.SendMessage strMsgHeader, strMsg, lCookie      End Sub      Private Sub oRTCClient_Event(ByVal RTCEvent As RTCCORELib.RTC_EVENT, _                              ByVal pEvent As Object)     If RTCEvent = RTCE_PARTICIPANT_STATE_CHANGE Then         MsgBox "Participant changed state!"     Else         MsgBox "Event raised: " & RTCEvent     End If End Sub 



Programming Microsoft Outlook and Microsoft Exchange 2003
Programming MicrosoftВ® OutlookВ® and Microsoft Exchange 2003, Third Edition (Pro-Developer)
ISBN: 0735614644
EAN: 2147483647
Year: 2003
Pages: 227
Authors: Thomas Rizzo

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net