Browse code

core: relocated some folders from root and utils to misc

- utils keeps only the applications related to kamailio c code
- the other are now in misc/tools
- utils/misc/vim moved to misc/extra/
- obsolete and scripts folders moved to misc/

Daniel-Constantin Mierla authored on 07/12/2016 11:46:38
Showing 1 changed files
1 1
deleted file mode 100755
... ...
@@ -1,210 +0,0 @@
1
-#! /usr/bin/env python
2
-"""
3
- * $Id$
4
- *
5
- * Copyright (C) 2006 iptelorg GmbH
6
- *
7
- * This file is part of ser, a free SIP server.
8
- *
9
- * ser is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version
13
- *
14
- * For a license to use the ser software under conditions
15
- * other than those described here, or to purchase support for this
16
- * software, please contact iptel.org by e-mail at the following addresses:
17
- *    info@iptel.org
18
- *
19
- * ser is distributed in the hope that it will be useful,
20
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
- * GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with this program; if not, write to the Free Software
26
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
27
- *
28
-"""
29
-import sys,re
30
-
31
-max_depth = 120
32
-debug = 0
33
-
34
-re_main_route = re.compile("^([a-z]+_)*route[\s\t]*(?![\(\)])[\s\t]*\{?", re.I)
35
-re_def_route = re.compile("^([a-z]+_)*route(\[\"?([A-Za-z0-9-_:]+)\"?\])+[\s\t]*\{?", re.I)
36
-re_call_route = re.compile("^(.*\([\s\t!]*)?route\(\"?([A-Za-z0-9-_]+)\"?\)", re.I)
37
-routes = {}
38
-f_routes = {}
39
-b_routes = {}
40
-r_routes = {}
41
-s_routes = {}
42
-e_routes = {}
43
-
44
-
45
-def log(_s):
46
-	if debug:
47
-		print _s
48
-
49
-def print_route_level(_l, _n):
50
-	log("prl: %i, %s" % (_l, _n))
51
-	if _l > max_depth:
52
-		return
53
-	spacer = ""
54
-	route = ""
55
-	for i in range(_l):
56
-		spacer += "|  "
57
-		if i < _l - 1:
58
-			route += "|  "
59
-		else:
60
-			route += "\- " + str(_n)
61
-	if len(spacer) > 0:
62
-		print spacer
63
-	if len(route) > 0:
64
-		print route
65
-
66
-def traverse_routes(_level, _name):
67
-	log("tr: %i, %s" % (_level, _name))
68
-	if _level > max_depth:
69
-		print "warning: max_depth reached"
70
-		return
71
-	print_route_level(_level, _name)
72
-	if routes.has_key(_name):
73
-		for r in routes[_name]:
74
-			traverse_routes(_level + 1, r)
75
-
76
-
77
-if len(sys.argv) < 2:
78
-	raise "usage: %s configuration-file [max_depth]" % sys.argv[0]
79
-if len(sys.argv) == 3:
80
-	max_depth = int(sys.argv[2])
81
-cfg = file(sys.argv[1], "r")
82
-if cfg == None:
83
-	raise "Missing config file"
84
-line = cfg.readline()
85
-rt = routes
86
-while line:
87
-	line = line.strip()
88
-	if not line.startswith("#"):
89
-		log(line)
90
-		main_match = re_main_route.search(line)
91
-		def_match = re_def_route.search(line)
92
-		call_match = re_call_route.search(line)
93
-		if not call_match == None:
94
-			log("CALL: " + line)
95
-			name = call_match.group(2)
96
-			log(rname +":"+name)
97
-			rt[rname].append(name)
98
-		elif not def_match == None:
99
-			log("DEF: " + line)
100
-			rtype = def_match.group(1)
101
-			rname = def_match.group(3)
102
-			if rtype == "failure_":
103
-				rt = f_routes
104
-				if rname == None:
105
-					rname = "failure"
106
-			elif rtype == "onreply_":
107
-				rt = r_routes
108
-				if rname == None:
109
-					rname = "onreply"
110
-			elif rtype == "onsend_":
111
-				rt = s_routes
112
-				if rname == None:
113
-					rname = "onsend"
114
-			elif rtype == "branch_":
115
-				rt = b_routes
116
-				if rname == None:
117
-					rname = "branch"
118
-			elif rtype == "event_":
119
-				rt = e_routes
120
-				if rname == None:
121
-					rname = "event"
122
-			else:
123
-				rt = routes
124
-			log(rname)
125
-			rt[rname] = []
126
-		elif not main_match == None:
127
-			log("MAIN: " + line)
128
-			rtype = main_match.group(1)
129
-			if rtype == "failure_":
130
-				rt = f_routes
131
-				rname = "failure"
132
-			elif rtype == "onreply_":
133
-				rt = r_routes
134
-				rname = "onreply"
135
-			elif rtype == "onsend_":
136
-				rt = s_routes
137
-				rname = "onsend"
138
-			elif rtype == "branch_":
139
-				rt = b_routes
140
-				rname = "branch"
141
-			elif rtype == "event_":
142
-				rt = e_routes
143
-				rname = "event"
144
-			else:
145
-				rt = routes
146
-				rname = "Main"
147
-			log(rname)
148
-			rt[rname] = []
149
-	line = cfg.readline()
150
-
151
-log("routes: %s" % (routes))
152
-log("branch_routes: %s" % (b_routes))
153
-log("failure_routes: %s" % (f_routes))
154
-log("onreply_routes: %s" % (r_routes))
155
-log("onsend_routes: %s" % (s_routes))
156
-log("event_routes: %s" % (e_routes))
157
-
158
-for name in routes.keys():
159
-	for val in routes[name]:
160
-		if not routes.has_key(val):
161
-			print "Missing Route %s!!!" % val
162
-# checking for unreferenced routes does not work yet because functions
163
-# can call routes as well?!
164
-	#found = False
165
-	#for n in routes.keys():
166
-	#	for v in routes[n]:
167
-	#		if v == name:
168
-	#			found = True
169
-	#if not found and (not (name == "Main" or name == "Failure" or name == "Onreply" or name == "Branch")):
170
-	#	print "Unreferenced Route %s!!!" % name
171
-
172
-print "\nMain"
173
-traverse_routes(0, "Main")
174
-
175
-if len(b_routes) > 0:
176
-	print "\nBranch routes\n-------------"
177
-	for br in b_routes.keys():
178
-		print "\n%s" % (br)
179
-		for r in b_routes[br]:
180
-			traverse_routes(1, r)
181
-
182
-if len(s_routes) > 0:
183
-	print "\nSend routes\n-----------"
184
-	for sr in s_routes.keys():
185
-		print "\n%s" % (sr)
186
-		for r in s_routes[sr]:
187
-			traverse_routes(1, r)
188
-
189
-if len(f_routes) > 0:
190
-	print "\nFailure routes\n--------------"
191
-	for fr in f_routes.keys():
192
-		print "\n%s" % (fr)
193
-		for r in f_routes[fr]:
194
-			traverse_routes(1, r)
195
-
196
-if len(r_routes) > 0:
197
-	print "\nOnreply routes\n--------------"
198
-	for onr in r_routes.keys():
199
-		print "\n%s" % (onr)
200
-		for r in r_routes[onr]:
201
-			traverse_routes(1, r)
202
-
203
-if len(e_routes) > 0:
204
-	print "\nEvent routes\n--------------"
205
-	for onr in e_routes.keys():
206
-		print "\n%s" % (onr)
207
-		for r in e_routes[onr]:
208
-			traverse_routes(1, r)
209
-
210
-print
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@
23 23
  *
