Browse code

added handling of gateway address in URI

Jiri Kuthan authored on 06/03/2002 22:23:04
Showing 1 changed files
... ...
@@ -40,21 +40,20 @@ route{
40 40
         # Do strict routing if route headers present
41 41
 	rewriteFromRoute();
42 42
 
43
-	# fix Cisco's bug in PRACK processing; at least don't bother ser's
44
-	# stateful processing with that and process it statelessly
45
-	if (method=="PRACK") {
46
-		forward( uri:host, uri:port );
47
-		log("that's PRACK");
48
-		break;
49
-	};
50
-
51 43
 	# divert voicemail requests
52 44
         if (uri=~"mail\.iptel\.org" | uri=~":6060") {
53 45
 		log("Request is for voicemail\n");
54 46
 		forward("fox.iptel.org", 6060);
55 47
 	} else {
56
-		# process requests for iptel.org
57
-		if (uri=~"iptel\.org" | uri=~"195\.37\.77\.101") {
48
+		# process requests for iptel.org (note the wildcard in
49
+		# the regex end -- that captures URIs which have port
50
+		# numbers or parameters in them); also include gateway
51
+		# here too -- we RR to the gateway which means that its
52
+		# address shows up in d-uri of subsequent requests after
53
+		# having called rewriteFromRoute and we want the requests
54
+		# to go through our PSTN authorization code
55
+		if (uri=~"@iptel\.org([;:].*)*" | uri=~"@195\.37\.77\.101([;:].*)*" |
56
+			uri=~"@195.37.77.110([;:].*)*" ) {
58 57
 			log("Request is for iptel.org\n");	
59 58
 
60 59
 			# registers always MUST be authenticated to
... ...
@@ -136,6 +135,7 @@ route{
136 135
 			# outbound requests are allowed only for our users -- we don't
137 136
 			# support relaying and don't like strangers bothering us
138 137
 			# with resolving DNS
138
+			log("that's a request to outside");
139 139
 			if (!(src_ip==195.37.77.110) & !(authorize("iptel.org"))) {
140 140
 				challenge("iptel.org");
141 141
 				break;