Share via


Application Manifests

The application manifest is an XML document that describes a Live Communications Server application to the server on which it is running. This document is presented to the server when the application registers with Live Communications Server through the Microsoft.Rtc.Sip.ServerAgent managed class.

An application manifest is composed of three elements:

  • An <alias:applicationManifest> tag that encapsulates the application attributes and message filter script, sets the alias for the namespace ("lc" in these examples), and defines the name and location of the application. If you do not use an alias specific to your application, Microsoft recommends you choose the default alias of "lc".
  • A set of application attributes that defines key properties of the application, such as the SIP message types to filter and whether it is script-only.
  • A message filtering script written with the Microsoft SIP Processing Language, defined in a CDATA element enclosed by the <alias:splScript> tags.

The application manifest file, once created, is embedded in an application assembly as a resource, or exists as an external file. Application manifests can be generated in-line or dynamically as appropriate; for example, an application could filter on location-specific URIs or domain values supplied by code logic.

Application manifests are loaded manually for script-only applications. For managed-code applications, application manifests are loaded into an application using the ApplicationManifest class, and are compiled by calling the Compile method on the new ApplicationManifest object.

The following code example demonstrates how this is accomplished:

                                
        ResourceManager myResourceManager = new ResourceManager(MyApplicationType);
        string appManifestXml = myResourceManager.GetString("appManifest");

        ApplicationManifest myAppManifest = ApplicationManifest.CreateFromString(appManifestXml);
        try {
            myAppManifest.Compile();
        }
        catch (CompilerErrorException cee) {
            Console.WriteLine("Failed to compile.");
            foreach (string message in cee.ErrorMessages) {
                Console.WriteLine(message);
            }
            return;
        }

After a successful compilation, the compiled application manifest is presented to the server agent, which uses the supplied attributes along with the rules defined in the MSPL message filter to dispatch only those SIP messages your application is designed to process. All other messages are proxied (or dropped, if specified).

A basic application manifest to handle only SIP INVITE and MESSAGE requests might look like the following:

<?xml version="1.0" ?>
<lc:applicationManifest
   appUri="http://www.adatum.com/myApplicationLocation"
   xmlns:lc="http://schemas.microsoft.com/lc/2003/05">
   <lc:requestFilter methodNames="INVITE,MESSAGE" 
                       strictRoute="false" 
                       registrarGenerated="true"
                       domainSupported="true"/ >
   <lc:responseFilter reasonCodes="NONE" />
   <lc:proxyByDefault action="true" />
   <lc:scriptOnly />
   <lc:splScript><![CDATA[
    if (sipRequest) {
       if (sipRequest.Method == StandardMethod.Invite) {
          Dispatch("NameOfInviteHandlerMethodInApplicationHere");
       }
       else if (sipRequest.Method == StandardMethod.Message) {
          Dispatch("NameofMessageHandlerMethodInApplicationHere");
       }
    }
   ]]></lc:splScript>
</lc:applicationManifest>