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

Detect command unrelated disconnect notices. #2

Open
pragmatrix opened this issue Nov 5, 2021 · 0 comments
Open

Detect command unrelated disconnect notices. #2

pragmatrix opened this issue Nov 5, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@pragmatrix
Copy link
Member

When the EventSocket connects to FreeSWITCH and no auth command is sent afterwards, FreeSWITCH sends a disconnect notice after about 25 seconds:

[2021-11-05T17:12:58Z ERROR free_socks::event_socket] Reader loop crashed: Socket receiver closed by peer.
[2021-11-05T17:12:58Z DEBUG free_socks::event_socket] Ending reader loop
[2021-11-05T17:12:58Z TRACE free_socks::event_socket] Received: Message { headers: [("Content-Type", "text/disconnect-notice"), ("Content-Length", "67")], content: Some(Content { ty: "text/disconnect-notice", data: "Disconnected, goodbye.\nSee you at 
ClueCon! http://www.cluecon.com/\n" }) }
[2021-11-05T17:12:58Z DEBUG free_socks::event_socket] Received disconnect notice: Disconnected, goodbye.
    See you at ClueCon! http://www.cluecon.com/

The problem is that there is currently no way to detect this until another command is sent.

Ideas:

  • Add a is_connected() function.
  • Provide a future or a one time channel that gets signaled as soon a disconnect happens.
@pragmatrix pragmatrix added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant