loadmodule "tm/tm.so"
loadmodule "sl/sl.so"
loadmodule "db_mysql/db_mysql.so"
loadmodule "usrloc/usrloc.so"
loadmodule "registrar/registrar.so"
loadmodule "pike/pike.so"
loadmodule "xlog/xlog.so"

modparam("usrloc", "db_mode", 3)
modparam("usrloc", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")

modparam("pike", "sampling_time_unit", 5)
modparam("pike", "reqs_density_per_unit", 25)
modparam("pike", "remove_latency", 5)
modparam("pike", "pike_log_level", 2)
 
route{
	if (!pike_check_req()) {
		xlog("drop request");
		sl_send_reply("500", "overloaded");
	}

	if(!lookup ("location")){
		sl_send_reply("404", "Not Found");
	}

	if (!t_relay()) {
		sl_reply_error();
	}
}
