|
|
@ -154,7 +154,8 @@ class VoiceClient(LoggingClass): |
|
|
|
return |
|
|
|
|
|
|
|
self.log.info( |
|
|
|
'[{}] Set endpoint from VOICE_SERVER_UPDATE (state = {} / endpoint = {})'.format(self, self.state, endpoint)) |
|
|
|
'[{}] Set endpoint from VOICE_SERVER_UPDATE (state = {} / endpoint = {})'.format(self, self.state, |
|
|
|
endpoint)) |
|
|
|
|
|
|
|
self.endpoint = endpoint |
|
|
|
|
|
|
@ -246,7 +247,8 @@ class VoiceClient(LoggingClass): |
|
|
|
self.set_state(VoiceState.AUTHENTICATED) |
|
|
|
|
|
|
|
def on_voice_ready(self, data): |
|
|
|
self.log.info('[{}] Received Voice READY payload, attempting to negotiate voice connection w/ remote'.format(self)) |
|
|
|
self.log.info('[{}] Received Voice READY payload, attempting to negotiate voice connection w/ remote'.format( |
|
|
|
self)) |
|
|
|
self.set_state(VoiceState.CONNECTING) |
|
|
|
self.ssrc = data['ssrc'] |
|
|
|
self.ip = data['ip'] |
|
|
@ -281,7 +283,8 @@ class VoiceClient(LoggingClass): |
|
|
|
'payload_type': RTPPayloadTypes.get(codec).value, |
|
|
|
}) |
|
|
|
|
|
|
|
self.log.debug('[{}] IP discovery completed (ip = {}, port = {}), sending SELECT_PROTOCOL'.format(self, ip, port)) |
|
|
|
self.log.debug('[{}] IP discovery completed (ip = {}, port = {}), sending SELECT_PROTOCOL'.format(self, ip, |
|
|
|
port)) |
|
|
|
self.send(VoiceOPCode.SELECT_PROTOCOL, { |
|
|
|
'protocol': 'udp', |
|
|
|
'data': { |
|
|
@ -396,7 +399,8 @@ class VoiceClient(LoggingClass): |
|
|
|
wait_time = 1 |
|
|
|
|
|
|
|
self.log.info( |
|
|
|
'[{}] Will attempt to {} after {} seconds'.format(self, 'resume' if self._identified else 'reconnect', wait_time)) |
|
|
|
'[{}] Will attempt to {} after {} seconds'.format(self, 'resume' if self._identified else 'reconnect', |
|
|
|
wait_time)) |
|
|
|
gevent.sleep(wait_time) |
|
|
|
|
|
|
|
self._connect_and_run() |
|
|
|