Browse Source

more message role changes

update-rsyslog-config
lazedo 7 years ago
parent
commit
aeb016e415
1 changed files with 7 additions and 46 deletions
  1. +7
    -46
      kamailio/default.cfg

+ 7
- 46
kamailio/default.cfg View File

@ -333,7 +333,14 @@ route
route(AUTHORIZATION_CHECK);
#!endif
#!ifdef MESSAGE_ROLE
route(HANDLE_MESSAGE);
#!else
if (is_method("MESSAGE")) {
sl_send_reply("405", "Method Not Allowed");
exit;
}
#!endif
#!ifdef PRESENCE_ROLE
route(HANDLE_SUBSCRIBE);
@ -486,48 +493,6 @@ route[HANDLE_NOTIFY]
exit;
}
route[HANDLE_MESSAGE]
{
#!ifdef MESSAGE_ROLE
if (is_method("MESSAGE")) {
xlog("L_INFO", "$ci|MESSAGE from $fu to $tu\n");
if (isflagset(FLAG_INTERNALLY_SOURCED) || src_ip == myself) {
xlog("L_INFO", "$ci| routing MESSAGE to external from $fu to $tu\n");
if (registered("location")) {
lookup("location");
xlog("L_INFO", "$ci|log|routing to $ruid\n");
}
#!ifdef TRAFFIC_FILTER_ROLE
} else if (!isflagset(FLAG_TRUSTED_SOURCE)
&& $rd =~ "[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}\.[0-9]{1,3}") {
xlog("L_WARN", "$ci|end|dropping MESSAGE request with IP domain\n");
exit();
#!endif
} else {
xlog("L_WARN", "$ci|end|MESSAGE $hdr(Content-Type)\n");
if( $hdr(Content-Type) == "application/im-iscomposing+xml" ) {
xlog("L_WARN", "$ci|end|dropping MESSAGE application/im-iscomposing+xml\n");
sl_send_reply("200", "OK");
} else if( $hdr(Content-Type) == "message/imdn+xml" ) {
xlog("L_WARN", "$ci|end|dropping MESSAGE message/imdn+xml\n");
sl_send_reply("202", "Accepted");
} else {
route(DISPATCHER_FIND_ROUTES);
}
}
route(RELAY);
}
#!else
if (is_method("MESSAGE")) {
if (!isflagset(FLAG_INTERNALLY_SOURCED)) {
sl_send_reply("202", "delivered to /dev/null");
exit();
}
route(RELAY);
}
#!endif
}
route[HANDLE_REFER]
{
if (!is_method("REFER")) {
@ -702,10 +667,6 @@ route[RELAY]
if (isflagset(FLAG_INTERNALLY_SOURCED)) {
route(INTERNAL_TO_EXTERNAL_RELAY);
#!ifdef MESSAGE_ROLE
} else if (is_method("MESSAGE") && src_ip == myself) {
route(INTERNAL_TO_EXTERNAL_RELAY);
#!endif
} else {
route(EXTERNAL_TO_INTERNAL_RELAY);
}


Loading…
Cancel
Save