Skip to end of metadata
Go to start of metadata

Download PDF Document


For Mediatrix Sentinel 400

v. 42.1.857

1 Ruleset Replacement Expressions

Ruleset replacement expressions are used when the value of a parameter, a command or an action is not known in advance, i.e. the value depends on the result of the SIP message processing.

A Ruleset replacement expression is a string that represents a SIP processing status. Replacement expressions always start with the dollar (“$”) sign followed by an identifier. When the Ruleset uses a replacement expression, the replacement expression is replaced by the value of the SIP processing status representing the replacement expression.

For example,

  • $aU uses the User part of the P-Asserted-Identity header
  • $th uses the Host part of the To header
  • sip:$aU@$th, used as the parameter of the Set R-URI action, uses the P-Asserted-Identity and To headers of the incoming request and puts them into the Request URI of the outgoing request.


Special characters should be backslash-escaped, for example, as follows: \ → \\ or $ → \$


It is important to know that if a mediation action (Section SIP Mediation) changes the content of a SIP message, the replacement expression will refer to the value after modification. E.g., if you apply the rule action “SetFrom(”, $fu will return!

2 Ruleset Replacement Expression Exhaustive List

Macro Replacements Description
$r $r. request-URI; note that the expression refers to current request URI which may be changed during the course of request processing
$ru user@host[:port] part of request URI
$rU R-URI User
$rd R-URI Domain (host:port)
$rh R-URI Host
$rp R-URI Port
$rP R-URI Parameters
$f $f. From header
$fu user@host[:port] part of From URI
$fU From User
$fd From Domain (host:port)
$fh From Host
$fp From Port
$fn From Display name
$fP From Parameters
$ft From Tag
$fH From header Headers
$t $t. To header
$tu user@host[:port] part of To URI
$tU To User
$td To Domain (host:port)
$th To Host
$tp To Port
$tn To Display name
$tP To Parameters
$tt To Tag
$tH To header Headers
$a $a. P-Asserted-Identity header
$au user@host[:port] part of P-Asserted-Identity URI
$aU P-Asserted-Identity User
$ad P-Asserted-Identity Domain (host:port)
$ah P-Asserted-Identity Host
$ap P-Asserted-Identity Port
$aP P-Asserted-Identity Parameters
$at P-Asserted-Identity Tag
$aH P-Asserted-Identity Headers
$p $p. P-Preferred-Identity header
$pu user@host[:port] part of P-Preferred-Identity URI
$pU P-Preferred-Identity User
$pd P-Preferred-Identity Domain (host:port)
$ph P-Preferred-Identity Host
$pp P-Preferred-Identity Port
$pP P-Preferred-Identity Parameters
$pt P-Preferred-Identity Tag
$pH P-Preferred-Identity Headers
$c $ci Call-ID
$s $si Source (remote) IP address
$sp Source (remote) port number
$d $di expected destination host
$dp expected destination port
$R $Ri Destination (local/received) IP address
$Rp Destination (local/received) port number
$Rf local/received interface id (0=default)
$Rn local/received interface name (SBC interface name)
$RI local/received interface public IP
$H $H(headername) value of header with the name headername (Note: not all headers are available here)
$HU(headername) header headername (as URI) User
$Hd(headername) header headername (as URI) domain (host:port)
$Hu(headername) header headername (as URI) URI
$Hd(headername) header headername (as URI) domain (host:port)
$Hh(headername) header headername (as URI) host
$Hp(headername) header headername (as URI) port
$Hn(headername) header headername (as URI) display name
$Hp(headername) header headername (as URI) parameters
$HH(headername) header headername (as URI) headers
$m $m request method
$V $V(gui.varname) value of Call Variable varname
$B $B(cnum.rnum) value of backreference with rnum number from the condition with cnum number
$U $Ua register cache: originating AoR
$UA register cache: originating alias
$_ $_u(value) value to uppercase
$_l(value) value to lowercase
$_s(value) length of value (size)
$_5(value) MD5 of value
$_r(value) random number 0..value, e.g. $_r(5) gives 0, 1, 2, 3 or 4
$# $#(value) value URL-encoded