ltm rule command SIP headerΒΆ

iRule(1)		      BIG-IP TMSH Manual		      iRule(1)



SIP::header
       Gets or sets SIP header information.

SYNOPSIS
       SIP::header SIP_HEADER_NAME (INDEX)?

       SIP::header ('value' | 'remove') HEADER_NAME (INDEX)?

       SIP::header ('insert') HEADER_NAME HEADER_VALUE (INDEX)?

       SIP::header 'names'

       SIP::header 'at' INDEX

       SIP::header 'exists' HEADER_NAME

       SIP::header ('replace') HEADER_NAME HEADER_VALUE (INDEX)?

       SIP::header ('count' | 'values') (HEADER_NAME)?

DESCRIPTION
       This set of commands allows you to get or set information in the SIP
       header.

       Note: These commands still work on MBLB (Message Based Load Balancing)
       SIP post 11.6+, but there are new commands that only run on MRF
       (Message Routing Framework) SIP and were introduced in 11.6.

       Syntax

       SIP::header "header-name" 

	    * Get SIP header "header-name", if index is not provided, the first
	      match is returned.

       SIP::header value "header-name" 

	    * Same as above, "value" is optional.

       SIP::header remove "header-name" 

	    * Remove SIP header "header-name", index can be used to indicate
	      which header is in action if there are multiple of them

       SIP::header insert "header-name" "header-value" 

	    * Insert SIP header-name: header-value pair at position index, if
	      index is not given, it will be inserted prior to any pre-existing
	      (same) headers. If no such header, via header will be inserted at
	      the head of SIP headers, others will be inserted at the tail.

       SIP::header count [header-name]

	    * Returns the count of the SIP headers. If "header-name" is specified
	      count the specific headers.
	      This is an MRF SIP (sipsession profile) command for v11.6+

       SIP::header exists "header-name"

	    * Returns whether SIP header specified by name exists at least once.
	      This is an MRF SIP (sipsession profile) command for v11.6+

       SIP::header values [header-name]

	    * Returns list of the values of all the instances of SIP header
	      values. If optional argument header-name is specified retrieve
	      all values of the specified header-name.
	      This is an MRF SIP (sipsession profile) command for v11.6+

       SIP::header at "index"

	    * Returns SIP header at "index", index is the Nth line from the SIP
	      header. Returns only the name of the header.
	      This is an MRF SIP (sipsession profile) command for v11.6+

       SIP::header replace "header-name" "header-value" [index]

	    * Replaces first instance of the header specified by "header-name".
	      New entry is added if not present already. If index optional
	      argument is present, replace the header name at indexth
	      position.
	      This is an MRF SIP (sipsession profile) command for v11.6+

       SIP::header names

	    * Returns list of all the SIP header names.
	      This is an MRF SIP (sipsession profile) command for v11.6+

RETURN VALUE
VALID DURING
       SIP_REQUEST, SIP_RESPONSE, MR_INGRESS, MR_EGRESS, MR_FAILED

EXAMPLES
	when SIP_REQUEST_SEND {
	  log local0. [SIP::method]
	  SIP::header insert Via [format "SIP/2.0/TCP %s:%s" [IP::local_addr] [TCP::local_port]]
	  SIP::header insert Y-Header "it is yyy"
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-9.2.0 --First introduced the command.  @BIGIP-11.6.0 --Added
       subcommands: count, exists, values, at, replace, names



BIG-IP				  2017-01-31			      iRule(1)