is there a way to stop Audio from being played to a channel by ChanSpy? I have a following dialplan and use CLI to trigger the playback. Now I would like to have a way to stop playback at any time.
[chanspy]
exten => _[a-z,0-9].,1,Answer()
same => n,Verbose(Playing ChanSpy to ${EXTEN})
same => n,ChanSpy(${SPYCHANNEL},qBv(-4))
same => n,Hangup
[chanspy-playback]
exten => [a-z,0-9,].,1,Answer()
same => n,Verbose( tf/${EXTEN} playback by chanspy for A: ${CALLER} and B: ${CALLEE})
same => n,Playback(audio/${EXTEN})
thank you for the reply and the idea to hang up or wait the ChanSpy channel.
The use case is to play an announcement during the call and stop it if the other party would make a comment that it got the message or need some detailed explanation before the announcement will end.
This leads to another question that I was not able to reduce the volume of the announcement by using the v(-4) parameter to hear the other party.
Regarding your Answer() line comment - It is the actual code that I’m using and it works.
I was actually not sure if the Answer line was needed as I copied the code from one of the internet examples.