unispeech / asterisk-unimrcp

UniMRCP modules for Asterisk
http://www.unimrcp.org/asterisk
GNU General Public License v2.0
48 stars 35 forks source link

Always stop barged tts #38

Closed sfgeorge closed 4 years ago

sfgeorge commented 4 years ago

In the case of some versions of NeoSpeech TTS, if it receives a RTSP TEARDOWN without a preceding MRCP STOP before it, then it does not release the licensed port.

This change ensures that the licensed TTS port is fully released by sending a MRCP STOP prior to the RTSP TEARDOWN.

This is the lazy but hopefully comprehensive approach to ensuring that the TTS channel is cleanly and fully stopped before sending a TEARDOWN.

I say "lazy", because this approach will inevitably cause speech_channel_stop() to be invoked twice in some cases. However, this is completely innocuous in such cases, because the method will exit much like a no-op if synth is not active, such as when the method has already been called.

achaloyan commented 4 years ago

This pull request has been merged. Please check the follow-up commit af1b09bb0bbe0322fc98f6b80c9f67a34175f390 which makes this behavior configurable.