etc/ser.cfg
6f251f6b
 #
 # $Id$
 #
 # simple quick-start config script
 #
 
 # ----------- global configuration parameters ------------------------
 
06aaa54f
 #debug=3         # debug level (cmd line: -dddddddddd)
 #fork=yes
 #log_stderror=no	# (cmd line: -E)
ede3897b
 #memlog=5 # memory debug log level
 #log_facility=LOG_LOCAL0 # sets the facility used for logging (see syslog(3))
66304f28
 
91c5f901
 /* Uncomment these lines to enter debugging mode 
a0775846
 fork=no
66304f28
 log_stderror=yes
3e1eaf9d
 */
66304f28
 
6f251f6b
 check_via=no	# (cmd. line: -v)
 dns=no           # (cmd. line: -r)
 rev_dns=no      # (cmd. line: -R)
06aaa54f
 #port=5060
 #children=4
66304f28
 fifo="/tmp/ser_fifo"
ede3897b
 #user=ser
 #group=ser
 #fifo_user=ser # owner of the ser fifo
 #fifo_group=ser
 #fifo_mode=0660 # fifo's permissions
 #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)
 
 #
6f251f6b
 
 # ------------------ module loading ----------------------------------
 
0338eb56
 # Uncomment this if you want to use SQL database
a0ffaa4c
 #loadmodule "/usr/local/lib/ser/modules/mysql.so"
0338eb56
 
a0ffaa4c
 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/maxfwd.so"
 loadmodule "/usr/local/lib/ser/modules/usrloc.so"
 loadmodule "/usr/local/lib/ser/modules/registrar.so"
0d35f439
 loadmodule "/usr/local/lib/ser/modules/textops.so"
6f251f6b
 
0338eb56
 # Uncomment this if you want digest authentication
 # mysql.so must be loaded !
a0ffaa4c
 #loadmodule "/usr/local/lib/ser/modules/auth.so"
 #loadmodule "/usr/local/lib/ser/modules/auth_db.so"
0338eb56
 
6f251f6b
 # ----------------- setting module-specific parameters ---------------
 
 # -- usrloc params --
 
b47e7b9a
 modparam("usrloc", "db_mode",   0)
6f251f6b
 
0338eb56
 # Uncomment this if you want to use SQL database 
 # for persistent storage and comment the previous line
95fe923b
 #modparam("usrloc", "db_mode", 2)
0338eb56
 
 # -- auth params --
 # Uncomment if you are using auth module
8e35120b
 #
1e482b25
 #modparam("auth_db", "calculate_ha1", yes)
8e35120b
 #
 # If you set "calculate_ha1" parameter to yes (which true in this config), 
 # uncomment also the following parameter)
 #
1e482b25
 #modparam("auth_db", "password_column", "password")
0338eb56
 
ef297ad9
 # -- rr params --
 # add value to ;lr param to make some broken UAs happy
 modparam("rr", "enable_full_lr", 1)
 
6f251f6b
 # -------------------------  request routing logic -------------------
 
 # main routing logic
 
 route{
 
e908c20d
 	# initial sanity checks -- messages with
66304f28
 	# max_forwards==0, or excessively long requests
6f251f6b
 	if (!mf_process_maxfwd_header("10")) {
 		sl_send_reply("483","Too Many Hops");
 		break;
 	};
0d35f439
 	if (msg:len >=  max_len ) {
6f251f6b
 		sl_send_reply("513", "Message too big");
 		break;
 	};
6cd48835
 	
91c5f901
 	# 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
0d35f439
 	if (!method=="REGISTER") record_route();	
 
 	# subsequent messages withing a dialog should take the
 	# path determined by record-routing
caf91a1c
 	if (loose_route()) {
0d35f439
 		# mark routing logic in request
 		append_hf("P-hint: rr-enforced\r\n"); 
 		route(1);
 		break;
 	};
 
 	if (!uri==myself) {
 		# mark routing logic in request
 		append_hf("P-hint: outbound\r\n"); 
 		route(1);
caf91a1c
 		break;
 	};
6f251f6b
 
 	# if the request is for other domain use UsrLoc
42821052
 	# (in case, it does not work, use the following command
 	# with proper names and addresses in it)
6f251f6b
 	if (uri==myself) {
 
 		if (method=="REGISTER") {
3d4a32d0
 
 # Uncomment this if you want to use digest authentication
2c772a29
 #			if (!www_authorize("iptel.org", "subscriber")) {
 #				www_challenge("iptel.org", "0");
3d4a32d0
 #				break;
 #			};
 
b47e7b9a
 			save("location");
6f251f6b
 			break;
 		};
 
0d35f439
 		lookup("aliases");
 		if (!uri==myself) {
 			append_hf("P-hint: outbound alias\r\n"); 
 			route(1);
 			break;
 		};
 
6f251f6b
 		# native SIP destinations are handled using our USRLOC DB
b47e7b9a
 		if (!lookup("location")) {
6f251f6b
 			sl_send_reply("404", "Not Found");
 			break;
 		};
 	};
0d35f439
 	append_hf("P-hint: usrloc applied\r\n"); 
 	route(1);
 }
 
 route[1] 
 {
 	# send it out now; use stateful forwarding as it works reliably
 	# even for UDP2TCP
6f251f6b
 	if (!t_relay()) {
 		sl_reply_error();
 	};
 }