debug=9          # debug level (cmd line: -dddddddddd)
#fork=yes          # (cmd. line: -D)
fork=no
log_stderror=yes  # (cmd line: -E)
#log_stderror=no   # (cmd line: -E)


children=2
check_via=no      # (cmd. line: -v)
dns=off           # (cmd. line: -r)
rev_dns=off       # (cmd. line: -R)
#port=5070
#listen=10.0.0.179
#listen=192.168.57.33
loop_checks=0
# for more info: sip_router -h

#modules
loadmodule "modules/print/print.so"
loadmodule "modules/textops/textops.so"
#loadmodule "modules/tm/tm.so"
#loadmodule "modules/rr/rr.so"
loadmodule "modules/maxfwd/maxfwd.so"
loadmodule "modules/sl/sl.so"
#loadmodule "modules/sms/sms.so"
#loadmodule "modules/cpl/cpl.so"
loadmodule "modules/ext/ext.so"


#modparam("sms","modems","Falcom [d=/dev/ttyS1;b=9600;p=9254;m=new;l=10;r=2] ")
#modparam("sms","networks","D1[c=491710765000;m=10]")
#modparam("sms","links","Falcom[D1]")
#modparam("sms","domain","hope.fokus.gmd.de")
#modparam("sms","max_sms_parts",3)
#modparam("sms","use_contact",1)

#modparam("pike","timeout",30)

route{
	sl_filter_ACK();

	if ( !mf_process_maxfwd_header("10") )
	{
		sl_send_reply("483","To Many Hops");
		drop();
	};

	/*
	if (uri=~"sip:([0-9]+@)?fesarius\.fokus\.gmd\.de")
	{
		if (uri=~"sip:1@") {
			seturi("sip:491756078181@fesarius.fokus.gmd.de");
		};
		if (method=="MESSAGE")
		{
			log("MESSAGE received -> sending as sms\n");
			if (sms_send_msg_to_net("D1"))
			{
				sl_send_reply("200","Accepted");
			}else{
				sl_send_reply("502","Bad gateway");
			};
		}else{
			log("NON_Message request received for sms gateway->dropt!\n");
			sl_send_reply("501","Not implemented");
		};
		break;
	};*/

	ext_rewriteuri("./echo.pl");

#	pike_check_req();
	forward(uri:host,uri:port);
	#t_relay();
}