24 24
  * You should have received a copy of the GNU General Public License
25 25
  * along with this program; if not, write to the Free Software
26
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
27 27
  *
28 28
 """
29 29
 import sys,re
Browse code

utils/route_graph: increased max depth value

Daniel-Constantin Mierla authored on 12/03/2014 12:16:51
Showing 1 changed files
... ...
@@ -28,7 +28,7 @@
28 28
 """
29 29
 import sys,re
30 30
 
31
-max_depth = 10
31
+max_depth = 120
32 32
 debug = 0
33 33
 
34 34
 re_main_route = re.compile("^([a-z]+_)*route[\s\t]*(?![\(\)])[\s\t]*\{?", re.I)
Browse code

utils/route_graph: support for event route

Daniel-Constantin Mierla authored on 07/09/2010 18:46:22
Showing 1 changed files
... ...
@@ -32,13 +32,14 @@ max_depth = 10
32 32
 debug = 0
33 33
 
34 34
 re_main_route = re.compile("^([a-z]+_)*route[\s\t]*(?![\(\)])[\s\t]*\{?", re.I)
35
-re_def_route = re.compile("^([a-z]+_)*route(\[\"?([A-Za-z0-9-_]+)\"?\])+[\s\t]*\{?", re.I)
35
+re_def_route = re.compile("^([a-z]+_)*route(\[\"?([A-Za-z0-9-_:]+)\"?\])+[\s\t]*\{?", re.I)
36 36
 re_call_route = re.compile("^(.*\([\s\t!]*)?route\(\"?([A-Za-z0-9-_]+)\"?\)", re.I)
