fixed windows endian include
[anytun.git] / openser-config / openser.cfg
bloba4ed43f1685a00d1e8b47f6cfd7ad8704838de6c
1 # ----------- global configuration parameters ------------------------
3 fork=yes
4 port=5060
5 log_stderror=no
6 debug=3
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)
12 children=4
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 -------------------
47 route{
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");
52                 exit;
53         };
55         if (msg:len >=  2048 ) {
56                 sl_send_reply("513", "Message too big");
57                 exit;
58         };
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") 
65                 record_route();
68         if (method=="BYE" || method=="CANCEL") {
69                 unforce_rtp_proxy();
70         };
72         # subsequent messages withing a dialog should take the
73         # path determined by record-routing
74         if (loose_route()) {
75                 route(4);
76                 route(1);
77         };
79         if (!uri==myself) {
80                 route(4);
81                 route(1);
82         };
84         if (method=="ACK") {
85                 route(1);
86         } if (method=="INVITE") {
87                 route(3);
88         } else if (method=="REGISTER") {
89                 route(2);
90         };
91         
92         lookup("aliases");
93         if (uri!=myself) {
94                 route(4);
95                 route(1);
96         };
97         
98         # native SIP destinations are handled using our USRLOC DB
99         if (!lookup("location")) {
100                 sl_send_reply("404", "Not Found");
101                 exit;
102         };
104         route(4);
105         route(1);
109 route[1] {
110         # send it out now; use stateful forwarding as it works reliably
111         # even for UDP2TCP
112         if (!t_relay()) {
113                 sl_reply_error();
114         };
115         exit;
118 route[2] {
119         sl_send_reply("100", "Trying");
120   
121         if (!www_authorize("","subscriber")) {
122                 www_challenge("","0");
123                 exit;
124         };
126         if (!check_to()) {
127                 sl_send_reply("401", "Unauthorized");
128                 exit;
129         };
131         consume_credentials();
133         if (!save("location")) {
134                 sl_reply_error();
135         };
136         exit;
139 route[3] {
140         if (!proxy_authorize("","subscriber")) {
141                 proxy_challenge("","0");
142                 exit;
143         } else if (!check_from()) {
144                 sl_send_reply("403", "Use From=ID");
145                 exit;
146         };
148         consume_credentials();
150         lookup("aliases");
151         if (uri!=myself) {
152                 route(4);
153                 route(1);
154         };
156         if (!lookup("location")) {
157                 sl_send_reply("404", "User Not Found");
158                 exit;
159         };
161         route(4);
162         route(1);
165 route[4] {
166         if (method=="INVITE") {
167                 force_rtp_proxy("","193.238.157.58");
168         };
171 onreply_route {
172         if (!search("^Content-Length:[ ]*0")) {
173                 force_rtp_proxy("","193.238.157.58");
174         };