QueryEndpoints

The QueryEndpointsfunction queries the server registrar for the network endpoints associated with a specified user and hostname combination.

Syntax

  Copy codeCopy code
collection<RegistrarEndpoint> QueryEndpoints(
  string userAtHost,
  boolean forceDatabaseLookup
);

Parameters

userAtHost

A string containing the user and hostname in the format "someone@example.com" for which endpoints will be queried on the SIP registrar.

forceDatabaseLookup

If true , this function always queries the registrar database; otherwise, if endpoint data is available in the internal cache, it uses that data instead. This parameter is optional; if it is not present, the value defaults to false .

Return values

Returns a collection of one or more RegistrarEndpoint objects that contain the known endpoints associated with the SIP user and hostname. If no endpoints are found on the registrar, this function returns an empty collection.

Remarks

This function is valid only in the context of a foreachstatement. The foreachelement variable must be the MSPL built-in variables built-in variable. The following example illustrates the correct usage of this function.

Example code

  Copy codeCopy code
foreach (dbEndpoint in QueryEndpoints("someone@example.com")) {
  // Inside the body of the foreach statement, the
  // dbEndpoint.fieldName field can be referenced. Outside
  // of the body of this foreach loop, any reference to the
  // endpoint variable evaluates to false.
}