RTSP::header

Description

Manages headers in RTSP requests and responses.

Syntax

RTSP::header exists <header_name>
RTSP::header insert <header_name> <header_value>
RTSP::header remove <header_name>
RTSP::header replace <header_name> <value> <header_name> <value>
RTSP::header value <header_name>

RTSP::header exists <header_name>

  • Returns a value of 0 or 1, indicating whether the specified header is present in the current RTSP request/response. This command is valid in the RTSP_REQUEST and ‘’’RTSP_RESPONSE* events.

RTSP::header insert <header_name> <header_value> …

  • Inserts one or more headers into the current RTSP request/response. This command accepts either a list of name/value pairs or a single argument that is a TCL list of name/value pairs.

RTSP::header remove <header_name>

  • Removes all instances of the specified header from the current RTSP request/response.

RTSP::header replace <header_name> <value> <header_name> <value>

  • Removes all instances of the first header, and inserts the second header into the current RTSP request/response.

RTSP::header value <header_name>

  • Returns the value associated with the specified header in the current RTSP request/response. Returns an empty string if the header is not present.

Examples

rule xxx {
    when RTSP_REQUEST {
        puts [RTSP::header value "x-header"]
    }
}