Browse code

etc: cleaned up folder, moving unused files to examples

Daniel-Constantin Mierla authored on 14/03/2014 18:59:02
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,247 +0,0 @@
1
-#
2
-# $Id$
3
-#
4
-# iptel.org real world configuration
5
-#
6
-
7
-# ----------- global configuration parameters ------------------------
8
-
9
-#debug=8          # debug level (cmd line: -dddddddddd)
10
-debug=3
11
-#fork=yes
12
-fork=no
13
-children=2
14
-#log_stderror=no	# (cmd line: -E)
15
-log_stderror=yes	# (cmd line: -E)
16
-check_via=yes     # (cmd. line: -v)
17
-dns=on           # (cmd. line: -r)
18
-rev_dns=yes      # (cmd. line: -R)
19
-port=5060
20
-#port=8060
21
-
22
-# advertise IP address in Via (as opposed to advertising DNS name
23
-# which is annoying for downstream servers and some phones can
24
-# not handle DNS at all)
25
-listen=195.37.77.100
26
-
27
-# ------------------ module loading ----------------------------------
28
-
29
-loadmodule "../sip_router/modules/sl/sl.so"
30
-loadmodule "../sip_router/modules/print/print.so"
31
-#loadmodule "../sip_router/modules/tm/tm.so"
32
-loadmodule "../sip_router/modules/acc/acc.so"
33
-loadmodule "../sip_router/modules/rr/rr.so"
34
-loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
35
-#loadmodule "../sip_router/modules/mysql/mysql.so"
36
-loadmodule "../sip_router/modules/usrloc/usrloc.so"
37
-#loadmodule "../sip_router/modules/auth/auth.so"
38
-loadmodule "../sip_router/modules/cpl/cpl.so"
39
-
40
-# ----------------- setting module-specific parameters ---------------
41
-
42
-# -- usrloc params --
43
-
44
-modparam("usrloc", "use_database",   0)
45
-modparam("usrloc", "flush_interval", 3600)
46
-
47
-# -- acc params --
48
-# report ACKs too for sake of completeness -- as we account PSTN
49
-# destinations which are RR, ACKs should show up
50
-modparam("acc", "report_ack", 1)
51
-# don't bother me with early media reports (I don't like 183 
52
-# too much anyway...ever thought of timer C hitting after
53
-# listening to music-on-hold for five minutes?)
54
-modparam("acc", "early_media", 0)
55
-modparam("acc", "log_level", 1)
56
-# that is the flag for which we will account -- don't forget to
57
-# set the same one :-)
58
-modparam("acc", "acc_flag", 3 )
59
-# we are interested only in succesful transactions
60
-modparam("acc", "failed_transactions", 0 )
61
-
62
-# -- tm params --
63
-modparam("tm", "fr_timer", 10 )
64
-modparam("tm", "fr_inv_timer", 10 )
65
-modparam("tm", "wt_timer", 1000 )
66
-modparam("tm", "noisy_ctimer", 1 )
67
-
68
-# -------------------------  request routing logic -------------------
69
-
70
-# main routing logic
71
-
72
-route{
73
-
74
-	#t_uac();
75
-
76
-	# filter local stateless ACK generated by authentication of mf replies
77
-	sl_filter_ACK();
78
-
79
-	# filter too old messages
80
-	log("LOG: Checking maxfwd\n");
81
-	if (!mf_process_maxfwd_header("10")) {
82
-		log("LOG: Too many hops\n");
83
-		sl_send_reply("483","Too Many Hops");
84
-		break;
85
-	};
86
-
87
-	# len_gt *after* max_fwd, otherwise an "INVITE sip:sos@0.0.0.0"
88
-	# will cause "message too big" for a short message
89
-
90
-	if (len_gt( max_len )) {
91
-		sl_send_reply("513", "Riesengross -- Message too large");
92
-		break;
93
-	};
94
-
95
-
96
-	# Do strict routing if route headers present
97
-	rewriteFromRoute();
98
-
99
-	# look at whether we need record-routing; 
100
-	# - we need it for calls  from gateways (otherwise, subsequent 
101
-	#   requests from the other # party will attempt to contact gateway 
102
-	#  	directly through blocked ports)
103
-	# - we need it for Windows Messanger's IM sessions to cross
104
-	#   firewalls -- we force all MESSAGEs to go via our server
105
-	#   to avoid blocking port numbers (some firewalls can do
106
-	#   standard SIP but are puzzled by Microsoft's proprietary
107
-	#   messaging session model)
108
-	# - some other places may decide to set the record-routing
109
-	#   flag (2 chosen) too; particularly, INVITEs to our gw
110
-	if ( (src_ip==195.37.77.110 & method=="INVITE") || method=="MESSAGE" || method=="INFO" )  {
111
-		setflag(2);
112
-	};
113
-
114
-
115
-	# if this request is not for our domain, fall over to
116
-	# outbound request processing; include gateway's address
117
-	# in matching too -- we RR requests to it, so that
118
-	# its address may show up in subsequent requests
119
-	# after rewriteFromRoute
120
-
121
-	# sign of our domain: there is @ (username), :
122
-    # (nothing) or . (host) in front of our domain name	
123
-	if (!(uri=~"bat\.iptel\.org([;:].*)*" 
124
-		| uri=~"[@:\.]195\.37\.77\.101([;:].*)*" |
125
-		uri=~"@195\.37\.77\.110([;:].*)*" )) {
126
-		route(2);
127
-		# break from route (2) return -- stop then !
128
-		break;
129
-	};
130
-	# here we continue with requests for our domain...
131
-
132
-	# registers always MUST be authenticated to
133
-	# avoid stealing incoming calls	
134
-	if (method=="REGISTER") {
135
-		log("LOG Request is REGISTER\n");
136
-		# prohibit attempts to grab someone else's To address 
137
-		# using  valid credentials; the only exception is the user
138
-		# 'replciator' permitted to generate 3-rd party registrations
139
-
140
-		# update Contact database
141
-       	log("LOG: REGISTER is authorized, saving location\n");
142
-		save_contact("location");
143
-		break;
144
-	};
145
-
146
-	# now check if it's about PSTN destinations through our gateway;
147
-	# note that 8.... is exempted for numerical destinations
148
-	if (uri=~"sip:\+?[0-79][0-9]*@.*") {
149
-		route(3);
150
-		# break from route (3) return -- stop then !
151
-		break;
152
-	}; 
153
-
154
-	# native SIP destinations are handled using our USRLOC DB
155
-	if (!lookup_contact("location")) {
156
-		if (method=="ACK") {
157
-			log("Ooops -- an ACK made it here -- probably UAC screwed up to-tags\n");
158
-			break;
159
-		};
160
-		log("LOG: Unable to lookup contact, sending 404\n");
161
-		sl_send_reply("404", "Not Found");
162
-		break;
163
-	};
164
-
165
-	# requests from gateway should be RR-ed too
166
-	if (isflagset(2)) {
167
-		addRecordRoute();
168
-	};
169
-
170
-	# we now know we may, we know where, let it go out now!
171
-	if (!t_relay()) {
172
-		sl_reply_error();
173
-		break;
174
-	};
175
-}
176
-#---------------------------------------------------------------------
177
-
178
-# routing logic for outbound requests targeted out of our domain
179
-# (beware, messages to our users can end up here too: for example,
180
-#  an INVITE may be UsrLoc-ed, then the other party uses outbound
181
-#  proxy with r-uri=the usr_loced addredd (typically IP))
182
-route[2] {
183
-
184
-		# requests from gateway should be RR-ed too
185
-		if (isflagset(2)) {
186
-			addRecordRoute();
187
-		};
188
-		if (!t_relay()) {
189
-			sl_reply_error();
190
-			break;
191
-		};
192
-}
193
-
194
-#---------------------------------------------------------------------
195
-
196
-# logic for calls through our PSTN gateway
197
-route[3] {
198
-	# if it is a MESSAGE pass it "as is" over to our SMS gateway
199
-	# (which unfortunately lives at a different host due to
200
-	# lack of serial interfaces)
201
-	if (method=="MESSAGE") {
202
-		# note that we don't do any admission control yet:
203
-		# anyone can SMS anywhere; 
204
-		setflag(1);
205
-		rewritehostport("195.37.77.100:5070");
206
-		if (!t_relay()) {
207
-			sl_reply_error(); 
208
-		};
209
-		break;
210
-	};
211
-	# continue with requests to PSTN gateway ...
212
-
213
-	# the international + prefix
214
-	if (uri=~"sip:\+" ) {
215
-		strip(1);
216
-		prefix("000");
217
-	};
218
-	# free call destinations ... no authentication needed
219
-	if (uri=~"sip:001795061546@.*" | uri=~"sip:0016097265544.*" 
220
-		| uri=~"sip:[79][0-9][0-9][0-9]@.*" 
221
-		| uri=~"sip:98[0-9][0-9][0-9][0-9]") {
222
-		log("LOG: Free PSTN\n");
223
-		# let's log free calls for now too ...
224
-		setflag(1);
225
-	} else {
226
-		# we passed all authorization checks for PSTN -- move on!
227
-		# tag this transaction for accounting
228
-		setflag(1);
229
-
230
-	}; # authorized PSTN
231
-
232
-	# requests to gateway must be record-routed because the GW accepts
233
-	# only reqeusts coming from our proxy
234
-	if (isflagset(2) || method=="INVITE")
235
-		addRecordRoute();
236
-
237
-	# if you have passed through all the checks, let your call go to GW!
238
-
239
-
240
-	rewritehostport("fox.iptel.org:5060");
241
-
242
-	if (!t_relay()) {
243
-		sl_reply_error(); 
244
-		break; 
245
-	};
246
-}
247
-
Browse code

