4 # This a very basic config file w/ aliases and a named route but
5 # w/o authentication, accounting, database, multi-domain support etc.
6 # Please refer to sip-router.cfg for a more complete example
8 # Direct your questions about this file to: <sr-users@lists.sip-router.org>.
10 # For more information about the various parameters, functions and statements
11 # try http://sip-router.org/wiki/ .
14 #------------ Features -----------------------------------------------
15 # Several extra features can be enabled by adding #!define WITH_<FEATURE>
16 # statements to the config file, or by starting sr/ser with -A WITH_<FEATURE>.
17 # E.g.: ser -f /etc/ser/sip-router-basic.cfg -A WITH_TLS
25 # started from compile directory (not installed)
26 ##!define LOCAL_TEST_RUN
29 # ----------- global configuration parameters ------------------------
36 debug=2 # debug level (cmd line: -dddddddddd)
39 #memdbg=10 # memory debug message level
40 #memlog=10 # memory statistics log level
41 #log_facility=LOG_LOCAL0 # sets the facility used for logging (see syslog(3))
44 check_via=no # (cmd. line: -v)
45 dns=no # (cmd. line: -r)
46 rev_dns=no # (cmd. line: -R)
51 #disable_core=yes #disables core dumping
52 #open_fd_limit=1024 # sets the open file descriptors limit
53 #mhomed=yes # usefull for multihomed hosts, small performance penalty
55 #tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
63 # ------------------ module loading ----------------------------------
65 #!ifdef LOCAL_TEST_RUN
66 loadpath "modules:modules_s"
68 loadpath "/usr/lib/sip-router/modules:/usr/lib/sip-router/modules_s"
77 loadmodule "registrar"
84 # ----------------- setting module-specific parameters ---------------
88 modparam("usrloc", "db_mode", 0)
91 # add value to ;lr param to make some broken UAs happy
92 modparam("rr", "enable_full_lr", 1)
95 # by default ctl listens on unixs:/tmp/sip-router_ctl if no other address is
96 # specified in modparams; this is also the default for sercmd
97 modparam("ctl", "binrpc", "unixs:/tmp/ser_ctl")
98 # listen on the "standard" fifo for backward compatibility
99 modparam("ctl", "fifo", "fifo:/tmp/ser_fifo")
100 # listen on tcp, localhost
101 modparam("ctl", "binrpc", "tcp:127.0.0.1:2046")
104 modparam("tls", "verify_certificate", 0)
105 #!ifdef LOCAL_TEST_RUN
106 modparam("tls", "certificate", "./modules/tls/sip-router-selfsigned.pem")
107 modparam("tls", "private_key", "./modules/tls/sip-router-selfsigned.key")
108 #separate TLS config file
109 #modparam("tls", "config", "./modules/tls/tls.cfg")
111 modparam("tls", "certificate", "ser-selfsigned.pem")
112 modparam("tls", "private_key", "ser-selfsigned.key")
113 #separate TLS config file
114 #modparam("tls", "config", "tls.cfg")
122 # ------------------------- request routing logic -------------------
128 # initial sanity checks -- messages with
129 # max_forwards==0, or excessively long requests
130 if (!mf_process_maxfwd_header("10")) {
131 sl_reply("483","Too Many Hops");
134 if (msg:len >= 4096 ) {
135 sl_reply("513", "Message too big");
139 # we record-route all messages -- to make sure that
140 # subsequent messages will go through our proxy; that's
141 # particularly good if upstream and downstream entities
142 # use different transport protocol
143 if (!method=="REGISTER") record_route();
145 # subsequent messages withing a dialog should take the
146 # path determined by record-routing
148 # mark routing logic in request
149 append_hf("P-hint: rr-enforced\r\n");
155 # mark routing logic in request
156 append_hf("P-hint: outbound\r\n");
161 # if the request is for other domain use UsrLoc
162 # (in case, it does not work, use the following command
163 # with proper names and addresses in it)
166 if (method=="REGISTER") {
167 save_contacts("location");
171 # native SIP destinations are handled using our USRLOC DB
172 if (!lookup_contacts("location")) {
173 sl_reply("404", "Not Found");
176 append_hf("P-hint: usrloc applied\r\n");
183 # send it out now; use stateful forwarding as it works reliably