-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsf.cfg
130 lines (108 loc) · 3.29 KB
/
sf.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# $Id$
#
# iptel.org real world configuration
#
# ----------- global configuration parameters ------------------------
#debug=8 # debug level (cmd line: -dddddddddd)
debug=3
fork=no
children=2
#log_stderror=no # (cmd line: -E)
log_stderror=yes # (cmd line: -E)
check_via=yes # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
#port=8060
syn_branch=1
fifo="/tmp/ser_fifo"
# advertise IP address in Via (as opposed to advertising DNS name
# which is annoying for downstream servers and some phones can
# not handle DNS at all)
#listen=195.37.77.100
#listen=127.0.0.1
# ------------------ module loading ----------------------------------
loadmodule "../sip_router/modules/sl/sl.so"
loadmodule "../sip_router/modules/print/print.so"
loadmodule "../sip_router/modules/tm/tm.so"
loadmodule "../sip_router/modules/acc/acc.so"
loadmodule "../sip_router/modules/rr/rr.so"
loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
loadmodule "../sip_router/modules/usrloc/usrloc.so"
loadmodule "../sip_router/modules/registrar/registrar.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
# -- acc params --
# report ACKs too for sake of completeness -- as we account PSTN
# destinations which are RR, ACKs should show up
modparam("acc", "report_ack", 1)
# don't bother me with early media reports (I don't like 183
# too much anyway...ever thought of timer C hitting after
# listening to music-on-hold for five minutes?)
modparam("acc", "early_media", 0)
modparam("acc", "log_level", 1)
# that is the flag for which we will account -- don't forget to
# set the same one :-)
modparam("acc", "acc_flag", 3 )
# we are interested only in succesful transactions
modparam("acc", "failed_transactions", 0 )
modparam("acc", "missed_flag", 2 )
# -- tm params --
modparam("tm", "fr_timer", 103 )
modparam("tm", "retr_timer1p1", 4 )
modparam("tm", "fr_inv_timer", 4 )
modparam("tm", "wt_timer", 8 )
modparam("tm", "noisy_ctimer", 0 )
# ------------------------- request routing logic -------------------
# main routing logic
route{
# for testing purposes, simply okay all REGISTERs
if (method=="REGISTER") {
log("REGISTER");
sl_send_reply("200", "ok");
#t_replicate("localhost", "9");
break;
};
if (!t_relay_to("fox.iptel.org", "12345" )) {
sl_reply_error();
};
/* t_reply("100", "trying"); */
break;
#rewritehost("iptel.org");
if (!t_relay()) {
sl_reply_error();
};
break;
# print a message if a call was missed
setflag(2);
rewriteuri("a@blb.com");
append_branch("b@blb.com");
append_branch("c@blb.com");
# forward( "fox.iptel.org", 9 );
t_relay_to("bat.iptel.org", "5088");
# t_relay();
}
route[3] {
lookup("location");
}
reply_route[1] {
# revert to original inbound uri -- good if we want
# to modify it; if we rewrite it completely as in the
# line after it, it is actually useless
revert_uri();
# this one will return 404 too
rewriteuri("sip:nonsense@iptel.org");
append_branch();
# and if we don't yet get a positive reply (we won't --
# we will receive 404", try another forking destination
t_on_negative("2");
}
reply_route[2] {
revert_uri();
rewriteuri("sip:foo@iptel.org");
# give it one more try; if it fails too (it will, there
# is no foo), a lowest-code message will be relayed
# upstream
append_branch();
}