diff --git a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/HeartbeatEslEventHandler.java b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/HeartbeatEslEventHandler.java index 14088a8..d5eddd9 100644 --- a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/HeartbeatEslEventHandler.java +++ b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/HeartbeatEslEventHandler.java @@ -34,7 +34,9 @@ @EslEventName(EventNames.HEARTBEAT) @Component public class HeartbeatEslEventHandler implements EslEventHandler { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void handle(String addr, EslEvent event) { log.info("HeartbeatEslEventHandler handle addr[{}] EslEvent[{}].", addr, event); diff --git a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/ServerConnectionListenerImpl.java b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/ServerConnectionListenerImpl.java index 1206e12..1104762 100644 --- a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/ServerConnectionListenerImpl.java +++ b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/ServerConnectionListenerImpl.java @@ -39,7 +39,9 @@ public void onOpened(ServerOption serverOption) { log.info("onOpened serverOption : {}", serverOption); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void onClosed(ServerOption serverOption) { log.info("onClosed serverOption : {}", serverOption); diff --git a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/controller/DemoController.java b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/controller/DemoController.java index f5e29c7..5656f78 100644 --- a/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/controller/DemoController.java +++ b/freeswitch-esl-spring-boot-starter-example/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/example/controller/DemoController.java @@ -18,15 +18,12 @@ package link.thingscloud.freeswitch.esl.spring.boot.starter.example.controller; import link.thingscloud.freeswitch.esl.InboundClient; -import link.thingscloud.freeswitch.esl.inbound.option.InboundClientOption; import link.thingscloud.freeswitch.esl.inbound.option.ServerOption; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - /** *

DemoController class.

* @@ -80,6 +77,7 @@ public void removeServer1() { ServerOption serverOption = inboundClient.option().serverOptions().get(0); inboundClient.option().removeServerOption(serverOption); } + /** *

serverOptions.

* diff --git a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/handler/DefaultEslEventHandler.java b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/handler/DefaultEslEventHandler.java index a901837..b1d6e9e 100644 --- a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/handler/DefaultEslEventHandler.java +++ b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/handler/DefaultEslEventHandler.java @@ -27,7 +27,9 @@ * @version $Id: $Id */ public class DefaultEslEventHandler extends AbstractEslEventHandler { - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void handle(String addr, EslEvent event) { log.warn("Default esl event handler handle addr[{}], event[{}]", addr, EslHelper.formatEslEvent(event)); diff --git a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/IEslEventListenerTemplate.java b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/IEslEventListenerTemplate.java index 7be7a0a..89eaa18 100644 --- a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/IEslEventListenerTemplate.java +++ b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/IEslEventListenerTemplate.java @@ -48,7 +48,7 @@ @Component public class IEslEventListenerTemplate implements IEslEventListener, InitializingBean, ApplicationContextAware { - @Autowired + @Autowired private InboundClient inboundClient; private ApplicationContext applicationContext; private EslEventHandler defaultEventHandler = new DefaultEslEventHandler(); @@ -62,7 +62,9 @@ public void eventReceived(String addr, EslEvent event) { handleEslEvent(addr, event); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void backgroundJobResultReceived(String addr, EslEvent event) { handleEslEvent(addr, event); @@ -79,7 +81,9 @@ private void handleEslEvent(String addr, EslEvent event) { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void afterPropertiesSet() { log.info("IEslEventListener init ..."); @@ -110,7 +114,9 @@ public void afterPropertiesSet() { inboundClient.option().addListener(this); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; diff --git a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/ServerConnectionListenerTemplate.java b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/ServerConnectionListenerTemplate.java index ff2d092..b915a6b 100644 --- a/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/ServerConnectionListenerTemplate.java +++ b/freeswitch-esl-spring-boot-starter/src/main/java/link/thingscloud/freeswitch/esl/spring/boot/starter/template/ServerConnectionListenerTemplate.java @@ -37,7 +37,9 @@ public void onOpened(ServerOption serverOption) { log.info("onOpened serverOption : {}", serverOption.host() + ":" + serverOption.port()); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public void onClosed(ServerOption serverOption) { log.info("onClosed serverOption : {}", serverOption.host() + ":" + serverOption.port()); diff --git a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/InboundClient.java b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/InboundClient.java index c003543..b9db5a0 100644 --- a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/InboundClient.java +++ b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/InboundClient.java @@ -85,6 +85,7 @@ static InboundClient getInstance() { * @param timeoutSeconds timeout seconds arguments * @return an {@link link.thingscloud.freeswitch.esl.transport.message.EslMessage} containing command results * @throws link.thingscloud.freeswitch.esl.exception.InboundTimeoutExcetion ite execute command timeout + * @throws link.thingscloud.freeswitch.esl.exception.InboundTimeoutExcetion if any. */ EslMessage sendSyncApiCommand(String addr, String command, String arg, long timeoutSeconds) throws InboundTimeoutExcetion; diff --git a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/inbound/AbstractNettyInboundClient.java b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/inbound/AbstractNettyInboundClient.java index 584e010..ea3b67e 100644 --- a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/inbound/AbstractNettyInboundClient.java +++ b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/inbound/AbstractNettyInboundClient.java @@ -25,8 +25,6 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.LineBasedFrameDecoder; -import io.netty.handler.codec.string.StringDecoder; import io.netty.handler.codec.string.StringEncoder; import io.netty.handler.timeout.IdleStateHandler; import io.netty.handler.timeout.ReadTimeoutHandler; diff --git a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendEvent.java b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendEvent.java index fdc2640..2f9870f 100644 --- a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendEvent.java +++ b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendEvent.java @@ -34,7 +34,7 @@ public class SendEvent { * Constructor for use with outbound socket client only. This client mode does not need a call * UUID for context. * - * @param name part of line + * @param name part of line */ public SendEvent(String name) { msgLines.add("sendevent " + name); @@ -49,9 +49,11 @@ public SendEvent(String name) { * * @param name part of line * @param value part of line + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendEvent} object. */ - public void addLine(String name, String value) { + public SendEvent addLine(String name, String value) { msgLines.add(name + ": " + value); + return this; } /** @@ -92,5 +94,4 @@ public String toString() { return sb.toString(); } - } diff --git a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendMsg.java b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendMsg.java index 3dd617f..2437be9 100644 --- a/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendMsg.java +++ b/freeswitch-esl/src/main/java/link/thingscloud/freeswitch/esl/transport/SendMsg.java @@ -57,9 +57,11 @@ public SendMsg(String uuid) { * * * @param command the string command [ execute | hangup ] + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addCallCommand(String command) { + public SendMsg addCallCommand(String command) { msgLines.add("call-command: " + command); + return this; } /** @@ -69,9 +71,11 @@ public void addCallCommand(String command) { * * * @param appName the string app name to execute + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addExecuteAppName(String appName) { + public SendMsg addExecuteAppName(String appName) { msgLines.add("execute-app-name: " + appName); + return this; } /** @@ -81,9 +85,11 @@ public void addExecuteAppName(String appName) { * * * @param arg the string arg + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addExecuteAppArg(String arg) { + public SendMsg addExecuteAppArg(String arg) { msgLines.add("execute-app-arg: " + arg); + return this; } /** @@ -93,9 +99,11 @@ public void addExecuteAppArg(String arg) { * * * @param count the int number of times to loop + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addLoops(int count) { + public SendMsg addLoops(int count) { msgLines.add("loops: " + count); + return this; } /** @@ -105,9 +113,11 @@ public void addLoops(int count) { * * * @param cause the string cause + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addHangupCause(String cause) { + public SendMsg addHangupCause(String cause) { msgLines.add("hangup-cause: " + cause); + return this; } /** @@ -117,9 +127,11 @@ public void addHangupCause(String cause) { * * * @param value the string value part of the line + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addNomediaUuid(String value) { + public SendMsg addNomediaUuid(String value) { msgLines.add("nomedia-uuid: " + value); + return this; } /** @@ -127,9 +139,12 @@ public void addNomediaUuid(String value) { *
      *    event-lock: true
      *  
+ * + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addEventLock() { + public SendMsg addEventLock() { msgLines.add("event-lock: true"); + return this; } /** @@ -141,9 +156,11 @@ public void addEventLock() { * * @param name part of line * @param value part of line + * @return a {@link link.thingscloud.freeswitch.esl.transport.SendMsg} object. */ - public void addGenericLine(String name, String value) { + public SendMsg addGenericLine(String name, String value) { msgLines.add(name + ": " + value); + return this; } /**