Browse code

- config scripts updated to reflect latest changes (mainly FIFO related)

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1513 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 16/01/2007 16:33:02
Showing 6 changed files
... ...
@@ -17,31 +17,34 @@ check_via=no	# (cmd. line: -v)
17 17
 dns=no           # (cmd. line: -r)
18 18
 rev_dns=no      # (cmd. line: -R)
19 19
 children=4
20
-fifo="/tmp/ser_fifo"
21 20
 
22
-listen=195.37.77.100
23
-port=5068
21
+port=5060
24 22
 
25 23
 # ------------------ module loading ----------------------------------
26 24
 
27 25
 # Uncomment this if you want to use SQL database
28
-#loadmodule "/usr/local/lib/ser/modules/mysql.so"
26
+#loadmodule "/usr/local/lib/openser/modules/mysql.so"
29 27
 
30
-loadmodule "/usr/local/lib/ser/modules/sl.so"
31
-loadmodule "/usr/local/lib/ser/modules/tm.so"
32
-loadmodule "/usr/local/lib/ser/modules/rr.so"
33
-loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
34
-loadmodule "/usr/local/lib/ser/modules/usrloc.so"
35
-loadmodule "/usr/local/lib/ser/modules/registrar.so"
36
-loadmodule "/usr/local/lib/ser/modules/textops.so"
28
+loadmodule "/usr/local/lib/openser/modules/sl.so"
29
+loadmodule "/usr/local/lib/openser/modules/tm.so"
30
+loadmodule "/usr/local/lib/openser/modules/rr.so"
31
+loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
32
+loadmodule "/usr/local/lib/openser/modules/usrloc.so"
33
+loadmodule "/usr/local/lib/openser/modules/registrar.so"
34
+loadmodule "/usr/local/lib/openser/modules/textops.so"
35
+loadmodule "/usr/local/lib/openser/modules/mi_fifo.so"
37 36
 
38 37
 # Uncomment this if you want digest authentication
39 38
 # mysql.so must be loaded !
40
-#loadmodule "/usr/local/lib/ser/modules/auth.so"
41
-#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
39
+#loadmodule "/usr/local/lib/openser/modules/auth.so"
40
+#loadmodule "/usr/local/lib/openser/modules/auth_db.so"
42 41
 
43 42
 # ----------------- setting module-specific parameters ---------------
44 43
 
44
+# -- mi_fifo params --
45
+
46
+modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
47
+
45 48
 # -- usrloc params --
46 49
 
47 50
 modparam("usrloc", "db_mode",   0)
