private void sendPong(AGateway gateway, InboundMessage msg) { String pongResponse = (isCanonicalPingRequest(msg)) ? "pong" : getPseudoPongResponse(msg); LOG.debug("SmsPonger.sendPong: sending string '{}'", pongResponse); try { OutboundMessage pong = new OutboundMessage(msg.getOriginator(), pongResponse); pong.setGatewayId(gateway.getGatewayId()); if (!gateway.sendMessage(pong)) { LOG.error("Failed to send pong request to {}", msg.getOriginator()); } } catch (TimeoutException e) { LOG.error("Timeout sending pong request to {}", msg.getOriginator(), e); } catch (GatewayException e) { LOG.error("Gateway exception sending pong request to {}", msg.getOriginator(), e); } catch (IOException e) { LOG.error("IOException sending pong request to {}", msg.getOriginator(), e); } catch (InterruptedException e) { LOG.error("InterruptedException sending poing request to {}", msg.getOriginator(), e); } }