Browse code

tools obsoleted by sc

Jiri Kuthan authored on 12/06/2002 23:31:04
Showing 5 changed files
1 1
deleted file mode 100755
... ...
@@ -1,25 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# $Id$
4
-#
5
-# delete a user's UsrLoc entries
6
-#
7
-
8
-USER_COLUMN='user'
9
-SUBSCRIBER_COLUMN='user_id'
10
-QUERY="delete from location where location.user='$1'"
11
-
12
-# username of a valid MySql user
13
-USER='csps'
14
-
15
-if [ $# -ne 1 ] ; then
16
-	echo "usage: $0 <username>"
17
-	exit 1
18
-fi
19
-
20
-#ps  -wwwwww -o "drs,pid,user,group,euser,egroup,fuser,fgroup,args" -C sr 
21
-
22
-
23
-mysql -h dbhost -u $USER "-p" -e "$QUERY ;" csps107
24
-
25
-echo $?
... ...
@@ -16,7 +16,7 @@ dns=on           # (cmd. line: -r)
16 16
 rev_dns=yes      # (cmd. line: -R)
17 17
 port=5060
18 18
 #port=8060
19
-children=1
19
+children=16
20 20
 
21 21
 # advertise IP address in Via (as opposed to advertising DNS name
22 22
 # which is annoying for downstream servers and some phones can
... ...
@@ -27,7 +27,7 @@ listen=195.37.77.101
27 27
 
28 28
 loadmodule "../sip_router/modules/sl/sl.so"
29 29
 loadmodule "../sip_router/modules/print/print.so"
30
-loadmodule "../sip_router/modules/tm/tm.so"
30
+#loadmodule "../sip_router/modules/tm/tm.so"
31 31
 loadmodule "../sip_router/modules/acc/acc.so"
32 32
 loadmodule "../sip_router/modules/rr/rr.so"
33 33
 loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
... ...
@@ -196,9 +196,9 @@ route{
196 196
 		log("Request is for voicemail\n");
197 197
 		sethost("iptel.org");
198 198
 #		t_relay_to("fox.iptel.org", "5066");
199
-		t_relay_to("fox.iptel.org", "6060");
200
-#XX
201
-# { sl_reply_error(); break; }
199
+		if ( !t_relay_to("fox.iptel.org", "6060")) {
200
+			sl_reply_error();
201
+		};
202 202
 		break;
203 203
 	};
204 204
 
... ...
@@ -222,6 +222,7 @@ route{
222 222
 	# here we continue with requests for our domain...
223 223
 
224 224
 	# various aliases (might use a database in future)
225
+#XX
225 226
 #	lookup_contact("aliases");
226 227
 	if (uri=~"sip:9040@") {
227 228
 		seturi("sip:jiri@iptel.org");
... ...
@@ -258,6 +259,9 @@ route{
258 258
 		# using  valid credentials; the only exception is the user
259 259
 		# 'replciator' permitted to generate 3-rd party registrations
260 260
 
261
+##XX allow REGISTERs without authentication from localhost
262
+
263
+		if (! src_ip==195.37.77.101 ) {
261 264
 
262 265
 		if (!www_authorize(	"iptel.org" /* realm */, 
263 266
 			 				"subscriber" /* table name */ )) {
... ...
@@ -272,6 +276,9 @@ route{
272 272
 			sl_send_reply("403", "That is ugly -- use To=id next time");
273 273
 			break;
274 274
 		};
275
+
276
+#XX
277
+		};
275 278
 			
276 279
 
277 280
 		# update Contact database
... ...
@@ -327,9 +334,9 @@ route{
327 327
 
328 328
 		t_fork_on_no_response("sip:cebit@mail.iptel.org");
329 329
 	
330
-		t_relay();
331
-#XX
332
-#{ sl_reply_error(); break; }
330
+		if (!t_relay()) {
331
+			sl_reply_error();
332
+		};
333 333
 		break;
334 334
 	};
335 335
 	# ---------- forking demo2 - end  --------------
... ...
@@ -359,9 +366,10 @@ route{
359 359
 	};
360 360
 
361 361
 	# we now know we may, we know where, let it go out now!
362
-	t_relay();
363
-#XX
364
-#{ sl_reply_error(); break; }
362
+	if (!t_relay()) {
363
+		sl_reply_error();
364
+		break;
365
+	};
365 366
 }
366 367
 
367 368
 # routing logic for outbound requests targeted out of our domain
... ...
@@ -370,6 +378,8 @@ route[2] {
370 370
 		# support relaying and don't like strangers bothering us
371 371
 		# with resolving DNS
372 372
 		log("LOG: that's a request to outside");
373
+#XX (allow unauthenticated requests from localhost for testing)
374
+		if (! src_ip==195.37.77.101 ) {
373 375
 		if (!(src_ip==195.37.77.110) & 
374 376
 			!(proxy_authorize(	"iptel.org" /* realm */,
375 377
 							"subscriber" /* table name */ ))) {
... ...
@@ -392,10 +402,13 @@ route[2] {
392 392
 			sl_send_reply("403", "That is ugly -- use From=id next time");
393 393
 			break;
394 394
 		};
395
-
396
-		t_relay();
397 395
 #XX
398
-#{ sl_reply_error(); break; }
396
+		};
397
+
398
+		if (!t_relay()) {
399
+			sl_reply_error();
400
+			break;
401
+		};
399 402
 }
400 403
 
401 404
 # logic for calls through our PSTN gateway
... ...
@@ -482,9 +495,10 @@ route[3] {
482 482
 	rewritehostport("195.37.77.110:5060");
483 483
 
484 484
 
485
-	t_relay();
486
-#XX
487
-#{ sl_reply_error(); break; }
485
+	if (!t_relay()) {
486
+		sl_reply_error(); 
487
+		break; 
488
+	};
488 489
 }
489 490
 
490 491
 /*
491 492
deleted file mode 100755
... ...
@@ -1,34 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# $Id$
4
-#
5
-# check current status of ser: print running processes and
6
-# -- if in possession of MySql password -- dump USRLOC database
7
-# as well
8
-
9
-USER_COLUMN='user'
10
-SUBSCRIBER_COLUMN='user_id'
11
-QUERY='select location.*, subscriber.email_address from location, subscriber where subscriber.user_id=location.user'
12
-
13
-# username and password of a valid MySql user, preferably only with read-only
14
-# privilegs
15
-USER="serro"
16
-PASSWORD="47serro11"
17
-
18
-if [ $# -gt 1 ] ; then
19
-	echo "usage: $0 [username]"
20
-	exit 1
21
-elif [ $# -eq 1 ] ; then
22
-	QUERY="$QUERY AND subscriber.user_id='$1' "
23
-fi
24
-
25
-PIDS=`ps --no-headers -o "pid" -C sr`
26
-for i in $PIDS ;  do
27
-	ps -o "pid,user,group,euser,egroup,fuser,fgroup,args" $i
28
-	echo "WD: `ls -ld /proc/$i/cwd`"
29
-done
30
-
31
-#ps  -wwwwww -o "drs,pid,user,group,euser,egroup,fuser,fgroup,args" -C sr 
32
-
33
-
34
-mysql -h dbhost -u $USER "-p$PASSWORD" -e "$QUERY ;" csps107
35 1
deleted file mode 100755
... ...
@@ -1,28 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# $Id$
4
-#
5
-# show user information: email and UsrLoc entries if any;
6
-# if no parameter is given, all on-line users are shown
7
-#
8
-
9
-USER_COLUMN='user'
10
-SUBSCRIBER_COLUMN='user_id'
11
-QUERY1="select subscriber.email_address from subscriber where  subscriber.user_id='$1'"
12
-QUERY2="select location.* from location where location.user='$1' order by expires desc"
13
-QUERY3="select location.user, subscriber.email_address from subscriber, location where  subscriber.user_id=location.user"
14
-
15
-# username and password of a valid MySql user, preferably only with read-only
16
-# privilegs
17
-USER='serro'
18
-PASSWORD='47serro11'
19
-
20
-if [ $# -eq 1 ] ; then
21
-	mysql -h dbhost -u $USER "-p$PASSWORD" -e "$QUERY1 ;" csps107
22
-	mysql -h dbhost -u $USER "-p$PASSWORD" -e "$QUERY2 ;" csps107
23
-else
24
-	mysql -h dbhost -u $USER "-p$PASSWORD" -e "$QUERY3 ;" csps107
25
-fi
26
-
27
-
28
-
... ...
@@ -9,7 +9,7 @@
9 9
 #
10 10
 # chkconfig: 2345 20 80
11 11
 # description: controls execution of SIP router
12
-# processname: sip_router
12
+# processname: sr
13 13
 # config: /etc/sip_router.cfg
14 14
 
15 15
 # Source function library.