|
@@ -20,18 +20,20 @@ request_route {
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # handle retransmissions
|
|
|
|
+ if (!is_method("ACK")) {
|
|
|
|
+ if(t_precheck_trans()) {
|
|
|
|
+ t_check_trans();
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+ t_check_trans();
|
|
|
|
+ }
|
|
|
|
+
|
|
# handle requests within SIP dialogs
|
|
# handle requests within SIP dialogs
|
|
route(WITHINDLG);
|
|
route(WITHINDLG);
|
|
|
|
|
|
### only initial requests (no To tag)
|
|
### only initial requests (no To tag)
|
|
|
|
|
|
- # handle retransmissions
|
|
|
|
- if(t_precheck_trans()) {
|
|
|
|
- t_check_trans();
|
|
|
|
- exit;
|
|
|
|
- }
|
|
|
|
- t_check_trans();
|
|
|
|
-
|
|
|
|
# authentication
|
|
# authentication
|
|
route(AUTH);
|
|
route(AUTH);
|
|
|
|
|
|
@@ -86,8 +88,14 @@ route[RELAY] {
|
|
|
|
|
|
# Per SIP request initial checks
|
|
# Per SIP request initial checks
|
|
route[REQINIT] {
|
|
route[REQINIT] {
|
|
|
|
+ # no connect for sending replies
|
|
|
|
+ set_reply_no_connect();
|
|
|
|
+ # enforce symmetric signaling
|
|
|
|
+ # - send back replies to the source address of request
|
|
|
|
+ force_rport();
|
|
|
|
+
|
|
#!ifdef WITH_ANTIFLOOD
|
|
#!ifdef WITH_ANTIFLOOD
|
|
- # flood dection from same IP and traffic ban for a while
|
|
|
|
|
|
+ # flood detection from same IP and traffic ban for a while
|
|
# be sure you exclude checking trusted peers, such as pstn gateways
|
|
# be sure you exclude checking trusted peers, such as pstn gateways
|
|
# - local host excluded (e.g., loop to self)
|
|
# - local host excluded (e.g., loop to self)
|
|
if(src_ip!=myself) {
|
|
if(src_ip!=myself) {
|
|
@@ -102,11 +110,12 @@ route[REQINIT] {
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if($ua =~ "friendly-scanner") {
|
|
|
|
- sl_send_reply("200", "OK");
|
|
|
|
|
|
+#!endif
|
|
|
|
+ if($ua =~ "friendly|scanner|sipcli|sipvicious|VaxSIPUserAgent|pplsip") {
|
|
|
|
+ # silent drop for scanners - uncomment next line if want to reply
|
|
|
|
+ # sl_send_reply("200", "OK");
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
-#!endif
|
|
|
|
|
|
|
|
if (!mf_process_maxfwd_header("10")) {
|
|
if (!mf_process_maxfwd_header("10")) {
|
|
sl_send_reply("483","Too Many Hops");
|
|
sl_send_reply("483","Too Many Hops");
|
|
@@ -118,8 +127,8 @@ route[REQINIT] {
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
|
|
|
|
- if(!sanity_check("1511", "7")) {
|
|
|
|
- xlog("Malformed SIP message from $si:$sp\n");
|
|
|
|
|
|
+ if(!sanity_check("17895", "7")) {
|
|
|
|
+ xlog("Malformed SIP request from $si:$sp\n");
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
}
|