This documentation is archived and is not being maintained.

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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

  • Message sipMessage;

  • Request sipRequest;

  • Response sipResponse;

  • RegistrarEndpoint dbEndpoint;

  • string FQDN;

  • string ServerPool;

  • ServerRole Role;

  • TargetInfo RequestTarget;

Message (Updated) sipMessage;

The sipMessage variable contains the current SIP message passed from the Office Communications Server to the application.

Request sipRequest;

The sipRequest variable contains the current SIP request message passed from the Office Communications Server to the application.

Response sipResponse;

The sipResponse variable contains the current SIP response message passed from the Office 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 (Updated) dbEndpoint;

The dbEndpoint variable contains a network endpoint as stored in the Office 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("")) {

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.

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

ServerRole Role;

The Role variable contains the role of the server where the SPL is executing.

TargetInfo RequestTarget;

The RequestTarget variable contains details about the target of the request. This is valid only if the script is executing because of a request (as opposed to a response).