Browse code

quick-start config file introduced

Jiri Kuthan authored on 19/08/2002 19:33:15
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,74 @@
1
+#
2
+# $Id$
3
+#
4
+# simple quick-start config script
5
+#
6
+
7
+# ----------- global configuration parameters ------------------------
8
+
9
+debug=3          # debug level (cmd line: -dddddddddd)
10
+fork=yes
11
+log_stderror=no	# (cmd line: -E)
12
+check_via=no	# (cmd. line: -v)
13
+dns=no           # (cmd. line: -r)
14
+rev_dns=no      # (cmd. line: -R)
15
+port=5060
16
+children=4
17
+
18
+# ------------------ module loading ----------------------------------
19
+
20
+loadmodule "../sip_router/modules/sl/sl.so"
21
+loadmodule "../sip_router/modules/print/print.so"
22
+loadmodule "../sip_router/modules/tm/tm_mod.so"
23
+loadmodule "../sip_router/modules/rr/rr.so"
24
+loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
25
+loadmodule "../sip_router/modules/usrloc/usrloc.so"
26
+
27
+# ----------------- setting module-specific parameters ---------------
28
+
29
+# -- usrloc params --
30
+
31
+modparam("usrloc", "use_database",   0)
32
+
33
+# -------------------------  request routing logic -------------------
34
+
35
+# main routing logic
36
+
37
+route{
38
+
39
+	# initial sanity checks -- discard local ACKs, messages with
40
+	# max_forwars==0, or excessively long requests
41
+	sl_filter_ACK();
42
+	if (!mf_process_maxfwd_header("10")) {
43
+		sl_send_reply("483","Too Many Hops");
44
+		break;
45
+	};
46
+	if (len_gt( max_len )) {
47
+		sl_send_reply("513", "Message too big");
48
+		break;
49
+	};
50
+
51
+	# Do strict routing if pre-loaded route headers present
52
+	rewriteFromRoute();
53
+
54
+	# if the request is for other domain use UsrLoc
55
+	if (uri==myself) {
56
+
57
+		if (method=="REGISTER") {
58
+			save_contact("location");
59
+			break;
60
+		};
61
+
62
+		# native SIP destinations are handled using our USRLOC DB
63
+		if (!lookup_contact("location")) {
64
+			sl_send_reply("404", "Not Found");
65
+			break;
66
+		};
67
+	};
68
+	# forward to current uri now
69
+	if (!t_relay()) {
70
+		sl_reply_error();
71
+	};
72
+
73
+}
74
+