Open Tinet-mucw opened 3 weeks ago
There is also a bug in WaitForCondition under certain conditions that causes audio stuttering. I'm not sure if it's necessary to raise this issue.
I feel this bug shouldn’t be raised, because if we skip this wait, writing frames to the spyee channel afterward could cause a crash. The solution I can think of is writting a silent packet to the spyee channel.
or call ast_audiohook_remove?
Severity
Trivial
Versions
18.10
Components/Modules
app_chanspy
Operating Environment
centos 8
Frequency of Occurrence
None
Issue Description
When a call is sent to Asterisk and the Dial application is executed in the dial plan to forward the call to the callee, the callee is actually a robot. For some reason, there is no audio stream on the incoming channel. After the robot plays the welcome message, it no longer plays any audio stream.
At this point, an originate action is used to create a channel to spying the incoming channel. After a few seconds, the spyer channel sends a hangup action, but the hangup fails until the incoming channel hangs up.
The issue with the inability to hang up occurs because the spy_audiohook status does not change from AST_AUDIOHOOK_STATUS_SHUTDOWN to AST_AUDIOHOOK_STATUS_DONE. When writing frames to the audiohook, if the status is checked as AST_AUDIOHOOK_STATUS_SHUTDOWN, it will be set to AST_AUDIOHOOK_STATUS_DONE.
However, since there is no audio stream on the spyee channel, the audiohook status remains unchanged. Only when the spyee channel is hung up does the audiohook status update during its destruction.
Relevant log output
Asterisk Issue Guidelines