command = c.recv() cfg['Logging']['system_logger'].info(command) # stop processes vio_commands.send(Command('stop()', 'HUB', 'VoipIO')) vad_commands.send(Command('stop()', 'HUB', 'VAD')) asr_commands.send(Command('stop()', 'HUB', 'ASR')) tts_commands.send(Command('stop()', 'HUB', 'TTS')) # clean connections for c in command_connections: while c.poll(): c.recv() for c in non_command_connections: while c.poll(): c.recv() # wait for processes to stop vio.join() cfg['Logging']['system_logger'].debug('VIO stopped.') vad.join() cfg['Logging']['system_logger'].debug('VAD stopped.') asr.join() cfg['Logging']['system_logger'].debug('ASR stopped.') tts.join() cfg['Logging']['system_logger'].debug('TTS stopped.')
elif command.parsed['__name__'] == "call_disconnected": cfg['Logging']['system_logger'].info(command) vio_commands.send(Command('flush()', 'HUB', 'VoipIO')) cfg['Logging']['system_logger'].session_end() cfg['Logging']['session_logger'].session_end() # read all messages for c in command_connections: if c.poll(): command = c.recv() system_logger.info(command) # stop processes vio_commands.send(Command('stop()', 'HUB', 'VoipIO')) # clean connections for c in command_connections: while c.poll(): c.recv() for c in non_command_connections: while c.poll(): c.recv() # wait for processes to stop vio.join() system_logger.debug('VIO stopped.')