Executing [6005@from-internal:1] Answer(“PJSIP/6001-0000000c”, “”) in new stack
[2024-11-08 15:32:49] VERBOSE[17118][C-0000000d] pbx.c: Executing [6005@from-internal:2] EAGI(“PJSIP/6001-0000000c”, “/var/lib/asterisk/agi-bin/stream_to_java.py”) in new stack
[2024-11-08 15:32:49] VERBOSE[17118][C-0000000d] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/stream_to_java.py
[2024-11-08 15:32:49] VERBOSE[17118][C-0000000d] res_agi.c: <PJSIP/6001-0000000c>AGI Script /var/lib/asterisk/agi-bin/stream_to_java.py completed, returning 0
[2024-11-08 15:32:49] VERBOSE[17118][C-0000000d] pbx.c: Executing [6005@from-internal:3] Hangup(“PJSIP/6001-0000000c”, “”) in new stack
The log shows that the execution was successful, but the log file that was supposed to be generated in my stream_to-jav.py script was not successfully generated. What is the reason for this
Because there is something wrong in the script. However you did not provide us with the contents of the script. At least one fault is likely to be failing to check that writing the log worked, or failing to set an error return code, if it didn’t/
Asterisk sets stderr to /dev/null when it spawns your script. This can make it quite difficult to debug, because any error messages will completely disappear.
To get around this, put something like the following close to the top of your script:
import os
log = open("/tmp/agi_try.log", "w")
os.dup2(log.fileno(), 2)
log.close()
del log