Skip to content

Commit

Permalink
misc/examples/kemi: native config upated
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Dec 7, 2022
1 parent 0f3f023 commit 7f9547a
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions misc/examples/kemi/kamailio-basic-kemi-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ request_route {
exit;
}

# handle retransmissions
if (!is_method("ACK")) {
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
}

# handle requests within SIP dialogs
route(WITHINDLG);

### only initial requests (no To tag)

# handle retransmissions
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();

# authentication
route(AUTH);

Expand Down Expand Up @@ -86,8 +88,14 @@ route[RELAY] {

# Per SIP request initial checks
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
# 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
# - local host excluded (e.g., loop to self)
if(src_ip!=myself) {
Expand All @@ -102,11 +110,12 @@ route[REQINIT] {
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;
}
#!endif

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
Expand All @@ -118,8 +127,8 @@ route[REQINIT] {
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;
}
}
Expand Down

0 comments on commit 7f9547a

Please sign in to comment.