|
@@ -14,18 +14,21 @@ loadmodule "modules/rr/rr.so"
|
|
|
loadmodule "modules/maxfwd/maxfwd.so"
|
|
|
loadmodule "modules/mysql/mysql.so"
|
|
|
loadmodule "modules/auth/auth.so"
|
|
|
+loadmodule "modules/auth_db/auth_db.so"
|
|
|
+loadmodule "modules/group/group.so"
|
|
|
+loadmodule "modules/uri/uri.so"
|
|
|
|
|
|
# ----------------- setting module-specific parameters ---------------
|
|
|
|
|
|
-modparam("auth", "db_url","sql://ser:heslo@localhost/ser")
|
|
|
-modparam("auth", "calculate_ha1", yes)
|
|
|
-modparam("auth", "password_column", "password")
|
|
|
+modparam("auth_db", "db_url","sql://ser:heslo@localhost/ser")
|
|
|
+modparam("auth_db", "calculate_ha1", yes)
|
|
|
+modparam("auth_db", "password_column", "password")
|
|
|
|
|
|
# -- acc params --
|
|
|
modparam("acc", "log_level", 1)
|
|
|
# that is the flag for which we will account -- don't forget to
|
|
|
# set the same one :-)
|
|
|
-modparam("acc", "acc_flag", 1 )
|
|
|
+modparam("acc", "log_flag", 1 )
|
|
|
|
|
|
# ------------------------- request routing logic -------------------
|
|
|
|
|
@@ -48,11 +51,12 @@ route{
|
|
|
|
|
|
/* ********* RR ********************************** */
|
|
|
|
|
|
- /* Do strict routing if route headers present */
|
|
|
- rewriteFromRoute();
|
|
|
+ /* grant Route routing if route headers present */
|
|
|
+ if (loose_route()) { t_relay(); break; };
|
|
|
+
|
|
|
/* record-route INVITEs -- all subsequent requests must visit us */
|
|
|
if (method=="INVITE") {
|
|
|
- addRecordRoute();
|
|
|
+ record_route();
|
|
|
};
|
|
|
|
|
|
# now check if it really is a PSTN destination which should be handled
|
|
@@ -102,19 +106,19 @@ route{
|
|
|
# calls (destinations beginning with a single zero)?
|
|
|
# (i.e., is he in the "local" group?)
|
|
|
if (uri=~"sip:0[1-9][0-9]+@.*") {
|
|
|
- if (!is_in_group("local")) {
|
|
|
+ if (!is_user_in("credentials", "local")) {
|
|
|
sl_send_reply("403", "No permission for local calls");
|
|
|
break;
|
|
|
};
|
|
|
# the same for long-distance (destinations begin with two zeros")
|
|
|
} else if (uri=~"sip:00[1-9][0-9]+@.*") {
|
|
|
- if (!is_in_group("ld")) {
|
|
|
+ if (!is_user_in("credentials", "ld")) {
|
|
|
sl_send_reply("403", " no permission for LD ");
|
|
|
break;
|
|
|
};
|
|
|
# the same for international calls (three zeros)
|
|
|
} else if (uri=~"sip:000[1-9][0-9]+@.*") {
|
|
|
- if (!is_in_group("int")) {
|
|
|
+ if (!is_user_in("credentials", "int")) {
|
|
|
sl_send_reply("403", "International permissions needed");
|
|
|
break;
|
|
|
};
|