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.
The Respond function generates a SIP response to the current request message with the supplied status code and reason phrase.
bool Respond( string statusCode, string reasonPhrase, string appendHeader1, string appendHeader2, ..., string appendHeaderN );
Returns false if the current message is not a request (see the description of the sipRequest built-in variable in MSPL Built-in Variables (Updated)), or if a non-1xx response has already been sent. Otherwise, it returns true.
New headers are appended to the response by passing them in complete form as additional parameters to this function. For example, to add a "Contact" header to a response, the following call is correct:
Respond("200", "OK", "Contact=<firstname.lastname@example.org>;param1=value1");
If the "=" (equals) is not present in the appended header or headers, a critical MSPL error is raised for each occurrence where it must be present.