瀏覽代碼

- fixed the cfg. files, added a new sip msg

Andrei Pelinescu-Onciul 24 年之前
父節點
當前提交
36a0a8eea6
共有 5 個文件被更改,包括 61 次插入9 次删除
  1. 2 2
      test/centauri.cfg
  2. 23 0
      test/invite1.sip
  3. 5 5
      test/mobile61.cfg
  4. 29 0
      test/test.cfg
  5. 2 2
      test/test1.cfg

+ 2 - 2
test/centauri.cfg

@@ -1,14 +1,14 @@
 # config file for centauri
 
 route{
- src_ip~="testing" log("packet from fokus\n"); route(1);
+ src_ip=~"testing" log("packet from fokus\n"); route(1);
 /* drop all others */
 
 }
 
 
 route[1]{
-	(src_ip==192.168.46.0/24 or src_ip~="^dorian") forward("fox.iptel.org");
+	(src_ip==192.168.46.0/24 or src_ip=~"^dorian") forward("fox.iptel.org");
 	src_ip=="centauri.fokus.gmd.de" log("Possible loop, dropping\n"); drop
 	src_ip==0.0.0.0/0 log("forwarding denied\n"); drop
 }

+ 23 - 0
test/invite1.sip

@@ -0,0 +1,23 @@
+INVITE sip:[email protected] SIP/2.0
+Via: SIP/2.0/UDP 193.175.133.193
+From: "GMD FOKUS iptlab" <sip:[email protected]>;tag=b96b0300ed30f1286-2f5d
+To: <sip:[email protected]>
+Call-ID: [email protected]
+CSeq: 101 INVITE
+Expires: 180
+User-Agent: Cisco-SIP-IP-Phone/2
+Accept: application/sdp
+Contact: sip:[email protected]:5060
+Content-Type: application/sdp
+Content-Length: 225
+
+
+v=0
+o=CiscoSystemsSIP-IPPhone-UserAgent 14474 8233 IN IP4 195.37.78.190
+s=SIP Call
+c=IN IP4 195.37.78.190
+t=0 0
+m=audio 18456 RTP/AVP 0 8 18 101
+a=rtpmap:0 pcmu/8000
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-11 

+ 5 - 5
test/mobile61.cfg

@@ -2,9 +2,9 @@
 
 route{
 
-	(src_ip~='(dorian)|(ekina)|(terix)' & method~='^inv') \
+	(src_ip=~'(dorian)|(ekina)|(terix)' & method=~'^inv') \
 				forward(centauri.fokus.gmd.de);
-	src_ip~="^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$"  \
+	src_ip=~"^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$"  \
 				log(1,"msg. from a private network\n"); route(1);
 	src_ip==0.0.0.0/0   log(1, " droping msg\n"); drop;
 }
@@ -16,8 +16,8 @@ route[1]{
 }
 
 route[2]{
-	(method~='^ACK' and uri~='.*fokus') forward("fox.iptel.org");
-	! method~='^INV' forward(193.175.135.179); /* dorian */
-	method~='.' log("spying...\n"); send(dorian,8000); \
+	(method=~'^ACK' and uri=~'.*fokus') forward("fox.iptel.org");
+	! method=~'^INV' forward(193.175.135.179); /* dorian */
+	method=~'.' log("spying...\n"); send(dorian,8000); \
 						forward("fox.iptel.org");
 }

+ 29 - 0
test/test.cfg

@@ -0,0 +1,29 @@
+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)
+log_stderror=yes # (cmd line: -E)
+# for more info: sip_router -h
+
+route{
+
+	(src_ip=~'(dorian)|(ekina)|(terix)' & method=~'^inv') \
+				forward(centauri.fokus.gmd.de);
+	src_ip=~"^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$"  \
+				log(1,"msg. from a private network\n"); route(1);
+	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;
+}
+
+route[1]{
+	src_ip==192.168.46.61  log("possible loop, dropping\n"); drop;
+	(src_ip==192.168.46.0/24) log("routing with rt2\n");route(2); log("we're back\n");
+	src_ip==0.0.0.0/0 log(1, "we'll drop this one too\n"); drop;
+}
+
+route[2]{
+	(method=~'^ACK' and uri=~'.*fokus') forward("fox.iptel.org");
+	! method=~'^INV' forward(193.175.135.179); /* dorian */
+	method=~'.' log("spying...\n"); send(dorian,8000); \
+						forward("fox.iptel.org");
+}

+ 2 - 2
test/test1.cfg

@@ -17,9 +17,9 @@ dns=true #comment on the same line
 
 route{
 	(method==invite and src_ip==1.2.3.4/32 or (src_ip==4.3.2.1 and src_ip==11.12.13.14/24) ) log("test log\n"); forward("ape");
-	( uri~="test\n" &  ! src_ip~="dorian") forward(dorian.fokus.gmd.de);
+	( uri=~"test\n" &  ! src_ip=~"dorian") forward(dorian.fokus.gmd.de);
 
-	(src_ip==192.168.0.0/255.255.0.0 or dst_ip==127.0.0.1 and uri~="s$") \
+	(src_ip==192.168.0.0/255.255.0.0 or dst_ip==127.0.0.1 and uri=~"s$") \
 		error("440","not forwarding"); log(2,"droping..."); drop;
 
 	src_ip==127.0.0.1 route(3); drop;