Prechádzať zdrojové kódy

cebit finalizations

Jiri Kuthan 23 rokov pred
rodič
commit
5d58738e45
1 zmenil súbory, kde vykonal 28 pridanie a 14 odobranie
  1. 28 14
      iptel.cfg

+ 28 - 14
iptel.cfg

@@ -4,17 +4,14 @@
 # $Id$
 #
 
-### USRLOC is temporarily commented out as we need forking
-### for Cebit Demo; seek ###XXX
-
-
 debug=9          # debug level (cmd line: -dddddddddd)
-fork=no
+fork=yes
 log_stderror=yes	# (cmd line: -E)
 check_via=yes     # (cmd. line: -v)
 dns=on           # (cmd. line: -r)
 rev_dns=yes      # (cmd. line: -R)
-port=5040
+port=5060
+children=1
 
 # advertise IP address in Via (as opposed to advertising DNS name
 # which is annoying for downstream servers and some phones can
@@ -33,6 +30,15 @@ loadmodule "modules/auth/auth.so"
 
 route{
 
+	# special measure for cebit ... relay all traffic
+	# for 'cebit' to CSPS as it is able of forking
+	# which we can't handle yet
+	if (uri=~"sip:cebit@") {
+		forward("fox.iptel.org", 5061 );
+		break;
+	};
+
+
 
 	# filter local stateless ACK generated by authentication of mf replies
 	sl_filter_ACK();
@@ -73,10 +79,17 @@ route{
                     			challenge("iptel.org");
 					break;
 				};
+				# prohibit attempts to grab someone else's address 
+				# using someone else's valid credentials
+				if (!check_to()) {
+					log("Cheating attempt\n");
+					sl_send_reply("403", "What a nasty guy you are");
+					break;
+				};
+					
 				# update Contact database
 	        		log("REGISTER is authorized, saving location\n");
-				###XXX save_contact("location");
-				forward( 195.37.77.101, 5061 );
+				save_contact("location");
 				break;
 			};
 
@@ -134,14 +147,13 @@ route{
 				rewritehostport("195.37.77.110:5060");
 			} else {
 				
-				forward( 195.37.77.101, 5061 );
 
 				# native SIP destinations are handled using our USRLOC DB
-				###XXX if (!lookup_contact("location")) {
-				###XXX		log("Unable to lookup contact, sending 404\n");
-				###XXX		sl_send_reply("404", "Not Found");
-				###XXX		break;
-				###XXX};
+				if (!lookup_contact("location")) {
+						log("Unable to lookup contact, sending 404\n");
+						sl_send_reply("404", "Not Found");
+						break;
+				};
 			};
                 } else {
 			# outbound requests are allowed only for our users -- we don't
@@ -152,6 +164,8 @@ route{
 				challenge("iptel.org");
 				break;
 			};
+			# there should be check_from here too -- but I'm to tired
+			# to test it tonight
 		};
 
 		# we now know we may, we now where, let it go out now!