examples/acc.cfg
0e3e0fbf
 #
 # $Id$
 #
 # example: accounting calls to nummerical destinations
 #
 
 # ------------------ module loading ----------------------------------
 
 loadmodule "modules/tm/tm.so"
 loadmodule "modules/acc/acc.so"
 loadmodule "modules/sl/sl.so"
 loadmodule "modules/maxfwd/maxfwd.so"
43067137
 loadmodule "modules/rr/rr.so"
0e3e0fbf
 
 # ----------------- setting module-specific parameters ---------------
 
 # -- acc params --
 # set the reporting log level
 modparam("acc", "log_level", 1)
 # number of flag, which will be used for accounting; if a message is
 # labeled with this flag, its completion status will be reported
c96013a1
 modparam("acc", "log_flag", 1 )
0e3e0fbf
 
 # -------------------------  request routing logic -------------------
 
 # main routing logic
 
 route{
 
 	/* ********* ROUTINE CHECKS  ********************************** */
 
 	# filter too old messages
 	if (!mf_process_maxfwd_header("10")) {
 		log("LOG: Too many hops\n");
 		sl_send_reply("483","Too Many Hops");
 		break;
 	};
 	if (len_gt( max_len )) {
 		sl_send_reply("513", "Wow -- Message too large");
 		break;
 	};
 
c96013a1
     #  Process record-routing
     if (loose_route()) { t_relay(); break; };
 
43067137
 
 	# labeled all transaction for accounting
 	setflag(1);
 
 	# record-route INVITES to make sure BYEs will visit our server too
c96013a1
 	if (method=="INVITE") record_route();
0e3e0fbf
 
 	# forward the request statefuly now; (we need *stateful* forwarding,
 	# because the stateful mode correlates requests with replies and
 	# drops retranmissions; otherwise, we would have to report on
 	# every single message received)
 	if (!t_relay()) {
 		sl_reply_error(); 
 		break; 
 	};
 
 }