Good afternoon,
I am trying out the Outbound Websocket feature with a Spring Boot Application and having an issue with the connection being created and instantly dropped.
[Nov 30 21:17:11] NOTICE[1518311]: ari/ari_websockets.c:970 outbound_session_handler_thread: spring_connection: Outbound websocket connected to ws://localhost:8080/ws/ari
[Nov 30 21:17:11] WARNING[1518311]: ari/ari_websockets.c:1023 outbound_session_handler_thread: spring_connection: Websocket disconnected. Reconnecting
I have enabled debug logging in spring and I can’t see any errors so I am unsure where/why the connection could be being dropped. Any help or pointers would be greatly appreciated!
@Slf4j
@Configuration
public class WebsocketConfig implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
DefaultHandshakeHandler defaultHandshakeHandler = new DefaultHandshakeHandler();
defaultHandshakeHandler.setSupportedProtocols("ari");
registry.addHandler(new TextWebSocketHandler() {
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
log.info("Connection Closed : {} -> {}", status, session.getId());
}
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
log.info("CONNECTED : {}", session.getId());
}
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
log.info(message.getPayload());
}
}, "/ws/ari")
.setAllowedOrigins("*")
.setHandshakeHandler(defaultHandshakeHandler);
}
}
I am a bit stuck and the `vvvvv` isnt revealing much more verbose reasoning as to why the connection is being dropped.
The spring logs (debug):
2025-11-30T21:17:11.727Z INFO 1599037 — [spring-agi] [io-8080-exec-86] c.e.a.s.app.ari.WebsocketConfig : CONNECTED : b65da0f7-eaa6-6727-dfa8-9dc57bf9161c
2025-11-30T21:17:11.727Z INFO 1599037 — [spring-agi] [io-8080-exec-86] c.e.a.s.app.ari.WebsocketConfig : Connection Closed : CloseStatus[code=1000, reason=null] → b65da0f7-eaa6-6727-dfa8-9dc57bf9161c
