与SCTP建立M3UA关联

与SCTP建立M3UA关联,c,linux,fedora,sctp,C,Linux,Fedora,Sctp,我想使用Lksctp linux开发一个M3UA关联,我也认为使用openSS7 M3UA是可能的,但我不知道如何做到这一点。还有什么想法吗??? 感谢您的帮助。我认为最好使用Mobicents jSS7您可以将lk sctp与jdk-7(及更高版本)上的Netty framework结合使用来实现M3UA(RFC 4666)。 Netty-4.0.25-FINAL是支持SCTP的稳定版本 因此,组合是: SCTP堆栈:lk-SCTP-1.0.16(通过Red Hat Enterprise L

我想使用Lksctp linux开发一个M3UA关联,我也认为使用openSS7 M3UA是可能的,但我不知道如何做到这一点。还有什么想法吗???
感谢您的帮助。

我认为最好使用Mobicents jSS7

您可以将lk sctp与jdk-7(及更高版本)上的Netty framework结合使用来实现M3UA(RFC 4666)。 Netty-4.0.25-FINAL是支持SCTP的稳定版本

因此,组合是:

  • SCTP堆栈:lk-SCTP-1.0.16(通过Red Hat Enterprise Linux Server 6.5版(圣地亚哥))
  • JDK-7或以上
  • 内蒂-4.0.25-决赛
以及您的应用程序。 SCTPClientHandler的示例代码可以是:

    public class SctpClientHandler extends ChannelDuplexHandler {
@Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt)
            throws Exception {
        SctpChannel sctpChannel = (SctpChannel) ctx.channel();
        if (evt instanceof AssociationChangeNotification) {
            AssociationChangeNotification associationChangeNotification = (AssociationChangeNotification) evt;
            switch (associationChangeNotification.event()) {
            case CANT_START:
            //Do something
            break;
            case COMM_LOST:
           //
            case COMM_UP:


  } else if (evt instanceof PeerAddressChangeNotification) {
                PeerAddressChangeNotification peerAddressChangeNotification = (PeerAddressChangeNotification) evt;
            int associationId = sctpChannel.association().associationID();
            switch (peerAddressChangeNotification.event()) {
            case ADDR_ADDED:
}
} else if (evt instanceof SendFailedNotification) {
}

@Override
    public void channelRead(ChannelHandlerContext ctx, Object msg)
            throws Exception {
        SctpMessage sctpMessage = (SctpMessage) msg;
        // Check if this is a M3UA message
        if (sctpMessage.protocolIdentifier() == 3) {
            // Send upstream - to M3UA
            ctx.fireChannelRead(sctpMessage);
        }

    }

public void send(ByteBuf buffer, int streamId) {
        SctpMessage message = new SctpMessage(3, streamId, buffer);
        ctx.writeAndFlush(message);
    }

public void send(ByteBuf buffer, int streamId, SocketAddress remoteAddress) {
        MessageInfo msgInfo = MessageInfo.createOutgoing(remoteAddress,
                streamId);
        SctpMessage message = new SctpMessage(msgInfo, buffer);
        ctx.writeAndFlush(message);
    }

public void send(ByteBuf buffer, int streamId, boolean unOrderedFlag) {
        SctpMessage message = new SctpMessage(3, streamId, buffer);
        message.messageInfo().unordered(unOrderedFlag);
        ctx.writeAndFlush(message);

    }

public void send(ByteBuf buffer, int streamId, SocketAddress remoteAddress,
            boolean unOrderedFlag) {
        MessageInfo msgInfo = MessageInfo.createOutgoing(remoteAddress,
                streamId);
        msgInfo.unordered(unOrderedFlag);
        SctpMessage message = new SctpMessage(msgInfo, buffer);
        ctx.writeAndFlush(message);
    }
    }
还可以如上所述创建SCTPServerHandler

用于初始化引导:

bootstrap.group(worker)
            .channel(NioSctpChannel.class)
             .option(SctpChannelOption.SCTP_NODELAY,true)
              .handler(new ChannelInitializer<SctpChannel>() {
                @Override
                public void initChannel(SctpChannel ch) throws Exception {
                    ch.pipeline().addLast(
                            new SctpClientHandler());
                    ch.pipeline().addLast(new M3UAAspHandler());
                }
            });
bootstrap.group(worker)
.channel(NioSctpChannel.class)
.option(SctpChannelOption.SCTP_NODELAY,true)
.handler(新的通道初始值设定项(){
@凌驾
public void initChannel(SctpChannel ch)引发异常{
ch.pipeline().addLast(
新的SctpClientHandler());
ch.pipeline().addLast(新的M3UAsHandler());
}
});
这种组合的规模也很大。快乐编码