etc/ser-basic.cfg
bfb7651e
 #
 # $Id$
 #
 # This a very basic config file w aliases and anamed route but
0ee79c04
 # w/o authentication, accounting, database, multi-domain support etc.
bfb7651e
 # Please refer to ser.cfg for a more complete example
 #
 
 # ----------- global configuration parameters ------------------------
 
 debug=3         # debug level (cmd line: -dddddddddd)
 #memdbg=10 # memory debug message level
 #memlog=10 # memory statistics log level
 #log_facility=LOG_LOCAL0 # sets the facility used for logging (see syslog(3))
 
 /* Uncomment these lines to enter debugging mode 
 fork=no
 log_stderror=yes
 */
 
 check_via=no    # (cmd. line: -v)
 dns=no          # (cmd. line: -r)
 rev_dns=no      # (cmd. line: -R)
 #port=5060
 #children=4
 #user=ser
 #group=ser
 #disable_core=yes #disables core dumping
 #open_fd_limit=1024 # sets the open file descriptors limit
 #mhomed=yes  # usefull for multihomed hosts, small performance penalty
 #disable_tcp=yes 
 #tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
 
 #
 
 # ------------------ module loading ----------------------------------
 
 loadmodule "/usr/local/lib/ser/modules/sl.so"
 loadmodule "/usr/local/lib/ser/modules/tm.so"
 loadmodule "/usr/local/lib/ser/modules/rr.so"
 loadmodule "/usr/local/lib/ser/modules/textops.so"
 loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
 loadmodule "/usr/local/lib/ser/modules/usrloc.so"
 loadmodule "/usr/local/lib/ser/modules/registrar.so"
 loadmodule "/usr/local/lib/ser/modules/ctl.so"
 
 # ----------------- setting module-specific parameters ---------------
 
 # -- usrloc params --
 
 modparam("usrloc", "db_mode",   0)
 
 # -- rr params --
 # add value to ;lr param to make some broken UAs happy
 modparam("rr", "enable_full_lr", 1)
 
 # ctl params
 # by default ctl listens on unixs:/tmp/ser_ctl if no other address is
 # specified in modparams; this is also the default for sercmd
 modparam("ctl", "binrpc", "unixs:/tmp/ser_ctl")
 # listen on the "standard" fifo for backward compatibility
 modparam("ctl", "fifo", "fifo:/tmp/ser_fifo")
 # listen on tcp, localhost
 #modparam("ctl", "binrpc", "tcp:localhost:2046")
 
 # -------------------------  request routing logic -------------------
 
 # main routing logic
 
 route{
 
 	# initial sanity checks -- messages with
 	# max_forwards==0, or excessively long requests
 	if (!mf_process_maxfwd_header("10")) {
986a4ea0
 		sl_reply("483","Too Many Hops");
bfb7651e
 		break;
986a4ea0
 	}
bfb7651e
 	if (msg:len >=  max_len ) {
986a4ea0
 		sl_reply("513", "Message too big");
bfb7651e
 		break;
986a4ea0
 	}
 
bfb7651e
 	# we record-route all messages -- to make sure that
 	# subsequent messages will go through our proxy; that's
 	# particularly good if upstream and downstream entities
 	# use different transport protocol
986a4ea0
 	if (!method=="REGISTER") record_route();
bfb7651e
 
 	# subsequent messages withing a dialog should take the
 	# path determined by record-routing
 	if (loose_route()) {
 		# mark routing logic in request
986a4ea0
 		append_hf("P-hint: rr-enforced\r\n");
bfb7651e
 		route(FORWARD);
 		break;
986a4ea0
 	}
bfb7651e
 
 	if (!uri==myself) {
 		# mark routing logic in request
986a4ea0
 		append_hf("P-hint: outbound\r\n");
bfb7651e
 		route(FORWARD);
 		break;
986a4ea0
 	}
bfb7651e
 
 	# if the request is for other domain use UsrLoc
 	# (in case, it does not work, use the following command
 	# with proper names and addresses in it)
 	if (uri==myself) {
 
 		if (method=="REGISTER") {
 			save_contacts("location");
 			break;
986a4ea0
 		}
bfb7651e
 
 		# native SIP destinations are handled using our USRLOC DB
 		if (!lookup_contacts("location")) {
986a4ea0
 			sl_reply("404", "Not Found");
bfb7651e
 			break;
986a4ea0
 		}
 		append_hf("P-hint: usrloc applied\r\n");
 	}
bfb7651e
 	route(FORWARD);
 }
 
986a4ea0
 route[FORWARD]
bfb7651e
 {
 	# send it out now; use stateful forwarding as it works reliably
 	# even for UDP2TCP
 	if (!t_relay()) {
 		sl_reply_error();
986a4ea0
 	}
bfb7651e
 }