Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
If you run it with the default configuration file the output will look like this:
./route_graph.py ../../etc/ser.cfg
Main | - 1 | - 1 | - 1 | - 1
A more complex scenario (from a config with named routes) could look like this:
./route_graph.py ./ser.cfg
Main | - ROUTE_RPC | | | - ROUTE_ERROR_REPLY | - ROUTE_PROXYINIT | | | - ROUTE_ERROR_REPLY | - ROUTE_INDIALOG | | | - ROUTE_ERROR_REPLY | | | - ROUTE_ST | | | - ROUTE_FORWARD | | | | | - ROUTE_LI | | | | | - ROUTE_RTPPROXY | | | | | - ROUTE_RR | - ROUTE_DOMAINPOLICY | | | - ROUTE_ERROR_REPLY | - ROUTE_REGISTRAR | | | - ROUTE_ERROR_REPLY | - ROUTE_AUTHENTICATION | |
[... omitted bigger parts...]
Send routes -----------
onsend
Failure routes --------------
FAILURE_ROUTE | - ROUTE_RTPPROXY | - ROUTE_VOICEMAIL | | | - ROUTE_SEMS | | | | | - ROUTE_LI | | | | | - ROUTE_RR | | | - ROUTE_ERROR_REPLY |
[... omitted bigger parts...]
Onreply routes --------------
REPLY_ROUTE
Feedback is welcome. Patches even more! :-)
Greetings Nils
Hi Nils,
Very cool!
Looking forward to tst it!
Feedback before testing it would to maybe make it also print the "most" logical request-uri changes.
(like, rewritehostport, lookup(".."))
-Atle
* Nils Ohlmeier nils@iptel.org [061026 18:22]:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
If you run it with the default configuration file the output will look like this:
./route_graph.py ../../etc/ser.cfg
Main | - 1 | - 1 | - 1 | - 1
A more complex scenario (from a config with named routes) could look like this:
./route_graph.py ./ser.cfg
Main | - ROUTE_RPC | | | - ROUTE_ERROR_REPLY | - ROUTE_PROXYINIT | | | - ROUTE_ERROR_REPLY | - ROUTE_INDIALOG | | | - ROUTE_ERROR_REPLY | | | - ROUTE_ST | | | - ROUTE_FORWARD | | | | | - ROUTE_LI | | | | | - ROUTE_RTPPROXY | | | | | - ROUTE_RR | - ROUTE_DOMAINPOLICY | | | - ROUTE_ERROR_REPLY | - ROUTE_REGISTRAR | | | - ROUTE_ERROR_REPLY | - ROUTE_AUTHENTICATION | |
[... omitted bigger parts...]
Send routes
onsend
Failure routes
FAILURE_ROUTE | - ROUTE_RTPPROXY | - ROUTE_VOICEMAIL | | | - ROUTE_SEMS | | | | | - ROUTE_LI | | | | | - ROUTE_RR | | | - ROUTE_ERROR_REPLY |
[... omitted bigger parts...]
Onreply routes
REPLY_ROUTE
Feedback is welcome. Patches even more! :-)
Greetings Nils _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Atle, On Thursday 26 October 2006 18:31, Atle Samuelsen wrote:
Very cool!
Thanks
Looking forward to tst it!
Feedback before testing it would to maybe make it also print the "most" logical request-uri changes.
(like, rewritehostport, lookup(".."))
You are right. That would make sense for sure. But the problem with that is that the script then somehow would need to know "statically" which functions might change the RURI. But I do not like such "static" approaches very much, because someone has to maintain them. But if someone comes up with such a solution that would be a big step in the direction to an SER GDB :-)
BTW before solving the RURI problem, the first problem for route_graph is, that module functions might call a route. This is not solved yet.
Nils
-Atle
- Nils Ohlmeier nils@iptel.org [061026 18:22]:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
* Nils Ohlmeier nils@iptel.org [061026 18:42]:
Hi Atle, On Thursday 26 October 2006 18:31, Atle Samuelsen wrote:
Very cool!
Thanks
Looking forward to tst it!
Feedback before testing it would to maybe make it also print the "most" logical request-uri changes.
(like, rewritehostport, lookup(".."))
You are right. That would make sense for sure. But the problem with that is that the script then somehow would need to know "statically" which functions might change the RURI. But I do not like such "static" approaches very much, because someone has to maintain them. But if someone comes up with such a solution that would be a big step in the direction to an SER GDB :-)
Hmm.. good point.. Would it be possible to maybe use a include file where this could be put in as a linebreak seperated list. Yes somebody would need to maintain it (if you want I could do it, it's really not that much work.. not much changes related to new functionames that rewrite the RURI)
BTW before solving the RURI problem, the first problem for route_graph is, that module functions might call a route. This is not solved yet.
Hmm.. What about putting them into the same file as I'm thinking of above. something like:
/*functionname;functiontype */ rewritehostport;0 functioncallingroute(x);1
- Atle
Nils
-Atle
- Nils Ohlmeier nils@iptel.org [061026 18:22]:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
Nils,
looks promising, so I wanted to give it try.... and hey, what is that pyhton? Is it your preferred misspell, so did you create symbolic link to python? :-D
Michal
Nils Ohlmeier wrote:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
If you run it with the default configuration file the output will look like this:
./route_graph.py ../../etc/ser.cfg
Main | - 1 | - 1 | - 1 | - 1
A more complex scenario (from a config with named routes) could look like this:
./route_graph.py ./ser.cfg
Main | - ROUTE_RPC | | | - ROUTE_ERROR_REPLY | - ROUTE_PROXYINIT | | | - ROUTE_ERROR_REPLY | - ROUTE_INDIALOG | | | - ROUTE_ERROR_REPLY | | | - ROUTE_ST | | | - ROUTE_FORWARD | | | | | - ROUTE_LI | | | | | - ROUTE_RTPPROXY | | | | | - ROUTE_RR | - ROUTE_DOMAINPOLICY | | | - ROUTE_ERROR_REPLY | - ROUTE_REGISTRAR | | | - ROUTE_ERROR_REPLY | - ROUTE_AUTHENTICATION | |
[... omitted bigger parts...]
Send routes
onsend
Failure routes
FAILURE_ROUTE | - ROUTE_RTPPROXY | - ROUTE_VOICEMAIL | | | - ROUTE_SEMS | | | | | - ROUTE_LI | | | | | - ROUTE_RR | | | - ROUTE_ERROR_REPLY |
[... omitted bigger parts...]
Onreply routes
REPLY_ROUTE
Feedback is welcome. Patches even more! :-)
Greetings Nils _______________________________________________ Serdev mailing list Serdev@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serdev
Hi Michal,
On Thursday 26 October 2006 23:18, Michal Matyska wrote:
looks promising, so I wanted to give it try.... and hey, what is that pyhton? Is it your preferred misspell, so did you create symbolic link to python? :-D
yes, that is one of my favorite errors when typing to fast, so I created a symbolic link :-D
Thanks for fixing it Nils
Michal
Nils Ohlmeier wrote:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
If you run it with the default configuration file the output will look like this:
./route_graph.py ../../etc/ser.cfg
Main
- 1
- 1
- 1
- 1
A more complex scenario (from a config with named routes) could look like this:
./route_graph.py ./ser.cfg
Main
- ROUTE_RPC
| - ROUTE_ERROR_REPLY
- ROUTE_PROXYINIT
| - ROUTE_ERROR_REPLY
- ROUTE_INDIALOG
| - ROUTE_ERROR_REPLY | | - ROUTE_ST | | - ROUTE_FORWARD | | | - ROUTE_LI | | | | - ROUTE_RTPPROXY | | | | - ROUTE_RR
- ROUTE_DOMAINPOLICY
| - ROUTE_ERROR_REPLY
- ROUTE_REGISTRAR
| - ROUTE_ERROR_REPLY
- ROUTE_AUTHENTICATION
[... omitted bigger parts...]
Send routes
onsend
Failure routes
FAILURE_ROUTE
- ROUTE_RTPPROXY
- ROUTE_VOICEMAIL
| - ROUTE_SEMS | | | - ROUTE_LI | | | | - ROUTE_RR | | - ROUTE_ERROR_REPLY
[... omitted bigger parts...]
Onreply routes
REPLY_ROUTE
Feedback is welcome. Patches even more! :-)
Greetings Nils _______________________________________________ Serdev mailing list Serdev@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serdev
Excellent! This could maybe be extended to an analysis of message types too?! Would be great to be able to see:
INVITE - Main | - ROUTE_RPC (method=="XMLRPC") | | | - ROUTE_ERROR_REPLY (!handle_rpc()) | - ROUTE_PROXYINIT (uri=~"sip:something") | |
And so on, where each condition for entering a route is picked from the if's. Multiple ifs must be handled some way though, maybe:
INVITE - Main | (some if found in script) | - ROUTE_RPC (method=="XMLRPC") | | | | | - ROUTE_ERROR_REPLY (!handle_rpc()) | - ROUTE_PROXYINIT (uri=~"sip:something") | |
And of course, the dream would also be to be able to see the "decision path" for a specific SIP message... However, this means that data must be collected from an actual execution and a special debug mode must be created where each call to if and routes etc are traced in a stack and printed to the debug log when break or end is reached...
Dangerous to add cool stuff, you get too many suggestions!! ;-) g-)
Nils Ohlmeier wrote:
Hello,
in case you are not following the CVS commit log messages: I just checked in a small python script which should be able to print a dependency graph in ASCII of the route blocks of a SER config file.
When you try to understand more complex configuration files this tool might be helpfull. But be warned: this is still alpha code! It will not eat your config file, but the output might not meet your expectations :-)
If you run it with the default configuration file the output will look like this:
./route_graph.py ../../etc/ser.cfg
Main | - 1 | - 1 | - 1 | - 1
A more complex scenario (from a config with named routes) could look like this:
./route_graph.py ./ser.cfg
Main | - ROUTE_RPC | | | - ROUTE_ERROR_REPLY | - ROUTE_PROXYINIT | | | - ROUTE_ERROR_REPLY | - ROUTE_INDIALOG | | | - ROUTE_ERROR_REPLY | | | - ROUTE_ST | | | - ROUTE_FORWARD | | | | | - ROUTE_LI | | | | | - ROUTE_RTPPROXY | | | | | - ROUTE_RR | - ROUTE_DOMAINPOLICY | | | - ROUTE_ERROR_REPLY | - ROUTE_REGISTRAR | | | - ROUTE_ERROR_REPLY | - ROUTE_AUTHENTICATION | |
[... omitted bigger parts...]
Send routes
onsend
Failure routes
FAILURE_ROUTE | - ROUTE_RTPPROXY | - ROUTE_VOICEMAIL | | | - ROUTE_SEMS | | | | | - ROUTE_LI | | | | | - ROUTE_RR | | | - ROUTE_ERROR_REPLY |
[... omitted bigger parts...]
Onreply routes
REPLY_ROUTE
Feedback is welcome. Patches even more! :-)
Greetings Nils _______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers