Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangup timeout handling #24

Closed

Conversation

jaminh
Copy link
Contributor

@jaminh jaminh commented Dec 29, 2024

Reset the RtpDatagramProtocol addr attribute to None on disconnect. This will make sure the RTP port gets properly set for subsequent calls after hanging up.

@@ -175,6 +178,7 @@ def datagram_received(self, data, addr):
if not self._is_connected:
return

_LOGGER.debug("Datagram received on addr %s, current addr is %s", addr, self.addr)
if self.addr is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just always set address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would probably work as a stopgap fix to get out quickly, but I think a more technically correct solution would require some broader changes.

I suspect The VoipAssistSatellite should not be extending RtpDatagramProtocol as a new RtpDatagramProtocol should be getting created for each call, but the VoipAssistSatellite object has a much longer lifetime. It seems we can not assume a VOIP device is going to reuse the same RTP address/port. Based on this comment home-assistant/core#128372 (comment) I think we should be initializing the RtpDatagramProtocol with the host and port from the call_info instead of waiting to set it in the datagram_received method.

@synesthesiam
Copy link
Collaborator

Thanks! Closing this in favor of: 5472d4c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants