Browse code

- updates

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@334 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 27/10/2005 19:58:01
Showing 2 changed files
... ...
@@ -6,9 +6,9 @@
6 6
 
7 7
 # ----------- global configuration parameters ------------------------
8 8
 
9
-#debug=3            # debug level (cmd line: -dddddddddd)
10
-#fork=yes
11
-#log_stderror=no	# (cmd line: -E)
9
+debug=3            # debug level (cmd line: -dddddddddd)
10
+fork=yes
11
+log_stderror=no    # (cmd line: -E)
12 12
 
13 13
 /* Uncomment these lines to enter debugging mode 
14 14
 fork=no
... ...
@@ -18,8 +18,8 @@ log_stderror=yes
18 18
 check_via=no	# (cmd. line: -v)
19 19
 dns=no          # (cmd. line: -r)
20 20
 rev_dns=no      # (cmd. line: -R)
21
-#port=5060
22
-#children=4
21
+port=5060
22
+children=4
23 23
 fifo="/tmp/openser_fifo"
24 24
 
25 25
 # ------------------ module loading ----------------------------------
... ...
@@ -74,19 +74,20 @@ route{
74 74
 	# max_forwards==0, or excessively long requests
75 75
 	if (!mf_process_maxfwd_header("10")) {
76 76
 		sl_send_reply("483","Too Many Hops");
77
-		return;
77
+		exit;
78 78
 	};
79
+
79 80
 	if (msg:len >=  2048 ) {
80 81
 		sl_send_reply("513", "Message too big");
81
-		return;
82
+		exit;
82 83
 	};
83
-	
84 84
 
85 85
 	# we record-route all messages -- to make sure that
86 86
 	# subsequent messages will go through our proxy; that's
87 87
 	# particularly good if upstream and downstream entities
88 88
 	# use different transport protocol
89
-	if (!method=="REGISTER") record_route();	
89
+	if (!method=="REGISTER")
90
+		record_route();
90 91
 
91 92
 	# subsequent messages withing a dialog should take the
92 93
 	# path determined by record-routing
... ...
@@ -94,14 +95,12 @@ route{
94 95
 		# mark routing logic in request
95 96
 		append_hf("P-hint: rr-enforced\r\n"); 
96 97
 		route(1);
97
-		return;
98 98
 	};
99 99
 
100 100
 	if (!uri==myself) {
101 101
 		# mark routing logic in request
102 102
 		append_hf("P-hint: outbound\r\n"); 
103 103
 		route(1);
104
-		return;
105 104
 	};
106 105
 
107 106
 	# if the request is for other domain use UsrLoc
... ...
@@ -111,39 +110,40 @@ route{
111 110
 
112 111
 		if (method=="REGISTER") {
113 112
 
114
-# Uncomment this if you want to use digest authentication
115
-#			if (!www_authorize("openser.org", "subscriber")) {
116
-#				www_challenge("openser.org", "0");
117
-#				return;
118
-#			};
113
+			# Uncomment this if you want to use digest authentication
114
+			#if (!www_authorize("openser.org", "subscriber")) {
115
+			#	www_challenge("openser.org", "0");
116
+			#	exit;
117
+			#};
119 118
 
120 119
 			save("location");
121
-			return;
120
+			exit;
122 121
 		};
123 122
 
124 123
 		lookup("aliases");
125 124
 		if (!uri==myself) {
126 125
 			append_hf("P-hint: outbound alias\r\n"); 
127 126
 			route(1);
128
-			return;
129 127
 		};
130 128
 
131 129
 		# native SIP destinations are handled using our USRLOC DB
132 130
 		if (!lookup("location")) {
133 131
 			sl_send_reply("404", "Not Found");
134
-			return;
132
+			exit;
135 133
 		};
134
+		append_hf("P-hint: usrloc applied\r\n"); 
136 135
 	};
137
-	append_hf("P-hint: usrloc applied\r\n"); 
136
+
138 137
 	route(1);
139 138
 }
140 139
 
141
-route[1] 
142
-{
140
+
141
+route[1] {
143 142
 	# send it out now; use stateful forwarding as it works reliably
144 143
 	# even for UDP2TCP
145 144
 	if (!t_relay()) {
146 145
 		sl_reply_error();
147 146
 	};
147
+	exit;
148 148
 }
149 149
 
... ...
@@ -2,11 +2,6 @@
2 2
 #
3 3
 # $Id$
4 4
 #
5
-#
6
-# 3w-xxxx:      Starts the sip_router process
7
-#
8
-# Version:      @(#) /etc/rc.d/init.d/3w-xxxx
9
-#
10 5
 # chkconfig: 2345 20 80
11 6
 # description: controls execution of SIP router
12 7
 # processname: openser
... ...
@@ -24,9 +19,7 @@ OSRDIR=/usr/local/sbin
24 19
 OSRWDIR=/var/tmp
25 20
 ETC=/usr/local/etc/openser/openser.cfg
26 21
 PIDFILE=/var/run/openser.pid
27
-NOTIFY=team@openser.org
28
-USR=510
29
-GRP=510
22
+#NOTIFY=alert@mycompany.com
30 23
 
31 24
 MONIT=/usr/local/bin/monit
32 25
 MONITRC=/usr/local/etc/monitrc
... ...
@@ -45,10 +38,10 @@ openser_start() {
45 38
 		NEWCORE=$OSRWDIR/core.$DATE
46 39
 		mv $CORE $NEWCORE
47 40
 		echo core stored in $NEWCORE >> $TMP
48
-		gdb $BIN $NEWCORE -x test/bt.gdb -batch >> $TMP
41
+		#gdb $BIN $NEWCORE -x test/bt.gdb -batch >> $TMP
49 42
 		chmod a+r $NEWCORE
50 43
 		cd $OSRDIR; tar czf $OSRWDIR/openser.$DATE.tgz .
51
-		mail -s "openser core found" $NOTIFY < $TMP
44
+		#mail -s "openser core found" $NOTIFY < $TMP
52 45
 		rm -f $TMP
53 46
 	fi
54 47
 	cd $OSRWDIR
... ...
@@ -67,46 +60,46 @@ openser_stop() {
67 60
 }
68 61
 
69 62
 monit_start() {
70
-   echo "Command Monit to start OpenSER..."
71
-   ${MONIT} -c ${MONITRC} start openser
72
-   RETVAL=$?
73
-   echo
63
+	echo "Command Monit to start OpenSER..."
64
+	${MONIT} -c ${MONITRC} start openser
65
+	RETVAL=$?
66
+	echo
74 67
 }
75 68
 
76 69
 monit_stop() {
77
-   echo "Command Monit to stop OpenSER..."
78
-   ${MONIT} -c ${MONITRC} stop openser
79
-   RETVAL=$?
80
-   echo
70
+	echo "Command Monit to stop OpenSER..."
71
+	${MONIT} -c ${MONITRC} stop openser
72
+	RETVAL=$?
73
+	echo
81 74
 }
82 75
 
83 76
 # See how we were called.
84 77
 case "$1" in
85
-  openserstart)
86
-	openser_start
87
-	;;
88
-  openserstop)
89
-    openser_stop
90
-	;;
91
-  openserrestart)
92
-	openser_stop
93
-	echo
94
-	openser_start
95
-	;;
96
-  start)
97
-    monit_start
98
-	;;
99
-  stop)
100
-    monit_stop
78
+	openserstart)
79
+		openser_start
80
+		;;
81
+	openserstop)
82
+		openser_stop
83
+		;;
84
+	openserrestart)
85
+		openser_stop
86
+		echo
87
+		openser_start
88
+		;;
89
+	start)
90
+		monit_start
101 91
 	;;
102
-  restart)
103
-	monit_stop
104
-	sleep 1
105
-	monit_start
92
+	stop)
93
+		monit_stop
106 94
 	;;
107
-  *)
108
-	echo "Usage: $0 {start|stop|restart}"
109
-	exit 1
95
+	restart)
96
+		monit_stop
97
+		sleep 1
98
+		monit_start
99
+		;;
100
+	*)
101
+		echo "Usage: $0 {start|stop|restart|openserstart|openserstop|openserrestart}"
102
+		exit 1
110 103
 esac
111 104
 
112 105
 exit $RETVAL