|
|
|
@ -208,14 +208,14 @@ modparam("permissions", "db_mode", 1) |
|
|
|
####### Routing Logic ######## |
|
|
|
route |
|
|
|
{ |
|
|
|
route(SANITY_CHECK); |
|
|
|
|
|
|
|
# log the basic info regarding this call |
|
|
|
xlog("L_INFO", "$ci|start|recieved $pr request $rm $ou"); |
|
|
|
xlog("L_INFO", "$ci|log|source $si:$sp"); |
|
|
|
xlog("L_INFO", "$ci|log|from $fu"); |
|
|
|
xlog("L_INFO", "$ci|log|to $tu"); |
|
|
|
|
|
|
|
route(SANITY_CHECK); |
|
|
|
|
|
|
|
route(CLASSIFY_SOURCE); |
|
|
|
|
|
|
|
#!ifdef ANTIFLOOD-ROLE |
|
|
|
@ -264,21 +264,21 @@ route |
|
|
|
|
|
|
|
route[SANITY_CHECK] |
|
|
|
{ |
|
|
|
if (!mf_process_maxfwd_header("10")) { |
|
|
|
xlog("L_WARN", "$ci|end|too much hops, not enough barley"); |
|
|
|
send_reply("483", "Too Many Hops"); |
|
|
|
if (!sanity_check()) { |
|
|
|
xlog("L_WARN", "$ci|end|message from $si:$sp is insane"); |
|
|
|
exit; |
|
|
|
} |
|
|
|
|
|
|
|
if (!sanity_check()) { |
|
|
|
xlog("L_WARN", "$ci|end|message is insane"); |
|
|
|
if (!mf_process_maxfwd_header("10")) { |
|
|
|
xlog("L_WARN", "$ci|end|too much hops, not enough barley from $si:$sp"); |
|
|
|
send_reply("483", "Too Many Hops"); |
|
|
|
exit; |
|
|
|
} |
|
|
|
|
|
|
|
if ($ua == "friendly-scanner" || |
|
|
|
$ua == "sundayddr" || |
|
|
|
$ua =~ "sipcli" ) { |
|
|
|
xlog("L_WARN", "$ci|end|dropping message with user-agent $ua"); |
|
|
|
xlog("L_WARN", "$ci|end|dropping message with user-agent $ua from $si:$sp"); |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -315,6 +315,10 @@ route[HANDLE_NOTIFY] |
|
|
|
{ |
|
|
|
if (is_method("NOTIFY")) { |
|
|
|
if (isflagset(FLAG_INTERNALLY_SOURCED)) { |
|
|
|
if (registered("location")) { |
|
|
|
lookup("location"); |
|
|
|
xlog("L_INFO", "$ci|log|routing to $ruid"); |
|
|
|
} |
|
|
|
route(INTERNAL_TO_EXTERNAL_RELAY); |
|
|
|
} else { |
|
|
|
#!ifdef TRAFFIC-FILTER-ROLE |
|
|
|
@ -330,8 +334,10 @@ route[HANDLE_NOTIFY] |
|
|
|
#!endif |
|
|
|
|
|
|
|
if($hdr(Event) == "keep-alive") { |
|
|
|
xlog("L_INFO", "$ci|stop|replying to keep alive"); |
|
|
|
sl_send_reply("405", "Stay Alive / Method Not Allowed"); |
|
|
|
} else { |
|
|
|
xlog("L_INFO", "$ci|stop|consuming event $hdr(Event)"); |
|
|
|
sl_send_reply("200", "Rawr!!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|