37 37
 routes = {}
38 38
 f_routes = {}
39 39
 b_routes = {}
40 40
 r_routes = {}
41 41
 s_routes = {}
42
+e_routes = {}
42 43
 
43 44
 
44 45
 def log(_s):
... ...
@@ -114,6 +115,10 @@ while line:
114 115
 				rt = b_routes
115 116
 				if rname == None:
116 117
 					rname = "branch"
118
+			elif rtype == "event_":
119
+				rt = e_routes
120
+				if rname == None:
121
+					rname = "event"
117 122
 			else:
118 123
 				rt = routes
119 124
 			log(rname)
... ...
@@ -133,6 +138,9 @@ while line:
133 138
 			elif rtype == "branch_":
134 139
 				rt = b_routes
135 140
 				rname = "branch"
141
+			elif rtype == "event_":
142
+				rt = e_routes
143
+				rname = "event"
136 144
 			else:
137 145
 				rt = routes
138 146
 				rname = "Main"
... ...
@@ -145,6 +153,7 @@ log("branch_routes: %s" % (b_routes))
145 153
 log("failure_routes: %s" % (f_routes))
146 154
 log("onreply_routes: %s" % (r_routes))
147 155
 log("onsend_routes: %s" % (s_routes))
156
+log("event_routes: %s" % (e_routes))
148 157
 
149 158
 for name in routes.keys():
150 159
 	for val in routes[name]:
... ...
@@ -191,4 +200,11 @@ if len(r_routes) > 0:
191 200
 		for r in r_routes[onr]:
192 201
 			traverse_routes(1, r)
193 202
 
203
+if len(e_routes) > 0:
204
+	print "\nEvent routes\n--------------"
205
+	for onr in e_routes.keys():
206
+		print "\n%s" % (onr)
207
+		for r in e_routes[onr]:
208
+			traverse_routes(1, r)
209
+
194 210
 print
Browse code

I suppose, that python should be called (mistyped as pyhton)

