|
@@ -128,11 +128,17 @@ modparam("ctl", "fifo", "fifo:/tmp/ser_fifo")
|
|
#modparam("ctl", "binrpc", "tcp:localhost:2046")
|
|
#modparam("ctl", "binrpc", "tcp:localhost:2046")
|
|
|
|
|
|
# -- acc_db params --
|
|
# -- acc_db params --
|
|
|
|
+# failed transactions (=negative responses) should be logged to
|
|
modparam("acc_db", "failed_transactions", 1)
|
|
modparam("acc_db", "failed_transactions", 1)
|
|
|
|
|
|
# comment the next line if you dont want to have accouting to DB
|
|
# comment the next line if you dont want to have accouting to DB
|
|
modparam("acc_db", "log_flag", "FLAG_ACC")
|
|
modparam("acc_db", "log_flag", "FLAG_ACC")
|
|
|
|
|
|
|
|
+# -- tm params --
|
|
|
|
+# uncomment the following line if you want to avoid that each new reply
|
|
|
|
+# restarts the resend timer (see INBOUND route below)
|
|
|
|
+#modparam("tm", "restart_fr_on_each_reply", "0")
|
|
|
|
+
|
|
# ------------------------- request routing logic -------------------
|
|
# ------------------------- request routing logic -------------------
|
|
|
|
|
|
# main routing logic
|
|
# main routing logic
|
|
@@ -322,7 +328,7 @@ route[REGISTRAR]
|
|
};
|
|
};
|
|
|
|
|
|
# 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", "@to.uri")) {
|
|
|
|
|
|
+ if (!lookup_user("$t.uid", "@to.uri")) {
|
|
sl_send_reply("404", "Unknown user in To");
|
|
sl_send_reply("404", "Unknown user in To");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
@@ -334,7 +340,7 @@ route[REGISTRAR]
|
|
|
|
|
|
# check if the authenticated user is the same as the request originator
|
|
# check if the authenticated user is the same as the request originator
|
|
# you may uncomment it if you care, what uri is in From header
|
|
# you may uncomment it if you care, what uri is in From header
|
|
- #if (!lookup_user("$fu", "@from.uri")) {
|
|
|
|
|
|
+ #if (!lookup_user("$f.uid", "@from.uri")) {
|
|
# sl_send_reply("404", "Unknown user in From");
|
|
# sl_send_reply("404", "Unknown user in From");
|
|
# drop;
|
|
# drop;
|
|
#}
|
|
#}
|
|
@@ -386,10 +392,10 @@ route[AUTHENTICATION]
|
|
|
|
|
|
# check if the UID from the authentication meets the From header
|
|
# check if the UID from the authentication meets the From header
|
|
$authuid = $uid;
|
|
$authuid = $uid;
|
|
- if (!lookup_user("$fu", "@from.uri")) {
|
|
|
|
|
|
+ if (!lookup_user("$f.uid", "@from.uri")) {
|
|
del_attr("$uid");
|
|
del_attr("$uid");
|
|
}
|
|
}
|
|
- if (! ($uid == $authuid)) {
|
|
|
|
|
|
+ if ($fr.uid != $fr.authuid) {
|
|
sl_send_reply("403", "Fake Identity");
|
|
sl_send_reply("403", "Fake Identity");
|
|
drop;
|
|
drop;
|
|
}
|
|
}
|
|
@@ -410,11 +416,10 @@ route[OUTBOUND]
|
|
route[INBOUND]
|
|
route[INBOUND]
|
|
{
|
|
{
|
|
# lets see if know the callee
|
|
# lets see if know the callee
|
|
- if (lookup_user("$tu", "@ruri")) {
|
|
|
|
|
|
+ if (lookup_user("$t.uid", "@ruri")) {
|
|
|
|
|
|
- # maybe you want to consider the preferences of the callee,
|
|
|
|
- # e.g. voicemail, then load his attributes here
|
|
|
|
- #load_attrs("$tu", "$t.uid");
|
|
|
|
|
|
+ # load the preferences of the callee to have his timeout values loaded
|
|
|
|
+ load_attrs("$tu", "$t.uid");
|
|
|
|
|
|
# if you want to know if the callee username was an alias
|
|
# if you want to know if the callee username was an alias
|
|
# check it like this
|
|
# check it like this
|
|
@@ -427,6 +432,20 @@ route[INBOUND]
|
|
# native SIP destinations are handled using our USRLOC DB
|
|
# native SIP destinations are handled using our USRLOC DB
|
|
if (lookup_contacts("location")) {
|
|
if (lookup_contacts("location")) {
|
|
append_hf("P-hint: usrloc applied\r\n");
|
|
append_hf("P-hint: usrloc applied\r\n");
|
|
|
|
+
|
|
|
|
+ # we set the TM module timers according to the prefences
|
|
|
|
+ # of the callee (avoid too long ringing of his phones)
|
|
|
|
+ # Note1: timer values have to be in ms now!
|
|
|
|
+ # Note2: this makes even more sense if you switch to a voicemail
|
|
|
|
+ # in a FAILURE route
|
|
|
|
+ if ($t.fr_inv_timer) {
|
|
|
|
+ if ($t.fr_timer) {
|
|
|
|
+ t_set_fr("$t.fr_inv_timer", "$t.fr_timer");
|
|
|
|
+ } else {
|
|
|
|
+ t_set_fr("$t.fr_inv_timer");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
route(FORWARD);
|
|
route(FORWARD);
|
|
} else {
|
|
} else {
|
|
sl_send_reply("480", "User temporarily not available");
|
|
sl_send_reply("480", "User temporarily not available");
|