Browse code

Sample configuration using dbtext.

Jan Janak authored on 13/03/2003 00:01:01
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,113 @@
1
+#
2
+# $Id$
3
+#
4
+# simple quick-start config script
5
+#
6
+
7
+# ----------- global configuration parameters ------------------------
8
+
9
+/*
10
+debug=3          # debug level (cmd line: -dddddddddd)
11
+fork=yes
12
+log_stderror=no	# (cmd line: -E)
13
+*/
14
+
15
+debug=7
16
+fork=no
17
+log_stderror=yes
18
+
19
+check_via=no	# (cmd. line: -v)
20
+dns=no           # (cmd. line: -r)
21
+rev_dns=no      # (cmd. line: -R)
22
+port=5060
23
+children=4
24
+fifo="/tmp/ser_fifo"
25
+listen=dhcp210.fokus.fraunhofer.de
26
+
27
+# ------------------ module loading ----------------------------------
28
+
29
+# Uncomment this if you want to use SQL database
30
+loadmodule "./modules/dbtext/dbtext.so"
31
+
32
+loadmodule "./modules/sl/sl.so"
33
+loadmodule "./modules/tm/tm.so"
34
+loadmodule "./modules/rr/rr.so"
35
+loadmodule "./modules/maxfwd/maxfwd.so"
36
+loadmodule "./modules/usrloc/usrloc.so"
37
+loadmodule "./modules/registrar/registrar.so"
38
+
39
+# Uncomment this if you want digest authentication
40
+# mysql.so must be loaded !
41
+loadmodule "./modules/auth/auth.so"
42
+loadmodule "./modules/auth_db/auth_db.so"
43
+
44
+# ----------------- setting module-specific parameters ---------------
45
+
46
+# -- usrloc params --
47
+
48
+#modparam("usrloc", "db_mode",   0)
49
+
50
+# Uncomment this if you want to use SQL database 
51
+# for persistent storage and comment the previous line
52
+modparam("usrloc", "db_mode", 1)
53
+modparam("usrloc", "db_url", "/home/janakj/ser")
54
+modparam("auth_db", "db_url", "/home/janakj/ser")
55
+
56
+# -- auth params --
57
+# Uncomment if you are using auth module
58
+#
59
+modparam("auth_db", "calculate_ha1", yes)
60
+#
61
+# If you set "calculate_ha1" parameter to yes (which true in this config), 
62
+# uncomment also the following parameter)
63
+#
64
+modparam("auth_db", "password_column", "password")
65
+
66
+# -------------------------  request routing logic -------------------
67
+
68
+# main routing logic
69
+
70
+route{
71
+
72
+	# initial sanity checks -- messages with
73
+	# max_forwards==0, or excessively long requests
74
+	if (!mf_process_maxfwd_header("10")) {
75
+		sl_send_reply("483","Too Many Hops");
76
+		break;
77
+	};
78
+	if (len_gt( max_len )) {
79
+		sl_send_reply("513", "Message too big");
80
+		break;
81
+	};
82
+
83
+	# Do strict routing if pre-loaded route headers present
84
+	loose_route();
85
+
86
+	# if the request is for other domain use UsrLoc
87
+	# (in case, it does not work, use the following command
88
+	# with proper names and addresses in it)
89
+	if (uri==myself) {
90
+
91
+		if (method=="REGISTER") {
92
+			if (!www_authorize("", "subscriber")) {
93
+				www_challenge("", "0");
94
+				break;
95
+			};
96
+
97
+			save("location");
98
+			break;
99
+		};
100
+
101
+		# native SIP destinations are handled using our USRLOC DB
102
+		if (!lookup("location")) {
103
+			sl_send_reply("404", "Not Found");
104
+			break;
105
+		};
106
+	};
107
+	# forward to current uri now
108
+	if (!t_relay()) {
109
+		sl_reply_error();
110
+	};
111
+
112
+}
113
+