Compartilhar via


MSPL Built-in Variables

 
Microsoft Office Live Communications Server 2005 with SP1

MSPL Built-in Variables

MSPL defines six built-in variables for use with SIP message processing:

  • Message sipMessage;
  • Request sipRequest;
  • Response sipResponse;
  • RegistrarEndpoint dbEndpoint;
  • string FQDN;
  • string ServerPool

Message sipMessage;

The sipMessage variable contains the current SIP message passed from the Live Communications server to the application.

Request sipRequest;

The sipRequest variable contains the current SIP request message passed from the Live Communications server to the application.

Response sipResponse;

The sipResponse variable contains the current SIP response message passed from the Live Communications server to the application.

Scripts test for the message type (request or response) by first determining if the corresponding built-in variable evaluates to true or false. If it evaluates to true, the message is the one tested for. If false, it is not.

For example, to test if the current message is a request:

if (sipRequest) {
  ...
  // Process the request here.
  ...
}

Then, to test if the message is a response:

if (sipResponse) {
	...
	// Process the request here.
	...
}

This test should always be performed before any expressions involving fields on the request/response are performed. For example, if you attempt to access the StatusClass field on the sipResponse variable before determining that the message is, in fact, a response, it will return false instead of the expected status code string when a request or server notification is encountered instead of a response. This leads to logical errors when code like

sipResponse.StatusClass != StatusClass._2xx;

is encountered when a message type determination has not been made. The above code always evaluates to true for anything but a response; in this case, checking the message type is important to ensure proper filtering.

You can store the body of a message in the Content field. As a result, the following expressions are valid in MSPL:

sipMessage.Content = "this is the body of a message"; 
sipRequest.Content = "this is the body of a request"; 
sipResponse.Content = "this is the body of a response";

RegistrarEndpoint dbEndpoint;

The dbEndpoint variable contains a network endpoint as stored in the Live Communications Server registrar database. This variable is valid only within the scope of a foreach loop that iterates over the collection returned by a QueryEndpoints function call.

For example:

foreach (dbEndpoint in QueryEndpoints("user@hostname.org")) {
	...
}

string FQDN;

The FQDN variable contains the fully qualified DNS name of the local server.

string ServerPool;

The ServerPool variable specifies the name of the pool of the server on which the application is running.

Note  All references to built-in variables are read-only.

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