diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 15fb9e0e8e..09b6e18a0c 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1159,7 +1159,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event, } } - if (channel && !switch_channel_ready(channel) && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) { + if (channel && switch_channel_get_state(channel) >= CS_HANGUP && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) { switch_set_flag_locked(listener, LFLAG_HANDLE_DISCO); if (switch_test_flag(listener, LFLAG_LINGER)) { char message[128] = "";