Here is a one-liner that can literally save you days when developing a new asterisk AGI script in Python.
What it does is that it redirects STDERR to a file in /tmp so you can see the python console output after an un-handled exception for example, that resulted in your agi script terminating early.
These kind of errors are not easy to find even with agi debug on, and can have you "scratching your head" for hours if not days when debugging a new agi script
sys.stderr = open('/tmp/ast_agi_err.txt', 'w')
What it does is that it redirects STDERR to a file in /tmp so you can see the python console output after an un-handled exception for example, that resulted in your agi script terminating early.
These kind of errors are not easy to find even with agi debug on, and can have you "scratching your head" for hours if not days when debugging a new agi script
1 comment:
You tip to debug python agi script was very helpful. Thank You
Post a Comment