Skip to content

Detect command unrelated disconnect notices. #2

@pragmatrix

Description

@pragmatrix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions