1 # ----------- global configuration parameters ------------------------
7 alias=voip.anytun.org:5060
9 check_via=no # (cmd. line: -v)
10 dns=yes # (cmd. line: -r)
11 rev_dns=yes # (cmd. line: -R)
13 fifo="/tmp/openser_fifo"
14 fifo_db_url="mysql://anytunro:woasinidro@localhost/anytun"
16 # ------------------ module loading ----------------------------------
18 loadmodule "/usr/lib/openser/modules/mysql.so"
19 loadmodule "/usr/lib/openser/modules/sl.so"
20 loadmodule "/usr/lib/openser/modules/tm.so"
21 loadmodule "/usr/lib/openser/modules/rr.so"
22 loadmodule "/usr/lib/openser/modules/textops.so"
23 loadmodule "/usr/lib/openser/modules/maxfwd.so"
24 loadmodule "/usr/lib/openser/modules/usrloc.so"
25 loadmodule "/usr/lib/openser/modules/registrar.so"
26 loadmodule "/usr/lib/openser/modules/auth.so"
27 loadmodule "/usr/lib/openser/modules/auth_db.so"
28 loadmodule "/usr/lib/openser/modules/uri_db.so"
29 loadmodule "/usr/lib/openser/modules/nathelper.so"
32 ## ----------------- setting module-specific parameters ---------------
34 modparam("auth_db|uri_db", "db_url", "mysql://anytunro:woasinidro@localhost/anytun")
35 modparam("auth_db", "calculate_ha1", 1)
36 modparam("auth_db", "password_column", "password")
38 modparam("usrloc", "db_url", "mysql://anytun:woasinid@localhost/anytun")
39 modparam("usrloc", "db_mode", 2)
41 modparam("rr", "enable_full_lr", 1)
43 modparam("nathelper", "rtpproxy_sock", "udp:193.238.157.58:22222")
45 # ------------------------- request routing logic -------------------
48 # initial sanity checks -- messages with
49 # max_forwards==0, or excessively long requests
50 if (!mf_process_maxfwd_header("10")) {
51 sl_send_reply("483","Too Many Hops");
55 if (msg:len >= 2048 ) {
56 sl_send_reply("513", "Message too big");
60 # we record-route all messages -- to make sure that
61 # subsequent messages will go through our proxy; that's
62 # particularly good if upstream and downstream entities
63 # use different transport protocol
64 if (method!="REGISTER")
68 if (method=="BYE" || method=="CANCEL") {
72 # subsequent messages withing a dialog should take the
73 # path determined by record-routing
86 } if (method=="INVITE") {
88 } else if (method=="REGISTER") {
98 # native SIP destinations are handled using our USRLOC DB
99 if (!lookup("location")) {
100 sl_send_reply("404", "Not Found");
110 # send it out now; use stateful forwarding as it works reliably
119 sl_send_reply("100", "Trying");
121 if (!www_authorize("","subscriber")) {
122 www_challenge("","0");
127 sl_send_reply("401", "Unauthorized");
131 consume_credentials();
133 if (!save("location")) {
140 if (!proxy_authorize("","subscriber")) {
141 proxy_challenge("","0");
143 } else if (!check_from()) {
144 sl_send_reply("403", "Use From=ID");
148 consume_credentials();
156 if (!lookup("location")) {
157 sl_send_reply("404", "User Not Found");
166 if (method=="INVITE") {
167 force_rtp_proxy("","193.238.157.58");
172 if (!search("^Content-Length:[ ]*0")) {
173 force_rtp_proxy("","193.238.157.58");