在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:esl-client/esl-client开源软件地址:https://github.com/esl-client/esl-client开源编程语言:Java 100.0%开源软件介绍:esl-clientesl-client is a Java-based Event Socket Library for the FreeSWITCH project. This project is a fork of the unmaintained, original project at https://freeswitch.org/stash/projects/FS/repos/freeswitch-contrib/browse/dvarnes/java/esl-client Status: In Progress... Examplepackage com.ecovate.freeswitch.lb;
import com.google.common.base.Throwables;
import org.freeswitch.esl.client.inbound.Client;
import org.freeswitch.esl.client.inbound.IEslEventListener;
import org.freeswitch.esl.client.internal.IModEslApi.EventFormat;
import org.freeswitch.esl.client.outbound.Context;
import org.freeswitch.esl.client.outbound.IClientHandler;
import org.freeswitch.esl.client.outbound.IClientHandlerFactory;
import org.freeswitch.esl.client.outbound.SocketClient;
import org.freeswitch.esl.client.transport.event.EslEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetSocketAddress;
public class FreeSwitchEventListener {
private static Logger logger = LoggerFactory.getLogger(FreeSwitchEventListener.class);
public static void main(String[] args) {
try {
final Client inboudClient = new Client();
inboudClient.connect(new InetSocketAddress("localhost", 8021), "ClueCon", 10);
inboudClient.addEventListener(new IEslEventListener() {
@Override
public void onEslEvent(EslEvent eslEvent) {
}
});
inboudClient.setEventSubscriptions(EventFormat.PLAIN, "all");
final SocketClient outboundServer = new SocketClient(
new InetSocketAddress("localhost", 8084),
new IClientHandlerFactory() {
@Override
public IClientHandler createClientHandler() {
return new IClientHandler() {
@Override
public void handleEslEvent(Context context, EslEvent eslEvent) {
}
@Override
public void onConnect(Context context, EslEvent eslEvent) {
}
};
}
});
} catch (Throwable t) {
Throwables.propagate(t);
}
}
} Authors
Licenseesl-client is licensed under the Apache License, version 2. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论