4 |
- |
1 |
# -*- text -*-
|
|
|
2 |
#
|
|
|
3 |
# $Id$
|
|
|
4 |
|
|
|
5 |
# rewrite arbitrary packets. Useful in accounting and authorization.
|
|
|
6 |
#
|
|
|
7 |
# As of 2.0, much of the functionality of this module is in "unlang".
|
|
|
8 |
# You should probably investigate using that before trying to use
|
|
|
9 |
# the "attr_rewrite" module.
|
|
|
10 |
#
|
|
|
11 |
#
|
|
|
12 |
# The module can also use the Rewrite-Rule attribute. If it
|
|
|
13 |
# is set and matches the name of the module instance, then
|
|
|
14 |
# that module instance will be the only one which runs.
|
|
|
15 |
#
|
|
|
16 |
# Also if new_attribute is set to yes then a new attribute
|
|
|
17 |
# will be created containing the value replacewith and it
|
|
|
18 |
# will be added to searchin (packet, reply, proxy,
|
|
|
19 |
# proxy_reply or config).
|
|
|
20 |
#
|
|
|
21 |
# searchfor,ignore_case and max_matches will be ignored in that case.
|
|
|
22 |
#
|
|
|
23 |
# Backreferences are supported.
|
|
|
24 |
# %{0} will contain the string the whole match
|
|
|
25 |
# %{1} to %{8} will contain the contents of the 1st to
|
|
|
26 |
# the 8th parentheses
|
|
|
27 |
#
|
|
|
28 |
# If max_matches is greater than one, the backreferences will
|
|
|
29 |
# correspond to the first attributed that matched.
|
|
|
30 |
|
|
|
31 |
#
|
|
|
32 |
attr_rewrite sanecallerid {
|
|
|
33 |
attribute = Called-Station-Id
|
|
|
34 |
# may be "packet", "reply", "proxy", "proxy_reply" or "config"
|
|
|
35 |
searchin = packet
|
|
|
36 |
searchfor = "[+ ]"
|
|
|
37 |
replacewith = ""
|
|
|
38 |
ignore_case = no
|
|
|
39 |
new_attribute = no
|
|
|
40 |
max_matches = 10
|
|
|
41 |
|
|
|
42 |
## If set to yes then the replace string will be
|
|
|
43 |
## appended to the original string
|
|
|
44 |
append = no
|
|
|
45 |
}
|
|
|
46 |
|