... ...
@@ -74,7 +77,7 @@ route{
74 74
 	t_on_failure("1");
75 75
 	t_on_reply("1");
76 76
 	log(1, "message received\n");
77
-	t_relay_to_udp("siphub.org", "5060");
77
+	t_relay("udp:siphub.org:5060");
78 78
 
79 79
 	return;
80 80
 
... ...
@@ -7,7 +7,7 @@
7 7
 # ------------------ module loading ----------------------------------
8 8
 
9 9
 fork=no
10
-listen=192.168.2.16
10
+port=5060
11 11
 log_stderror=yes
12 12
 debug=3
13 13
 
... ...
@@ -14,16 +14,16 @@ rev_dns=off       # (cmd. line: -R)
14 14
 
15 15
 # ------------------ module loading ----------------------------------
16 16
 
17
-loadmodule "../sip_router/modules/print/print.so"
18
-loadmodule "../sip_router/modules/textops/textops.so"
17
+loadmodule "../sip-server/modules/print/print.so"
18
+loadmodule "../sip-server/modules/textops/textops.so"
19 19
 
20
-loadmodule "../sip_router/modules/sl/sl.so"
21
-loadmodule "../sip_router/modules/mysql/mysql.so"
22
-loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
23
-loadmodule "../sip_router/modules/msilo/msilo.so"
24
-loadmodule "../sip_router/modules/tm/tm.so"
25
-loadmodule "../sip_router/modules/registrar/registrar.so"
26
-loadmodule "../sip_router/modules/usrloc/usrloc.so"
20
+loadmodule "../sip-server/modules/sl/sl.so"
21
+loadmodule "../sip-server/modules/mysql/mysql.so"
22
+loadmodule "../sip-server/modules/maxfwd/maxfwd.so"
23
+loadmodule "../sip-server/modules/msilo/msilo.so"
24
+loadmodule "../sip-server/modules/tm/tm.so"
25
+loadmodule "../sip-server/modules/registrar/registrar.so"
26
+loadmodule "../sip-server/modules/usrloc/usrloc.so"
27 27
 
28 28
 # ----------------- setting module-specific parameters ---------------
29 29
 
... ...
@@ -51,7 +51,7 @@ route{
51 51
 	if ( !mf_process_maxfwd_header("10") )
52 52
 	{
53 53
 		sl_send_reply("483","To Many Hops");
54
-		drop();
54
+		exit;
55 55
 	};
56 56
 
57 57
 
... ...
@@ -69,7 +69,7 @@ route{
69 69
 			}else{
70 70
 				log("MSILO: no offline messages dumped\n");
71 71
 			};
72
-			return;
72
+			exit;
73 73
 		};
74 74
 
75 75
 		# domestic SIP destinations are handled using our USRLOC DB
... ...
@@ -77,10 +77,10 @@ route{
77 77
 		if(!lookup("location")) 
78 78
 		{
79 79
 			if (! t_newtran())
80
-   			{
80
+			{
81 81
 				sl_reply_error();
82
-				return;
83
-   			};
82
+				exit;
83
+			};
84 84
 			# we do not care about anything else but MESSAGEs
85 85
 			if (!method=="MESSAGE")
86 86
 			{
... ...
@@ -88,7 +88,7 @@ route{
88 88
 				{
89 89
 					sl_reply_error();
90 90
 				};
91
-    			return;
91
+				exit;
92 92
 			};
93 93
 			log("MESSAGE received -> storing using MSILO\n");
94 94
 			# MSILO - storing as offline message
... ...
@@ -106,13 +106,13 @@ route{
106 106
 					sl_reply_error();
107 107
 				};
108 108
 			};
109
-			return;
109
+			exit;
110 110
 		};
111 111
 		# if the downstream UA does not support MESSAGE requests
112 112
 		# go to failure_route[1]
113 113
 		t_on_failure("1");
114 114
 		t_relay();
115
-		return;
115
+		exit;
116 116
 	};
117 117
 
118 118
 	# forward anything else
... ...
@@ -123,7 +123,7 @@ failure_route[1] {
123 123
 	# forwarding failed -- check if the request was a MESSAGE 
124 124
 	if (!method=="MESSAGE")
125 125
 	{
126
-    	return;
126
+		exit;
127 127
 	};
128 128
 	
129 129
 	log(1,"MSILO: the downstream UA does not support MESSAGE requests ...\n");
... ...
@@ -33,31 +33,35 @@ dns=no           # (cmd. line: -r)
33 33
 rev_dns=no      # (cmd. line: -R)
34 34
 port=5060
35 35
 children=4
36
-fifo="/tmp/ser_fifo"
37 36
 
38 37
 # ------------------ module loading ----------------------------------
39 38
 
40 39
 # Uncomment this if you want to use SQL database
41
-#loadmodule "/usr/local/lib/ser/modules/mysql.so"
40
+#loadmodule "/usr/local/lib/openser/modules/mysql.so"
42 41
 
43
-loadmodule "/usr/local/lib/ser/modules/sl.so"
44
-loadmodule "/usr/local/lib/ser/modules/tm.so"
45
-loadmodule "/usr/local/lib/ser/modules/rr.so"
46
-loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
47
-loadmodule "/usr/local/lib/ser/modules/usrloc.so"
48
-loadmodule "/usr/local/lib/ser/modules/registrar.so"
49
-loadmodule "/usr/local/lib/ser/modules/textops.so"
42
+loadmodule "/usr/local/lib/openser/modules/sl.so"
43
+loadmodule "/usr/local/lib/openser/modules/tm.so"
44
+loadmodule "/usr/local/lib/openser/modules/rr.so"
45
+loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
46
+loadmodule "/usr/local/lib/openser/modules/usrloc.so"
47
+loadmodule "/usr/local/lib/openser/modules/registrar.so"
48
+loadmodule "/usr/local/lib/openser/modules/textops.so"
49
+loadmodule "/usr/local/lib/openser/modules/mi_fifo.so"
50 50
 
51 51
 # Uncomment this if you want digest authentication
52 52
 # mysql.so must be loaded !
53
-#loadmodule "/usr/local/lib/ser/modules/auth.so"
54
-#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
53
+#loadmodule "/usr/local/lib/openser/modules/auth.so"
54
+#loadmodule "/usr/local/lib/openser/modules/auth_db.so"
55 55
 
56 56
 # !! Nathelper
57
-loadmodule "/usr/local/lib/ser/modules/nathelper.so"
57
+loadmodule "/usr/local/lib/openser/modules/nathelper.so"
58 58
 
59 59
 # ----------------- setting module-specific parameters ---------------
60 60
 
61
+# -- mi_fifo params --
62
+
63
+modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
64
+
61 65
 # -- usrloc params --
62 66
 
63 67
 modparam("usrloc", "db_mode",   0)
... ...
@@ -95,14 +99,14 @@ route{
95 95
 	# max_forwards==0, or excessively long requests
96 96
 	if (!mf_process_maxfwd_header("10")) {
97 97
 		sl_send_reply("483","Too Many Hops");
98
-		return;
98
+		exit;
99 99
 	};
100 100
 	if (msg:len >=  max_len ) {
101 101
 		sl_send_reply("513", "Message too big");
102
-		return;
102
+		exit;
103 103
 	};
104 104
 
105
-        # !! Nathelper
105
+	# !! Nathelper
106 106
 	# Special handling for NATed clients; first, NAT test is
107 107
 	# executed: it looks for via!=received and RFC1918 addresses
108 108
 	# in Contact (may fail if line-folding is used); also,
... ...
@@ -113,7 +117,7 @@ route{
113 113
 		# a NAT-enabled proxy takes care of it; unless it is
114 114
 		# a REGISTER
115 115
 
116
-		if (method == "REGISTER" || ! search("^Record-Route:")) {
116
+		if (is_method("REGISTER") || !is_present_hf("Record-Route")) {
117 117
 		    log("LOG: Someone trying to register from private IP, rewriting\n");
118 118
 
119 119
 		    # This will work only for user agents that support symmetric
... ...
@@ -123,7 +127,7 @@ route{
123 123
 		    # called "symmetric media" and "symmetric signalling".
124 124
 
125 125
 		    fix_nated_contact(); # Rewrite contact with source IP of signalling
126
-		    if (method == "INVITE") {
126
+		    if ( is_method("INVITE") ) {
127 127
 		        fix_nated_sdp("1"); # Add direction=active to SDP
128 128
 		    };
129 129
 		    force_rport(); # Add rport parameter to topmost Via
... ...
@@ -135,7 +139,7 @@ route{
135 135
 	# subsequent messages will go through our proxy; that's
136 136
 	# particularly good if upstream and downstream entities
137 137
 	# use different transport protocol
138
-	if (!method=="REGISTER") record_route();	
138
+	if (!is_method("REGISTER")) record_route();
139 139
 
140 140
 	# subsequent messages withing a dialog should take the
141 141
 	# path determined by record-routing
... ...
@@ -143,14 +147,14 @@ route{
143 143
 		# mark routing logic in request
144 144
 		append_hf("P-hint: rr-enforced\r\n"); 
145 145
 		route(1);
146
-		return;
146
+		exit;
147 147
 	};
148 148
 
149 149
 	if (!uri==myself) {
150 150
 		# mark routing logic in request
151 151
 		append_hf("P-hint: outbound\r\n"); 
152 152
 		route(1);
153
-		return;
153
+		exit;
154 154
 	};
155 155
 
156 156
 	# if the request is for other domain use UsrLoc
... ...
@@ -167,20 +171,20 @@ route{
167 167
 #			};
168 168
 
169 169
 			save("location");
170
-			return;
170
+			exit;
171 171
 		};
172 172
 
173 173
 		lookup("aliases");
174 174
 		if (!uri==myself) {
175 175
 			append_hf("P-hint: outbound alias\r\n"); 
176 176
 			route(1);
177
-			return;
177
+			exit;
178 178
 		};
179 179
 
180 180
 		# native SIP destinations are handled using our USRLOC DB
181 181
 		if (!lookup("location")) {
182 182
 			sl_send_reply("404", "Not Found");
183
-			return;
183
+			exit;
184 184
 		};
185 185
 	};
186 186
 	append_hf("P-hint: usrloc applied\r\n"); 
... ...
@@ -191,13 +195,13 @@ route[1]
191 191
 {
192 192
 	# !! Nathelper
193 193
 	if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){
194
-	    sl_send_reply("479", "We don't forward to private IP addresses");
195
-	    return;
196
-        };
197
-	
194
+		sl_send_reply("479", "We don't forward to private IP addresses");
195
+		exit;
196
+	};
197
+
198 198
 	# if client or server know to be behind a NAT, enable relay
199 199
 	if (isflagset(6)) {
200
-	    force_rtp_proxy();
200
+		force_rtp_proxy();
201 201
 	};
202 202
 
203 203
 	# NAT processing of replies; apply to all transactions (for example,
... ...
@@ -214,14 +218,14 @@ route[1]
214 214
 
215 215
 # !! Nathelper
216 216
 onreply_route[1] {
217
-    # NATed transaction ?
218
-    if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
219
-        fix_nated_contact();
220
-	force_rtp_proxy();
221
-    # otherwise, is it a transaction behind a NAT and we did not
222
-    # know at time of request processing ? (RFC1918 contacts)
223
-    } else if (nat_uac_test("1")) {
224
-        fix_nated_contact();
225
-    };
217
+	# NATed transaction ?
218
+	if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
219
+		fix_nated_contact();
220
+		force_rtp_proxy();
221
+	# otherwise, is it a transaction behind a NAT and we did not
222
+	# know at time of request processing ? (RFC1918 contacts)
223
+	} else if (nat_uac_test("1")) {
224
+		fix_nated_contact();
225
+	};
226 226
 }
227 227
 
... ...
@@ -67,7 +67,7 @@ route{
67 67
 		if (method=="INVITE") {
68 68
 			sl_send_reply("403", "Call cannot be served here");
69 69
 		} else {
70
-			forward(uri:host, uri:port);
70
+			forward();
71 71
 		};
72 72
 		return;
73 73
 	}; 
... ...
@@ -62,7 +62,7 @@ route{
62 62
 			# ... if this REGISTER is not a replica from our
63 63
 			# peer server, replicate to the peer server
64 64
 			if (!src_ip==backup.foo.bar) {
65
-				t_replicate("backup.foo.bar", "5060");
65
+				t_replicate("sip:backup.foo.bar:5060");
66 66
 			};
67 67
 			return;
68 68
 		};