/usr/share/doc/opensips/examples/replicate.cfg is in opensips 2.2.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #
# demo script showing how to set-up usrloc replication
#
# ----------- global configuration parameters ------------------------
log_level=3 # logging level (cmd line: -dddddddddd)
log_stderror=yes # (cmd line: -E)
# ------------------ module loading ----------------------------------
#set module path
mpath="/usr/local/lib/opensips/modules/"
loadmodule "db_mysql.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
# ----------------- setting module-specific parameters ---------------
# digest generation secret; use the same in backup server;
# also, make sure that the backup server has sync'ed time
modparam("auth", "secret", "alsdkhglaksdhfkloiwr")
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# verify credentials
if (!www_authorize("foo.bar", "subscriber")) {
www_challenge("foo.bar", "0");
exit;
};
# if ok, update contacts and ...
save("location");
# ... if this REGISTER is not a replica from our
# peer server, replicate to the peer server
if (!src_ip==backup.foo.bar) {
t_replicate("sip:backup.foo.bar:5060");
};
exit;
};
# do whatever else appropriate for your domain
log("non-REGISTER\n");
};
}
|