4 # This a very basic config file w aliases and anamed route but
5 # w/o authentication, accounting, database, multi-domain support etc.
6 # Please refer to sip-router.cfg for a more complete example
9 # ----------- global configuration parameters ------------------------
11 debug=2 # debug level (cmd line: -dddddddddd)
12 #memdbg=10 # memory debug message level
13 #memlog=10 # memory statistics log level
14 #log_facility=LOG_LOCAL0 # sets the facility used for logging (see syslog(3))
16 /* Uncomment these lines to enter debugging mode
21 check_via=no # (cmd. line: -v)
22 dns=no # (cmd. line: -r)
23 rev_dns=no # (cmd. line: -R)
28 #disable_core=yes #disables core dumping
29 #open_fd_limit=1024 # sets the open file descriptors limit
30 #mhomed=yes # usefull for multihomed hosts, small performance penalty
32 #tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
36 # ------------------ module loading ----------------------------------
38 #loadpath "modules:modules_s"
39 loadpath "/usr/lib/sip-router/modules:/usr/lib/sip-router/modules_s"
47 loadmodule "registrar"
51 # ----------------- setting module-specific parameters ---------------
55 modparam("usrloc", "db_mode", 0)
58 # add value to ;lr param to make some broken UAs happy
59 modparam("rr", "enable_full_lr", 1)
62 # by default ctl listens on unixs:/tmp/sip-router_ctl if no other address is
63 # specified in modparams; this is also the default for sercmd
64 modparam("ctl", "binrpc", "unixs:/tmp/sip-router_ctl")
65 # listen on the "standard" fifo for backward compatibility
66 modparam("ctl", "fifo", "fifo:/tmp/sip-router_fifo")
67 # listen on tcp, localhost
68 #modparam("ctl", "binrpc", "tcp:localhost:2046")
70 # ------------------------- request routing logic -------------------
76 # initial sanity checks -- messages with
77 # max_forwards==0, or excessively long requests
78 if (!mf_process_maxfwd_header("10")) {
79 sl_reply("483","Too Many Hops");
82 if (msg:len >= 4096 ) {
83 sl_reply("513", "Message too big");
87 # we record-route all messages -- to make sure that
88 # subsequent messages will go through our proxy; that's
89 # particularly good if upstream and downstream entities
90 # use different transport protocol
91 if (!method=="REGISTER") record_route();
93 # subsequent messages withing a dialog should take the
94 # path determined by record-routing
96 # mark routing logic in request
97 append_hf("P-hint: rr-enforced\r\n");
103 # mark routing logic in request
104 append_hf("P-hint: outbound\r\n");
109 # if the request is for other domain use UsrLoc
110 # (in case, it does not work, use the following command
111 # with proper names and addresses in it)
114 if (method=="REGISTER") {
115 save_contacts("location");
119 # native SIP destinations are handled using our USRLOC DB
120 if (!lookup_contacts("location")) {
121 sl_reply("404", "Not Found");
124 append_hf("P-hint: usrloc applied\r\n");
131 # send it out now; use stateful forwarding as it works reliably