debug=9          # debug level (cmd line: -dddddddddd)
check_via=1      # (cmd. line: -v)
dns=on           # (cmd. line: -r)
rev_dns=yes      # (cmd. line: -R)
fork=no          # (cmd. line: -D)
fork=yes
log_stderror=yes # (cmd line: -E)
fifo=/tmp/ser_fifo
# for more info: sip_router -h


route{

	if false and forward("mobile69") { log("forwarded ok\n"); break; }
	else log("error forwarding\n");
	
	if false log("if\n")
	else log("else\n");
	
	if { log("test\n"); break; log("test2\n"); } log ("if {}");
	
	if (src_ip=~'(dorian)|(ekina)|(terix)' & method=~'^inv')
				forward(centauri.fokus.gmd.de);
	if src_ip=~"^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$" {
			log(1,"msg. from a private network\n");
			route(1);
			log(1, "after route(1)\n");
			break;
	};
	if src_ip==0.0.0.0/0 {
		setuserpass("andrei:test");
		log(1, " test msg\n"); forward(192.168.46.55);
		setuser("foo");sethostport("bar.com:6000");
		forward(192.168.46.69);drop;
	};
	log("default route[0]\n");
}

route[1]{
	if src_ip==192.168.46.61 { log("possible loop, dropping\n"); drop; };
	if (src_ip==192.168.46.0/24) { 
			log("routing with rt2\n");route(2); log("we're back\n");
			break;
	};
	if src_ip==0.0.0.0/0 { log(1, "we'll drop this one too\n"); drop; };
	log("default route[1]\n");
}

route[2]{
	if (method=~'^ACK' and uri=~'.*fokus') forward("fox.iptel.org");
	if ! method=~'^INV' forward(193.175.135.179); /* dorian */
	if method=~'.' { log("spying...\n"); send(dorian,8000);/* raw sip packet */
						forward("fox.iptel.org");
					};
	log("default route[2]\n");
}
