... | ... |
@@ -11,10 +11,10 @@ fork=yes |
11 | 11 |
log_stderror=no # (cmd line: -E) |
12 | 12 |
|
13 | 13 |
/* Uncomment these lines to enter debugging mode |
14 |
-debug=7 |
|
14 |
+*/ |
|
15 | 15 |
fork=no |
16 | 16 |
log_stderror=yes |
17 |
-*/ |
|
17 |
+/**/ |
|
18 | 18 |
|
19 | 19 |
check_via=no # (cmd. line: -v) |
20 | 20 |
dns=no # (cmd. line: -r) |
... | ... |
@@ -34,6 +34,7 @@ loadmodule "/usr/local/lib/ser/modules/rr.so" |
34 | 34 |
loadmodule "/usr/local/lib/ser/modules/maxfwd.so" |
35 | 35 |
loadmodule "/usr/local/lib/ser/modules/usrloc.so" |
36 | 36 |
loadmodule "/usr/local/lib/ser/modules/registrar.so" |
37 |
+loadmodule "/usr/local/lib/ser/modules/textops.so" |
|
37 | 38 |
|
38 | 39 |
# Uncomment this if you want digest authentication |
39 | 40 |
# mysql.so must be loaded ! |
... | ... |
@@ -76,7 +77,7 @@ route{ |
76 | 77 |
sl_send_reply("483","Too Many Hops"); |
77 | 78 |
break; |
78 | 79 |
}; |
79 |
- if (len_gt( max_len )) { |
|
80 |
+ if (msg:len >= max_len ) { |
|
80 | 81 |
sl_send_reply("513", "Message too big"); |
81 | 82 |
break; |
82 | 83 |
}; |
... | ... |
@@ -85,10 +86,21 @@ route{ |
85 | 86 |
# subsequent messages will go through our proxy; that's |
86 | 87 |
# particularly good if upstream and downstream entities |
87 | 88 |
# use different transport protocol |
88 |
- record_route(); |
|
89 |
- # loose-route processing |
|
89 |
+ if (!method=="REGISTER") record_route(); |
|
90 |
+ |
|
91 |
+ # subsequent messages withing a dialog should take the |
|
92 |
+ # path determined by record-routing |
|
90 | 93 |
if (loose_route()) { |
91 |
- t_relay(); |
|
94 |
+ # mark routing logic in request |
|
95 |
+ append_hf("P-hint: rr-enforced\r\n"); |
|
96 |
+ route(1); |
|
97 |
+ break; |
|
98 |
+ }; |
|
99 |
+ |
|
100 |
+ if (!uri==myself) { |
|
101 |
+ # mark routing logic in request |
|
102 |
+ append_hf("P-hint: outbound\r\n"); |
|
103 |
+ route(1); |
|
92 | 104 |
break; |
93 | 105 |
}; |
94 | 106 |
|
... | ... |
@@ -109,17 +121,29 @@ route{ |
109 | 121 |
break; |
110 | 122 |
}; |
111 | 123 |
|
124 |
+ lookup("aliases"); |
|
125 |
+ if (!uri==myself) { |
|
126 |
+ append_hf("P-hint: outbound alias\r\n"); |
|
127 |
+ route(1); |
|
128 |
+ break; |
|
129 |
+ }; |
|
130 |
+ |
|
112 | 131 |
# native SIP destinations are handled using our USRLOC DB |
113 | 132 |
if (!lookup("location")) { |
114 | 133 |
sl_send_reply("404", "Not Found"); |
115 | 134 |
break; |
116 | 135 |
}; |
117 | 136 |
}; |
118 |
- # forward to current uri now; use stateful forwarding; that |
|
119 |
- # works reliably even if we forward from TCP to UDP |
|
137 |
+ append_hf("P-hint: usrloc applied\r\n"); |
|
138 |
+ route(1); |
|
139 |
+} |
|
140 |
+ |
|
141 |
+route[1] |
|
142 |
+{ |
|
143 |
+ # send it out now; use stateful forwarding as it works reliably |
|
144 |
+ # even for UDP2TCP |
|
120 | 145 |
if (!t_relay()) { |
121 | 146 |
sl_reply_error(); |
122 | 147 |
}; |
123 |
- |
|
124 | 148 |
} |
125 | 149 |
|