Michal Matyska authored on 26/10/2006 21:34:13
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-#! /usr/bin/env pyhton
1
+#! /usr/bin/env python
2 2
 """
3 3
  * $Id$
4 4
  *
Browse code

a small Python script which tries to plot the dependecies between the route blocks of a SER config file

Nils Ohlmeier authored on 26/10/2006 16:01:55
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,194 @@
1
+#! /usr/bin/env pyhton
2
+"""
3
+ * $Id$
4
+ *
5
+ * Copyright (C) 2006 iptelorg GmbH
6
+ *
7
+ * This file is part of ser, a free SIP server.
8
+ *
9
+ * ser is free software; you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation; either version 2 of the License, or
12
+ * (at your option) any later version
13
+ *
14
+ * For a license to use the ser software under conditions
15
+ * other than those described here, or to purchase support for this
16
+ * software, please contact iptel.org by e-mail at the following addresses:
17
+ *    info@iptel.org
18
+ *
19
+ * ser is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
+ * GNU General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU General Public License
25
+ * along with this program; if not, write to the Free Software
26
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
+ *
28
+"""
29
+import sys,re
30
+
31
+max_depth = 10
32
+debug = 0
33
+
34
+re_main_route = re.compile("^([a-z]+_)*route[\s\t]*(?![\(\)])[\s\t]*\{?", re.I)
35
+re_def_route = re.compile("^([a-z]+_)*route(\[\"?([A-Za-z0-9-_]+)\"?\])+[\s\t]*\{?", re.I)
36
+re_call_route = re.compile("^(.*\([\s\t!]*)?route\(\"?([A-Za-z0-9-_]+)\"?\)", re.I)
37
+routes = {}
38
+f_routes = {}
39
+b_routes = {}
40
+r_routes = {}
41
+s_routes = {}
42
+
43
+
44
+def log(_s):
45
+	if debug:
46
+		print _s
47
+
48
+def print_route_level(_l, _n):
49
+	log("prl: %i, %s" % (_l, _n))
50
+	if _l > max_depth:
51
+		return
52
+	spacer = ""
53
+	route = ""
54
+	for i in range(_l):
55
+		spacer += "|  "
56
+		if i < _l - 1:
57
+			route += "|  "
58
+		else:
59
+			route += "\- " + str(_n)
60
+	if len(spacer) > 0:
61
+		print spacer
62
+	if len(route) > 0:
63
+		print route
64
+
65
+def traverse_routes(_level, _name):
66
+	log("tr: %i, %s" % (_level, _name))
67
+	if _level > max_depth:
68
+		print "warning: max_depth reached"
69
+		return
70
+	print_route_level(_level, _name)
71
+	if routes.has_key(_name):
72
+		for r in routes[_name]:
73
+			traverse_routes(_level + 1, r)
74
+
75
+
76
+if len(sys.argv) < 2:
77
+	raise "usage: %s configuration-file [max_depth]" % sys.argv[0]
78
+if len(sys.argv) == 3:
79
+	max_depth = int(sys.argv[2])
80
+cfg = file(sys.argv[1], "r")
81
+if cfg == None:
82
+	raise "Missing config file"
83
+line = cfg.readline()
84
+rt = routes
85
+while line:
86
+	line = line.strip()
87
+	if not line.startswith("#"):
88
+		log(line)
89
+		main_match = re_main_route.search(line)
90
+		def_match = re_def_route.search(line)
91
+		call_match = re_call_route.search(line)
92
+		if not call_match == None:
93
+			log("CALL: " + line)
94
+			name = call_match.group(2)
95
+			log(rname +":"+name)
96
+			rt[rname].append(name)
97
+		elif not def_match == None:
98
+			log("DEF: " + line)
99
+			rtype = def_match.group(1)
100
+			rname = def_match.group(3)
101
+			if rtype == "failure_":
102
+				rt = f_routes
103
+				if rname == None:
104
+					rname = "failure"
105
+			elif rtype == "onreply_":
106
+				rt = r_routes
107
+				if rname == None:
108
+					rname = "onreply"
109
+			elif rtype == "onsend_":
110
+				rt = s_routes
111
+				if rname == None:
112
+					rname = "onsend"
113
+			elif rtype == "branch_":
114
+				rt = b_routes
115
+				if rname == None:
116
+					rname = "branch"
117
+			else:
118
+				rt = routes
119
+			log(rname)
120
+			rt[rname] = []
121
+		elif not main_match == None:
122
+			log("MAIN: " + line)
123
+			rtype = main_match.group(1)
124
+			if rtype == "failure_":
125
+				rt = f_routes
126
+				rname = "failure"
127
+			elif rtype == "onreply_":
128
+				rt = r_routes
129
+				rname = "onreply"
130
+			elif rtype == "onsend_":
131
+				rt = s_routes
132
+				rname = "onsend"
133
+			elif rtype == "branch_":
134
+				rt = b_routes
135
+				rname = "branch"
136
+			else:
137
+				rt = routes
138
+				rname = "Main"
139
+			log(rname)
140
+			rt[rname] = []
141
+	line = cfg.readline()
142
+
143
+log("routes: %s" % (routes))
144
+log("branch_routes: %s" % (b_routes))
145
+log("failure_routes: %s" % (f_routes))
146
+log("onreply_routes: %s" % (r_routes))
147
+log("onsend_routes: %s" % (s_routes))
148
+
149
+for name in routes.keys():
150
+	for val in routes[name]:
151
+		if not routes.has_key(val):
152
+			print "Missing Route %s!!!" % val
153
+# checking for unreferenced routes does not work yet because functions
154
+# can call routes as well?!
155
+	#found = False
156
+	#for n in routes.keys():
157
+	#	for v in routes[n]:
158
+	#		if v == name:
159
+	#			found = True
160
+	#if not found and (not (name == "Main" or name == "Failure" or name == "Onreply" or name == "Branch")):
161
+	#	print "Unreferenced Route %s!!!" % name
162
+
163
+print "\nMain"
164
+traverse_routes(0, "Main")
165
+
166
+if len(b_routes) > 0:
167
+	print "\nBranch routes\n-------------"
168
+	for br in b_routes.keys():
169
+		print "\n%s" % (br)
170
+		for r in b_routes[br]:
171
+			traverse_routes(1, r)
172
+
173
+if len(s_routes) > 0:
174
+	print "\nSend routes\n-----------"
175
+	for sr in s_routes.keys():
176
+		print "\n%s" % (sr)
177
+		for r in s_routes[sr]:
178
+			traverse_routes(1, r)
179
+
180
+if len(f_routes) > 0:
181
+	print "\nFailure routes\n--------------"
182
+	for fr in f_routes.keys():
183
+		print "\n%s" % (fr)
184
+		for r in f_routes[fr]:
185
+			traverse_routes(1, r)
186
+
187
+if len(r_routes) > 0:
188
+	print "\nOnreply routes\n--------------"
189
+	for onr in r_routes.keys():
190
+		print "\n%s" % (onr)
191
+		for r in r_routes[onr]:
192
+			traverse_routes(1, r)
193
+
194
+print