def _connect(self):
logger.debug('ARI client listening...')
try:
with self._running():
self.client.run(apps=[APPLICATION_NAME])
except socket.error as e:
if e.errno == errno.EPIPE:
# bug in ari-py when calling client.close(): ignore it and stop
logger.error('Error while listening for ARI events: %s', e)
return
else:
self._connection_error(e)
except (WebSocketException, HTTPError) as e:
self._connection_error(e)
except ValueError:
logger.warning('Received non-JSON message from ARI... disconnecting')
self.client.close()
评论列表
文章目录