Brekeke SIP Server Wiki

$addr

Get the source IP address of the incoming SIP request packet

Syntax:
$addr

 

Returns:

The source IP address of the incoming SIP packet

 

Version Since:

1.0

 

Where the function can be used:
  • Preliminary rules
  • Regular rules

 

Examples:
$addr = ^127.0.0.1$

If the source IP address of the packet is the loopback address (127.0.0.1).

 

$addr = ^10\.1\.1\.

If the source IP address of the packet starts with “10.1.1.”.

 

Note: Depending upon an IP address, a pattern definition should be escaped with a backslash \.

^10.1.1.1. will match 10.111.1 or 10.1.111 but ^10\.1\.1\. will match 10.1.1. only.

 

$addr = ^172.16.0.[1-5]$

If the source IP address is in the range 172.16.0.1 – 172.16.0.5.

 

$addr = ^172.16.0.1$|^192.168.1.1$

If the source IP address is 172.16.0.1 or 192.168.1.1.

 

See Also:

$addrPort
$addrPrefix
$addrRange
$port
$localhost
$globalAddr

Yes No
Suggest Edit