|
@@ -175,7 +175,7 @@ route{
|
|
route(PSTN);
|
|
route(PSTN);
|
|
|
|
|
|
# nothing matched, reject it finally
|
|
# nothing matched, reject it finally
|
|
- sl_send_reply("404", "No route matched");
|
|
|
|
|
|
+ sl_reply("404", "No route matched");
|
|
}
|
|
}
|
|
|
|
|
|
route[FORWARD]
|
|
route[FORWARD]
|
|
@@ -199,12 +199,12 @@ route[INIT]
|
|
# initial sanity checks -- messages with
|
|
# initial sanity checks -- messages with
|
|
# max_forwards==0, or excessively long requests
|
|
# max_forwards==0, or excessively long requests
|
|
if (!mf_process_maxfwd_header("10")) {
|
|
if (!mf_process_maxfwd_header("10")) {
|
|
- sl_send_reply("483","Too Many Hops");
|
|
|
|
|
|
+ sl_reply("483","Too Many Hops");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
if (msg:len >= max_len ) {
|
|
if (msg:len >= max_len ) {
|
|
- sl_send_reply("513", "Message too big");
|
|
|
|
|
|
+ sl_reply("513", "Message too big");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -226,7 +226,7 @@ route[RPC]
|
|
src_ip==127.0.0.1) {
|
|
src_ip==127.0.0.1) {
|
|
|
|
|
|
if (msg:len >= 8192) {
|
|
if (msg:len >= 8192) {
|
|
- sl_send_reply("513", "Request to big");
|
|
|
|
|
|
+ sl_reply("513", "Request to big");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -291,7 +291,7 @@ route[DOMAIN]
|
|
# the domain of the callee -> somone uses our proxy as
|
|
# the domain of the callee -> somone uses our proxy as
|
|
# a relay
|
|
# a relay
|
|
if (!$t.did && !$f.did) {
|
|
if (!$t.did && !$f.did) {
|
|
- sl_send_reply("403", "Relaying Forbidden");
|
|
|
|
|
|
+ sl_reply("403", "Relaying Forbidden");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -302,33 +302,33 @@ route[REGISTRAR]
|
|
if (method=="REGISTER") {
|
|
if (method=="REGISTER") {
|
|
# check if the REGISTER if for one of our local domains
|
|
# check if the REGISTER if for one of our local domains
|
|
if (!$t.did) {
|
|
if (!$t.did) {
|
|
- sl_send_reply("403", "Register forwarding forbidden");
|
|
|
|
|
|
+ sl_reply("403", "Register forwarding forbidden");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
# we want only authenticated users to be registered
|
|
# we want only authenticated users to be registered
|
|
if (!www_authenticate("$fd.digest_realm", "credentials")) {
|
|
if (!www_authenticate("$fd.digest_realm", "credentials")) {
|
|
if ($? == -2) {
|
|
if ($? == -2) {
|
|
- sl_send_reply("500", "Internal Server Error");
|
|
|
|
|
|
+ sl_reply("500", "Internal Server Error");
|
|
} else if ($? == -3) {
|
|
} else if ($? == -3) {
|
|
- sl_send_reply("400", "Bad Request");
|
|
|
|
|
|
+ sl_reply("400", "Bad Request");
|
|
} else {
|
|
} else {
|
|
if ($digest_challenge) {
|
|
if ($digest_challenge) {
|
|
append_to_reply("%$digest_challenge");
|
|
append_to_reply("%$digest_challenge");
|
|
}
|
|
}
|
|
- sl_send_reply("401", "Unauthorized");
|
|
|
|
|
|
+ sl_reply("401", "Unauthorized");
|
|
}
|
|
}
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
# check if the authenticated user is the same as the target user
|
|
# check if the authenticated user is the same as the target user
|
|
if (!lookup_user("$tu.uid", "@to.uri")) {
|
|
if (!lookup_user("$tu.uid", "@to.uri")) {
|
|
- sl_send_reply("404", "Unknown user in To");
|
|
|
|
|
|
+ sl_reply("404", "Unknown user in To");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
if ($f.uid != $t.uid) {
|
|
if ($f.uid != $t.uid) {
|
|
- sl_send_reply("403", "Authentication and To-Header mismatch");
|
|
|
|
|
|
+ sl_reply("403", "Authentication and To-Header mismatch");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -375,14 +375,14 @@ route[AUTHENTICATION]
|
|
|
|
|
|
if (!proxy_authenticate("$fd.digest_realm", "credentials")) {
|
|
if (!proxy_authenticate("$fd.digest_realm", "credentials")) {
|
|
if ($? == -2) {
|
|
if ($? == -2) {
|
|
- sl_send_reply("500", "Internal Server Error");
|
|
|
|
|
|
+ sl_reply("500", "Internal Server Error");
|
|
} else if ($? == -3) {
|
|
} else if ($? == -3) {
|
|
- sl_send_reply("400", "Bad Request");
|
|
|
|
|
|
+ sl_reply("400", "Bad Request");
|
|
} else {
|
|
} else {
|
|
if ($digest_challenge) {
|
|
if ($digest_challenge) {
|
|
append_to_reply("%$digest_challenge");
|
|
append_to_reply("%$digest_challenge");
|
|
}
|
|
}
|
|
- sl_send_reply("407", "Proxy Authentication Required");
|
|
|
|
|
|
+ sl_reply("407", "Proxy Authentication Required");
|
|
}
|
|
}
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
@@ -393,7 +393,7 @@ route[AUTHENTICATION]
|
|
del_attr("$uid");
|
|
del_attr("$uid");
|
|
}
|
|
}
|
|
if ($fu.uid != $fr.authuid) {
|
|
if ($fu.uid != $fr.authuid) {
|
|
- sl_send_reply("403", "Fake Identity");
|
|
|
|
|
|
+ sl_reply("403", "Fake Identity");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
# load the user AVPs (preferences) of the caller, e.g. for RPID header
|
|
# load the user AVPs (preferences) of the caller, e.g. for RPID header
|
|
@@ -445,7 +445,7 @@ route[INBOUND]
|
|
|
|
|
|
route(FORWARD);
|
|
route(FORWARD);
|
|
} else {
|
|
} else {
|
|
- sl_send_reply("480", "User temporarily not available");
|
|
|
|
|
|
+ sl_reply("480", "User temporarily not available");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
}
|
|
}
|