Module: kamailio
Branch: master
Commit: f58c3ce7050908606e7bfd4dcde7f47622c0473e
URL:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-09-20T12:53:10+02:00
tools: add reply_route support to route_graph.py tool
---
Modified: misc/tools/route_graph/route_graph.py
---
Diff:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
Patch:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
---
diff --git a/misc/tools/route_graph/route_graph.py
b/misc/tools/route_graph/route_graph.py
index b416bdc186..f5633c92fd 100755
--- a/misc/tools/route_graph/route_graph.py
+++ b/misc/tools/route_graph/route_graph.py
@@ -37,6 +37,7 @@
routes = {}
f_routes = {}
b_routes = {}
+or_routes = {}
r_routes = {}
s_routes = {}
e_routes = {}
@@ -104,9 +105,13 @@ def traverse_routes(_level, _name):
if rname is None:
rname = "failure"
elif rtype == "onreply_":
- rt = r_routes
+ rt = or_routes
if rname is None:
rname = "onreply"
+ elif rtype == "reply_":
+ rt = r_routes
+ if rname is None:
+ rname = "reply"
elif rtype == "onsend_":
rt = s_routes
if rname is None:
@@ -130,8 +135,11 @@ def traverse_routes(_level, _name):
rt = f_routes
rname = "failure"
elif rtype == "onreply_":
- rt = r_routes
+ rt = or_routes
rname = "onreply"
+ elif rtype == "reply_":
+ rt = r_routes
+ rname = "reply"
elif rtype == "onsend_":
rt = s_routes
rname = "onsend"
@@ -151,7 +159,8 @@ def traverse_routes(_level, _name):
log("routes: %s" % (routes))
log("branch_routes: %s" % (b_routes))
log("failure_routes: %s" % (f_routes))
-log("onreply_routes: %s" % (r_routes))
+log("onreply_routes: %s" % (or_routes))
+log("reply_routes: %s" % (r_routes))
log("onsend_routes: %s" % (s_routes))
log("event_routes: %s" % (e_routes))
@@ -193,8 +202,15 @@ def traverse_routes(_level, _name):
for r in f_routes[fr]:
traverse_routes(1, r)
-if len(r_routes) > 0:
+if len(or_routes) > 0:
print "\nOnreply routes\n--------------"
+ for onr in or_routes.keys():
+ print "\n%s" % (onr)
+ for r in or_routes[onr]:
+ traverse_routes(1, r)
+
+if len(r_routes) > 0:
+ print "\nReply routes\n--------------"
for onr in r_routes.keys():
print "\n%s" % (onr)
for r in r_routes[onr]: