SIP::respond

Description

This command allows you to terminate a SIP request and send a custom formatted response directly from the iRule.

Syntax

SIP::respond code <“phrase” <“header-name” “header-value”> >

SIP::respond code <“phrase” <“header-name” “header-value”> >

  • Terminate current SIP request, send back a response with code, phrase and header-name header-value pairs

Examples

when SIP_REQUEST {
  log local0. [SIP::uri]
  log local0. [SIP::header Via 0]
  if {[SIP::method] == "INVITE"} {
    SIP::respond 401 "no way" X-Header "xxx here"
  }
}