examples/kamailio/acc.cfg
91301510
 #
 # $Id$
 #
 # example: accounting calls to nummerical destinations
 #
 
 # ------------------ module loading ----------------------------------
 
8a79b963
 #set module path
f41e32d6
 mpath="/usr/local/lib/kamailio/modules/"
8a79b963
 
 loadmodule "tm.so"
 loadmodule "acc.so"
 loadmodule "sl.so"
 loadmodule "maxfwd.so"
 loadmodule "rr.so"
91301510
 
 # ----------------- 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
 modparam("acc", "log_flag", 1 )
 
 # -------------------------  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");
8a79b963
 		exit;
91301510
 	};
8a79b963
 	if (msg:len >=  2048 ) {
 		sl_send_reply("513", "Message too big");
 		exit;
91301510
 	};
 
     #  Process record-routing
8a79b963
     if (loose_route()) { 
 		# label BYEs for accounting
 		if (method=="BYE") 
 			setflag(1);
 		t_relay();
 		exit;
 	};
91301510
 
 
 	# labeled all transaction for accounting
 	setflag(1);
 
 	# record-route INVITES to make sure BYEs will visit our server too
 	if (method=="INVITE") record_route();
 
 	# 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(); 
8a79b963
 		exit; 
91301510
 	};
 
 }