added generic tool code
[anytun.git] / openser-config / openser.cfg
blob193acd0a2e3353047c0058857d9dafbfceba8faf
2 # ----------- global configuration parameters ------------------------
4 fork=yes
5 #listen=83.64.208.28
6 port=5060
7 log_stderror=no
8 debug=3
10 check_via=no    # (cmd. line: -v)
11 dns=no          # (cmd. line: -r)
12 rev_dns=no      # (cmd. line: -R)
13 children=4
14 fifo="/tmp/openser_fifo"
16 # ------------------ module loading ----------------------------------
18 loadmodule "/usr/lib/openser/modules/sl.so"
19 loadmodule "/usr/lib/openser/modules/tm.so"
20 loadmodule "/usr/lib/openser/modules/rr.so"
21 loadmodule "/usr/lib/openser/modules/textops.so"
22 loadmodule "/usr/lib/openser/modules/maxfwd.so"
23 loadmodule "/usr/lib/openser/modules/usrloc.so"
24 loadmodule "/usr/lib/openser/modules/registrar.so"
26 loadmodule "/usr/lib/openser/modules/nathelper.so"
28 loadmodule "/usr/lib/openser/modules/xlog.so"
31 ## ----------------- setting module-specific parameters ---------------
33 modparam("usrloc", "db_mode",   0)
35 modparam("rr", "enable_full_lr", 1)
37 modparam("nathelper", "rtpproxy_sock", "udp:localhost:22222")
39 # -------------------------  request routing logic -------------------
41 route{
42         xlog("L_ERR", "@route: method <$rm> r-uri <$ru>\n");
44         # initial sanity checks -- messages with
45         # max_forwards==0, or excessively long requests
46         if (!mf_process_maxfwd_header("10")) {
47                 sl_send_reply("483","Too Many Hops");
48                 exit;
49         };
51         if (msg:len >=  2048 ) {
52                 sl_send_reply("513", "Message too big");
53                 exit;
54         };
56         # we record-route all messages -- to make sure that
57         # subsequent messages will go through our proxy; that's
58         # particularly good if upstream and downstream entities
59         # use different transport protocol
60         if (method!="REGISTER") 
61                 record_route();
64         if (method=="BYE" || method=="CANCEL") {
65                 unforce_rtp_proxy();
66         };
68         # subsequent messages withing a dialog should take the
69         # path determined by record-routing
70         if (loose_route()) {
71                 if (method=="INVITE") {
72                         route(3);
73                 };
74                 route(1);
75         };
77         if (!uri==myself) {
78                 if (method=="INVITE") {
79                         route(3);
80                 };
81                 route(1);
82         };
84         if (method=="ACK") {
85                 route(1);
86         } else if (method=="REGISTER") {
87                 route(2);
88         };
89         
90         lookup("aliases");
91         if (uri!=myself) {
92                 if (method=="INVITE") {
93                         route(3);
94                 };
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         if (method=="INVITE") {
105                 route(3);
106         };
108         route(1);
112 route[1] {
113         # send it out now; use stateful forwarding as it works reliably
114         # even for UDP2TCP
115         if (!t_relay()) {
116                 sl_reply_error();
117         };
118         exit;
121 route[2] {
122         if (!save("location")) {
123                 sl_reply_error();
124         };
125         exit;
128 route[3] {
129         force_rtp_proxy("","83.64.208.28");
132 onreply_route {
133         if (!search("^Content-Length:[ ]*0")) {
134                 route(3);
135         };