#memlog=1
debug=1
children=1

loadmodule "tm/tm.so"
loadmodule "sl/sl.so"
loadmodule "db_mysql/db_mysql.so"
loadmodule "usrloc/usrloc.so"
loadmodule "registrar/registrar.so"
loadmodule "pv/pv.so"
loadmodule "avpops/avpops.so"
loadmodule "mi_fifo/mi_fifo.so"
loadmodule "xlog/xlog.so"

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

modparam("avpops","avp_table","usr_preferences")
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

route{
	$avp(s:10) = "foobar";
	if (!avp_db_load("$avp(s:10)", "$avp(s:679)")) {
		xlog("avp_db_load failed");
		sl_reply_error();
		exit;
	}
	
	$avp(s:679) = "blafasel";
	if (!avp_db_store("$avp(s:10)", "$avp(s:679)")) {
		xlog("avp_db_store failed");
		sl_reply_error();
		exit;
	}

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

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