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)
64 # ------------------ module loading ----------------------------------
66 #!ifdef LOCAL_TEST_RUN
67 loadpath "modules:modules_s"
69 loadpath "/usr/lib/sip-router/modules:/usr/lib/sip-router/modules_s"
78 loadmodule "registrar"
85 # ----------------- setting module-specific parameters ---------------
89 modparam("usrloc", "db_mode", 0)
92 # add value to ;lr param to make some broken UAs happy
93 modparam("rr", "enable_full_lr", 1)
96 # by default ctl listens on unixs:/tmp/sip-router_ctl if no other address is
97 # specified in modparams; this is also the default for sercmd
98 modparam("ctl", "binrpc", "unixs:/tmp/ser_ctl")
99 # listen on the "standard" fifo for backward compatibility
100 modparam("ctl", "fifo", "fifo:/tmp/ser_fifo")
101 # listen on tcp, localhost
102 modparam("ctl", "binrpc", "tcp:127.0.0.1:2046")
105 modparam("tls", "verify_certificate", 0)
106 #!ifdef LOCAL_TEST_RUN
107 modparam("tls", "certificate", "./modules/tls/sip-router-selfsigned.pem")
108 modparam("tls", "private_key", "./modules/tls/sip-router-selfsigned.key")
109 #separate TLS config file
110 #modparam("tls", "config", "./modules/tls/tls.cfg")
112 modparam("tls", "certificate", "ser-selfsigned.pem")
113 modparam("tls", "private_key", "ser-selfsigned.key")
114 #separate TLS config file
115 #modparam("tls", "config", "tls.cfg")
123 # ------------------------- request routing logic -------------------
129 # initial sanity checks -- messages with
130 # max_forwards==0, or excessively long requests
131 if (!mf_process_maxfwd_header("10")) {
132 sl_reply("483","Too Many Hops");
135 if (msg:len >= 4096 ) {
136 sl_reply("513", "Message too big");
140 # we record-route all messages -- to make sure that
141 # subsequent messages will go through our proxy; that's
142 # particularly good if upstream and downstream entities
143 # use different transport protocol
144 if (!method=="REGISTER") record_route();
146 # subsequent messages withing a dialog should take the
147 # path determined by record-routing
149 # mark routing logic in request
150 append_hf("P-hint: rr-enforced\r\n");
156 # mark routing logic in request
157 append_hf("P-hint: outbound\r\n");
162 # if the request is for other domain use UsrLoc
163 # (in case, it does not work, use the following command
164 # with proper names and addresses in it)
167 if (method=="REGISTER") {
168 save_contacts("location");
172 # native SIP destinations are handled using our USRLOC DB
173 if (!lookup_contacts("location")) {
174 sl_reply("404", "Not Found");
177 append_hf("P-hint: usrloc applied\r\n");
184 # send it out now; use stateful forwarding as it works reliably