Browse code

alias handling introduced to default scripts

Jiri Kuthan authored on 13/10/2003 22:53:06
Showing 1 changed files
... ...
@@ -6,12 +6,11 @@
6 6
 
7 7
 # ----------- global configuration parameters ------------------------
8 8
 
9
-#debug=3         # debug level (cmd line: -dddddddddd)
10
-#fork=yes
11
-#log_stderror=no	# (cmd line: -E)
9
+debug=3         # debug level (cmd line: -dddddddddd)
10
+fork=yes
11
+log_stderror=no	# (cmd line: -E)
12 12
 
13 13
 /* Uncomment these lines to enter debugging mode 
14
-debug=7
15 14
 fork=no
16 15
 log_stderror=yes
17 16
 */
... ...
@@ -19,8 +18,8 @@ log_stderror=yes
19 18
 check_via=no	# (cmd. line: -v)
20 19
 dns=no           # (cmd. line: -r)
21 20
 rev_dns=no      # (cmd. line: -R)
22
-#port=5060
23
-#children=4
21
+port=5060
22
+children=4
24 23
 fifo="/tmp/ser_fifo"
25 24
 
26 25
 # ------------------ module loading ----------------------------------
... ...
@@ -34,6 +33,7 @@ loadmodule "/usr/local/lib/ser/modules/rr.so"
34 33
 loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
35 34
 loadmodule "/usr/local/lib/ser/modules/usrloc.so"
36 35
 loadmodule "/usr/local/lib/ser/modules/registrar.so"
36
+loadmodule "/usr/local/lib/ser/modules/textops.so"
37 37
 
38 38
 # Uncomment this if you want digest authentication
39 39
 # mysql.so must be loaded !
... ...
@@ -85,10 +85,21 @@ route{
85 85
 	# subsequent messages will go through our proxy; that's
86 86
 	# particularly good if upstream and downstream entities
87 87
 	# use different transport protocol
88
-	record_route();	
89
-	# loose-route processing
88
+	if (!method=="REGISTER") record_route();	
89
+
90
+	# subsequent messages withing a dialog should take the
91
+	# path determined by record-routing
90 92
 	if (loose_route()) {
91
-		t_relay();
93
+		# mark routing logic in request
94
+		append_hf("P-hint: rr-enforced\r\n"); 
95
+		route(1);
96
+		break;
97
+	};
98
+
99
+	if (!uri==myself) {
100
+		# mark routing logic in request
101
+		append_hf("P-hint: outbound\r\n"); 
102
+		route(1);
92 103
 		break;
93 104
 	};
94 105
 
... ...
@@ -109,17 +120,29 @@ route{
109 120
 			break;
110 121
 		};
111 122
 
123
+		lookup("aliases");
124
+		if (!uri==myself) {
125
+			append_hf("P-hint: outbound alias\r\n"); 
126
+			route(1);
127
+			break;
128
+		};
129
+
112 130
 		# native SIP destinations are handled using our USRLOC DB
113 131
 		if (!lookup("location")) {
114 132
 			sl_send_reply("404", "Not Found");
115 133
 			break;
116 134
 		};
117 135
 	};
118
-	# forward to current uri now; use stateful forwarding; that
119
-	# works reliably even if we forward from TCP to UDP
136
+	append_hf("P-hint: usrloc applied\r\n"); 
137
+	route(1);
138
+}
139
+
140
+route[1] 
141
+{
142
+	# send it out now; use stateful forwarding as it works reliably
143
+	# even for UDP2TCP
120 144
 	if (!t_relay()) {
121 145
 		sl_reply_error();
122 146
 	};
123
-
124 147
 }
125 148