瀏覽代碼

added handling of gateway address in URI

Jiri Kuthan 23 年之前
父節點
當前提交
0d665e7891
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      iptel.cfg

+ 10 - 10
iptel.cfg

@@ -40,21 +40,20 @@ route{
         # Do strict routing if route headers present
 	rewriteFromRoute();
 
-	# fix Cisco's bug in PRACK processing; at least don't bother ser's
-	# stateful processing with that and process it statelessly
-	if (method=="PRACK") {
-		forward( uri:host, uri:port );
-		log("that's PRACK");
-		break;
-	};
-
 	# divert voicemail requests
         if (uri=~"mail\.iptel\.org" | uri=~":6060") {
 		log("Request is for voicemail\n");
 		forward("fox.iptel.org", 6060);
 	} else {
-		# process requests for iptel.org
-		if (uri=~"iptel\.org" | uri=~"195\.37\.77\.101") {
+		# process requests for iptel.org (note the wildcard in
+		# the regex end -- that captures URIs which have port
+		# numbers or parameters in them); also include gateway
+		# here too -- we RR to the gateway which means that its
+		# address shows up in d-uri of subsequent requests after
+		# having called rewriteFromRoute and we want the requests
+		# to go through our PSTN authorization code
+		if (uri=~"@iptel\.org([;:].*)*" | uri=~"@195\.37\.77\.101([;:].*)*" |
+			uri=~"@195.37.77.110([;:].*)*" ) {
 			log("Request is for iptel.org\n");	
 
 			# registers always MUST be authenticated to
@@ -136,6 +135,7 @@ route{
 			# outbound requests are allowed only for our users -- we don't
 			# support relaying and don't like strangers bothering us
 			# with resolving DNS
+			log("that's a request to outside");
 			if (!(src_ip==195.37.77.110) & !(authorize("iptel.org"))) {
 				challenge("iptel.org");
 				break;