outdated files moved to obsoleted

Jiri Kuthan authored on 19/08/2002 18:35:50
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,247 @@
1
+#
2
+# $Id$
3
+#
4
+# iptel.org real world configuration
5
+#
6
+
7
+# ----------- global configuration parameters ------------------------
8
+
9
+#debug=8          # debug level (cmd line: -dddddddddd)
10
+debug=3
11
+#fork=yes
12
+fork=no
13
+children=2
14
+#log_stderror=no	# (cmd line: -E)
15
+log_stderror=yes	# (cmd line: -E)
16
+check_via=yes     # (cmd. line: -v)
17
+dns=on           # (cmd. line: -r)
18
+rev_dns=yes      # (cmd. line: -R)
19
+port=5060
20
+#port=8060
21
+
22
+# advertise IP address in Via (as opposed to advertising DNS name
23
+# which is annoying for downstream servers and some phones can
24
+# not handle DNS at all)
25
+listen=195.37.77.100
26
+
27
+# ------------------ module loading ----------------------------------
28
+
29
+loadmodule "../sip_router/modules/sl/sl.so"
30
+loadmodule "../sip_router/modules/print/print.so"
31
+#loadmodule "../sip_router/modules/tm/tm.so"
32
+loadmodule "../sip_router/modules/acc/acc.so"
33
+loadmodule "../sip_router/modules/rr/rr.so"
34
+loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
35
+#loadmodule "../sip_router/modules/mysql/mysql.so"
36
+loadmodule "../sip_router/modules/usrloc/usrloc.so"
37
+#loadmodule "../sip_router/modules/auth/auth.so"
38
+loadmodule "../sip_router/modules/cpl/cpl.so"
39
+
40
+# ----------------- setting module-specific parameters ---------------
41
+
42
+# -- usrloc params --
43
+
44
+modparam("usrloc", "use_database",   0)
45
+modparam("usrloc", "flush_interval", 3600)
46
+
47
+# -- acc params --
48
+# report ACKs too for sake of completeness -- as we account PSTN
49
+# destinations which are RR, ACKs should show up
50
+modparam("acc", "report_ack", 1)
51
+# don't bother me with early media reports (I don't like 183 
52
+# too much anyway...ever thought of timer C hitting after
53
+# listening to music-on-hold for five minutes?)
54
+modparam("acc", "early_media", 0)
55
+modparam("acc", "log_level", 1)
56
+# that is the flag for which we will account -- don't forget to
57
+# set the same one :-)
58
+modparam("acc", "acc_flag", 3 )
59
+# we are interested only in succesful transactions
60
+modparam("acc", "failed_transactions", 0 )
61
+
62
+# -- tm params --
63
+modparam("tm", "fr_timer", 10 )
64
+modparam("tm", "fr_inv_timer", 10 )
65
+modparam("tm", "wt_timer", 1000 )
66
+modparam("tm", "noisy_ctimer", 1 )
67
+
68
+# -------------------------  request routing logic -------------------
69
+
70
+# main routing logic
71
+
72
+route{
73
+
74
+	#t_uac();
75
+
76
+	# filter local stateless ACK generated by authentication of mf replies
77
+	sl_filter_ACK();
78
+
79
+	# filter too old messages
80
+	log("LOG: Checking maxfwd\n");
81
+	if (!mf_process_maxfwd_header("10")) {
82
+		log("LOG: Too many hops\n");
83
+		sl_send_reply("483","Too Many Hops");
84
+		break;
85
+	};
86
+
87
+	# len_gt *after* max_fwd, otherwise an "INVITE sip:sos@0.0.0.0"
88
+	# will cause "message too big" for a short message
89
+
90
+	if (len_gt( max_len )) {
91
+		sl_send_reply("513", "Riesengross -- Message too large");
92
+		break;
93
+	};
94
+
95
+
96
+	# Do strict routing if route headers present
97
+	rewriteFromRoute();
98
+
99
+	# look at whether we need record-routing; 
100
+	# - we need it for calls  from gateways (otherwise, subsequent 
101
+	#   requests from the other # party will attempt to contact gateway 
102
+	#  	directly through blocked ports)
103
+	# - we need it for Windows Messanger's IM sessions to cross
104
+	#   firewalls -- we force all MESSAGEs to go via our server
105
+	#   to avoid blocking port numbers (some firewalls can do
106
+	#   standard SIP but are puzzled by Microsoft's proprietary
107
+	#   messaging session model)
108
+	# - some other places may decide to set the record-routing
109
+	#   flag (2 chosen) too; particularly, INVITEs to our gw
110
+	if ( (src_ip==195.37.77.110 & method=="INVITE") || method=="MESSAGE" || method=="INFO" )  {
111
+		setflag(2);
112
+	};
113
+
114
+
115
+	# if this request is not for our domain, fall over to
116
+	# outbound request processing; include gateway's address
117
+	# in matching too -- we RR requests to it, so that
118
+	# its address may show up in subsequent requests
119
+	# after rewriteFromRoute
120
+
121
+	# sign of our domain: there is @ (username), :
122
+    # (nothing) or . (host) in front of our domain name	
123
+	if (!(uri=~"bat\.iptel\.org([;:].*)*" 
124
+		| uri=~"[@:\.]195\.37\.77\.101([;:].*)*" |
125
+		uri=~"@195\.37\.77\.110([;:].*)*" )) {
126
+		route(2);
127
+		# break from route (2) return -- stop then !
128
+		break;
129
+	};
130
+	# here we continue with requests for our domain...
131
+
132
+	# registers always MUST be authenticated to
133
+	# avoid stealing incoming calls	
134
+	if (method=="REGISTER") {
135
+		log("LOG Request is REGISTER\n");
136
+		# prohibit attempts to grab someone else's To address 
137
+		# using  valid credentials; the only exception is the user
138
+		# 'replciator' permitted to generate 3-rd party registrations
139
+
140
+		# update Contact database
141
+       	log("LOG: REGISTER is authorized, saving location\n");
142
+		save_contact("location");
143
+		break;
144
+	};
145
+
146
+	# now check if it's about PSTN destinations through our gateway;
147
+	# note that 8.... is exempted for numerical destinations
148
+	if (uri=~"sip:\+?[0-79][0-9]*@.*") {
149
+		route(3);
150
+		# break from route (3) return -- stop then !
151
+		break;
152
+	}; 
153
+
154
+	# native SIP destinations are handled using our USRLOC DB
155
+	if (!lookup_contact("location")) {
156
+		if (method=="ACK") {
157
+			log("Ooops -- an ACK made it here -- probably UAC screwed up to-tags\n");
158
+			break;
159
+		};
160
+		log("LOG: Unable to lookup contact, sending 404\n");
161
+		sl_send_reply("404", "Not Found");
162
+		break;
163
+	};
164
+
165
+	# requests from gateway should be RR-ed too
166
+	if (isflagset(2)) {
167
+		addRecordRoute();
168
+	};
169
+
170
+	# we now know we may, we know where, let it go out now!
171
+	if (!t_relay()) {
172
+		sl_reply_error();
173
+		break;
174
+	};
175
+}
176
+#---------------------------------------------------------------------
177
+
178
+# routing logic for outbound requests targeted out of our domain
179
+# (beware, messages to our users can end up here too: for example,
180
+#  an INVITE may be UsrLoc-ed, then the other party uses outbound
181
+#  proxy with r-uri=the usr_loced addredd (typically IP))
182
+route[2] {
183
+
184
+		# requests from gateway should be RR-ed too
185
+		if (isflagset(2)) {
186
+			addRecordRoute();
187
+		};
188
+		if (!t_relay()) {
189
+			sl_reply_error();
190
+			break;
191
+		};
192
+}
193
+
194
+#---------------------------------------------------------------------
195
+
196
+# logic for calls through our PSTN gateway
197
+route[3] {
198
+	# if it is a MESSAGE pass it "as is" over to our SMS gateway
199
+	# (which unfortunately lives at a different host due to
200
+	# lack of serial interfaces)
201
+	if (method=="MESSAGE") {
202
+		# note that we don't do any admission control yet:
203
+		# anyone can SMS anywhere; 
204
+		setflag(1);
205
+		rewritehostport("195.37.77.100:5070");
206
+		if (!t_relay()) {
207
+			sl_reply_error(); 
208
+		};
209
+		break;
210
+	};
211
+	# continue with requests to PSTN gateway ...
212
+
213
+	# the international + prefix
214
+	if (uri=~"sip:\+" ) {
215
+		strip(1);
216
+		prefix("000");
217
+	};
218
+	# free call destinations ... no authentication needed
219
+	if (uri=~"sip:001795061546@.*" | uri=~"sip:0016097265544.*" 
220
+		| uri=~"sip:[79][0-9][0-9][0-9]@.*" 
221
+		| uri=~"sip:98[0-9][0-9][0-9][0-9]") {
222
+		log("LOG: Free PSTN\n");
223
+		# let's log free calls for now too ...
224
+		setflag(1);
225
+	} else {
226
+		# we passed all authorization checks for PSTN -- move on!
227
+		# tag this transaction for accounting
228
+		setflag(1);
229
+
230
+	}; # authorized PSTN
231
+
232
+	# requests to gateway must be record-routed because the GW accepts
233
+	# only reqeusts coming from our proxy
234
+	if (isflagset(2) || method=="INVITE")
235
+		addRecordRoute();
236
+
237
+	# if you have passed through all the checks, let your call go to GW!
238
+
239
+
240
+	rewritehostport("fox.iptel.org:5060");
241
+
242
+	if (!t_relay()) {
243
+		sl_reply_error(); 
244
+		break; 
245
+	};
246
+}
247
+