Share via


ServerAgent.ServerAgent(Object,ApplicationManifest) constructor

 
Communications Server 2007 Server SDK Documentation

ServerAgent.ServerAgent (Object, ApplicationManifest)

The ServerAgent constructor creates an instance of a ServerAgent object with the specified dispatch handler object and application manifest.

[C#]
public ServerAgent(
Object app,
  ApplicationManifest manifest
);
FakePre-a312bcfc21fe4eae8616b0515bd24def-1db42d563a7748fb86de53859743b820

Parameters

  • app
    Specifies an application object that implements dispatch handler methods specified in the manifest.
  • manifest
    Specifies a compiled ApplicationManifest object.

Remarks

This constructor is used by applications that receive messages dispatched from an MSPL script in the application manifest. The provided object implements the dispatch handlers for filtered messages.

A method used for handling specific dispatches is specified in the message filter script by calls to the MSPL built-in function Dispatch, passing the name of the method. Within the application, these methods must be implemented on a class, an instance of which is passed to this constructor. For example, if you have a call to Dispatch within the message filter script that appears as follows:

if (sipRequest) {
   Dispatch("OnRequestReceived");
}

As shown in the following example, you also need a corresponding method implemented in the application. Note that for request handlers, the function signature must match that of the RequestReceivedEventHandler delegate. For responses, the function signature must match that of the ResponseReceivedEventHandler delegate.FakePre-49b6a274fbad478a8d8dd846ea927f66-ccc54e063f824d2595b3abae55477b7bWith the class and the dispatch handlers implemented, you are able to call the constructor and create an instance of the ServerAgent class.FakePre-6b66b75803594f30b4e262a565ff70c8-db3cf79b9e4147bc920a99535c18ad09

The assembly containing the specified application object is searched for classes inheriting from built-in SIP classes, such as ServerTransaction. These classes are used whenever the SIP library needs to create a SIP object. This allows applications to maintain additional state with each SIP object. To take advantage of this feature, an application should use the [DefaultRTCClassAttribute] attribute on the class definition.

Two common exceptions that should be caught when calling this constructor are:

  • ServerNotFoundException: The Office Communications Server is not running.
  • UnauthorizedException: A connection to the Office Communications Server could not be initialized. This is because of the current security context (user must be a member of the "Communications Server Users" local group), because the application has not been configured to run on this server (through WMI), or because an application with the same URI (as specified in the application manifest) is already running.

Requirements

Redistributable: Requires Microsoft Office Communications Server 2007.
Namespace: Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)

See Also

SIP Application Manifests, Creating a SIP Application for Office Communications Server, ServerAgent

  
  What did you think of this topic?
  © 2007 Microsoft Corporation. All rights reserved.