40 • Scripting
[
S N O M
4 S P
R O X Y
/ R
E G I S T R A R
M
A N U A L
]
snom technology AG • 41
[
S N O M
4 S P
R O X Y
/ R
E G I S T R A R
M
A N U A L
]
from the left side of the string starting at position 0. If the third argument
is present, it indicated how many characters should be taken from the
string. If the third argument is absent, the function will return the rest of
the string starting at the position.
Example: substr(“abcde”, 2, 2) returns “cd”, substr(“abcde”, 2)
returns “cde”.
leftstr, rightstr
The leftstr takes two arguments. The first argument is the string
which should be operated on. The second argument indicated how many
characters should be returned.
In the case of leftstr, the function returns the string starting from
the left side, in the case of rightstr starting from the right side.
get_field
The get_field function extracts a field from a string. It takes three
arguments. The first argument contains the string from which the field
should be extracted. The second argument indicates the field number,
starting at 0. The third argument is optional and indicates the field
seperator characters, which default to whitespace.
Examples: get_field(“a b c”, 1) returns “b”, get_field(“a b, c d”,
1, “,”) returns “ c d”.
match
match is used for pattern matching. The first argument is the
underlying string, the second argument the pattern. If there is a match,
the function returns “true”.
The “?” matches any character, “$” matches only digits. “*”
matches any number of characters, “%” any number of digits. “~”
matches the name of the domain (if the script is evaluated in domain
context). “[a-z]” matches a character range. See the description for the
dial plan for details.
ere_match
ere_match is also used for pattern matching. In contrast to match,
it uses the “extended regular expression” matching used in NAPTR DNS
6.
Summary of Contents for 4S Media Server
Page 1: ...Administrator s Manual snom 4S SIP Proxy Registrar Version 2 30 ...
Page 14: ...14 VoIP Protocol S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 1 ...
Page 84: ...84 Routing S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 10 ...
Page 98: ...98 Maintenance S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 13 ...