2
0
Эх сурвалжийг харах

*** empty log message ***

Bogdan-Andrei Iancu 23 жил өмнө
parent
commit
2872c0044c
5 өөрчлөгдсөн 90 нэмэгдсэн , 4 устгасан
  1. 1 2
      Makefile
  2. 84 0
      etc/mobile66.cfg
  3. 2 1
      forward.c
  4. 2 0
      msg_translator.c
  5. 1 1
      test/th-uri.cfg

+ 1 - 2
Makefile

@@ -10,8 +10,7 @@ auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
 #include  source related defs
 #include  source related defs
 include Makefile.sources
 include Makefile.sources
 
 
-exclude_modules=CVS mysql 
-#auth rr
+exclude_modules=CVS mysql auth cpl im sms jabber acc pike tm
 static_modules=
 static_modules=
 static_modules_path=$(addprefix modules/, $(static_modules))
 static_modules_path=$(addprefix modules/, $(static_modules))
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))

+ 84 - 0
etc/mobile66.cfg

@@ -0,0 +1,84 @@
+#
+# $Id$
+#
+# iptel.org real world configuration
+#
+
+# ----------- global configuration parameters ------------------------
+
+debug=9          # debug level (cmd line: -dddddddddd)
+fork=yes
+children=2
+#log_stderror=no	# (cmd line: -E)
+log_stderror=yes	# (cmd line: -E)
+check_via=yes     # (cmd. line: -v)
+dns=on           # (cmd. line: -r)
+rev_dns=yes      # (cmd. line: -R)
+port=5060
+#listen=192.168.57.66
+#listen=192.168.50.66
+#listen=3ffe:400:190:50:201:2ff:fedd:5050
+listen=3ffe:400:190:56:201:2ff:fedd:52b5
+
+# ------------------ module loading ----------------------------------
+
+loadmodule "modules/sl/sl.so"
+loadmodule "modules/print/print.so"
+loadmodule "modules/maxfwd/maxfwd.so"
+loadmodule "modules/usrloc/usrloc.so"
+
+# ----------------- setting module-specific parameters ---------------
+
+# -- usrloc params --
+modparam("usrloc", "use_database",   0)
+
+# -------------------------  request routing logic -------------------
+
+# main routing logic
+
+route{
+	# filter local stateless ACK generated by authentication of mf replies
+	sl_filter_ACK();
+
+	# filter too old messages
+	log("LOG: Checking maxfwd\n");
+	if (!mf_process_maxfwd_header("10")) {
+		log("LOG: Too many hops\n");
+		sl_send_reply("483","Too Many Hops");
+		break;
+	};
+	
+	# sign of our domain: there is @ (username), :
+    	# (nothing) or . (host) in front of our domain name	
+	if (!(uri=~"[@:\.]lugduf-1\.mobis\.ip6([;:].*)*")) {
+		route(2);
+		# break from route (2) return -- stop then !
+		break;
+	};
+	# here we continue with requests for our domain...
+
+	if (method=="REGISTER") {
+		log("LOG Request is REGISTER\n");
+		# update Contact database
+       		log("LOG: REGISTER -> saving location\n");
+		save_contact("location");
+		break;
+	};
+
+        # native SIP destinations are handled using our USRLOC DB
+	if (!lookup_contact("location")) {
+		if (method=="ACK") {
+			log("Ooops -- an ACK made it here -- probably UAC screwed up to-tags\n");
+			break;
+		};
+		log("LOG: Unable to lookup contact, sending 404\n");
+		sl_send_reply("404", "Not Found");
+		break;
+	};
+	forward(uri:host,uri:port);
+}
+
+# routing logic for outbound requests targeted out of our domain
+route[2] {
+	forward("xhosa.mobis.ip6",5060);
+}

+ 2 - 1
forward.c

@@ -194,6 +194,7 @@ int forward_reply(struct sip_msg* msg)
 	
 	
 	to=0;
 	to=0;
 	new_buf=0;
 	new_buf=0;
+#ifdef Bogdan
 	/*check if first via host = us */
 	/*check if first via host = us */
 	if (check_via){
 	if (check_via){
 		for (r=0; r<sock_no; r++)
 		for (r=0; r<sock_no; r++)
@@ -208,7 +209,7 @@ int forward_reply(struct sip_msg* msg)
 			goto error;
 			goto error;
 		}
 		}
 	}
 	}
-
+#endif
 	/* quick hack, slower for mutliple modules*/
 	/* quick hack, slower for mutliple modules*/
 	for (mod=modules;mod;mod=mod->next){
 	for (mod=modules;mod;mod=mod->next){
 		if ((mod->exports) && (mod->exports->response_f)){
 		if ((mod->exports) && (mod->exports->response_f)){

+ 2 - 0
msg_translator.c

@@ -56,6 +56,7 @@ int check_address(struct ip_addr* ip, char *name, int resolver)
 	struct hostent* he;
 	struct hostent* he;
 	int i;
 	int i;
 
 
+	return 0;
 	/* maybe we are lucky and name it's an ip */
 	/* maybe we are lucky and name it's an ip */
 	if (strcmp(name, ip_addr2a(ip))==0)
 	if (strcmp(name, ip_addr2a(ip))==0)
 		return 0;
 		return 0;
@@ -312,6 +313,7 @@ char * build_req_buf_from_sip_req( struct sip_msg* msg,
 	/* check if received needs to be added */
 	/* check if received needs to be added */
 	backup = msg->via1->host.s[msg->via1->host.len];
 	backup = msg->via1->host.s[msg->via1->host.len];
 	msg->via1->host.s[msg->via1->host.len] = 0;
 	msg->via1->host.s[msg->via1->host.len] = 0;
+	DBG("!!!!!!!!-> len=%d backup=%d[%c]\n",msg->via1->host.len,backup,backup);
 	if (check_address(&msg->src_ip, msg->via1->host.s, received_dns)!=0){
 	if (check_address(&msg->src_ip, msg->via1->host.s, received_dns)!=0){
 		if ((received_buf=received_builder(msg,&received_len))==0)
 		if ((received_buf=received_builder(msg,&received_len))==0)
 			goto error;
 			goto error;

+ 1 - 1
test/th-uri.cfg

@@ -38,7 +38,7 @@ modparam("sms","modems","Falcom [d=/dev/ttyS1;b=9600;p=9254;m=new;l=10;r=2] ")
 modparam("sms","networks","D1[c=491710765000;m=10]")
 modparam("sms","networks","D1[c=491710765000;m=10]")
 modparam("sms","links","Falcom[D1]")
 modparam("sms","links","Falcom[D1]")
 #modparam("sms","domain","fesarius.fokus.gmd.de")
 #modparam("sms","domain","fesarius.fokus.gmd.de")
-modparam("sms","max_sms_parts",2)
+modparam("sms","max_sms_parts",3)
 
 
 #modparam("pike","timeout",30)
 #modparam("pike","timeout",30)