// Path: sctp-api/src/main/java/org/mobicents/protocols/api/IpChannelType.java
// public enum IpChannelType {
// 	SCTP(0, "SCTP"), TCP(1, "TCP");
// 
// 	int code;
// 	String type;
// 
// 	private IpChannelType(int code, String type) {
// 		this.code = code;
// 		this.type = type;
// 
// 	}
// 
// 	public int getCode() {
// 		return this.code;
// 	}
// 
// 	public String getType() {
// 		return type;
// 	}
// 
// 	public static IpChannelType getInstance(int code) {
// 		switch (code) {
// 		case 0:
// 			return IpChannelType.SCTP;
// 		case 1:
// 			return IpChannelType.TCP;
// 		}
// 
// 		return null;
// 	}
// 
// 	public static IpChannelType getInstance(String type) {
// 		if (type.equalsIgnoreCase("SCTP")) {
// 			return SCTP;
// 		} else if (type.equalsIgnoreCase("TCP")) {
// 			return TCP;
// 		}
// 		
// 		return null;
// 	}
// }


import java.net.InetSocketAddress;
import org.apache.log4j.Logger;
import org.mobicents.protocols.api.IpChannelType;
import io.netty.channel.ChannelHandlerContext;

    @Override
    public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("channelRegistered event: association=%s", this.association));
        }
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("channelActive event: association=%s", this.association));
        }

        this.ctx = ctx;
        this.channel = ctx.channel();
        this.association.setChannelHandler(this);

        String host = null;
        int port = 0;
        InetSocketAddress sockAdd = ((InetSocketAddress) channel.remoteAddress());
        if (sockAdd != null) {
            host = sockAdd.getAddress().getHostAddress();
            port = sockAdd.getPort();
        }

        if (logger.isInfoEnabled()) {
            logger.info(String.format("Association=%s connected to host=%s port=%d", association.getName(), host, port));
        }

// Path: sctp-api/src/main/java/org/mobicents/protocols/api/IpChannelType.java
// public enum IpChannelType {
// 	SCTP(0, "SCTP"), TCP(1, "TCP");
// 
// 	int code;
// 	String type;
// 
// 	private IpChannelType(int code, String type) {
// 		this.code = code;
// 		this.type = type;
// 
// 	}
// 
// 	public int getCode() {
// 		return this.code;
// 	}
// 
// 	public String getType() {
// 		return type;
// 	}
// 
// 	public static IpChannelType getInstance(int code) {
// 		switch (code) {
// 		case 0:
// 			return IpChannelType.SCTP;
// 		case 1:
// 			return IpChannelType.TCP;
// 		}
// 
// 		return null;
// 	}
// 
// 	public static IpChannelType getInstance(String type) {
// 		if (type.equalsIgnoreCase("SCTP")) {
// 			return SCTP;
// 		} else if (type.equalsIgnoreCase("TCP")) {
// 			return TCP;
// 		}
// 		
// 		return null;
// 	}
// }


// Path: sctp-impl/src/main/java/org/mobicents/protocols/sctp/netty/NettySctpClientHandler.java
import java.net.InetSocketAddress;
import org.apache.log4j.Logger;
import org.mobicents.protocols.api.IpChannelType;
import io.netty.channel.ChannelHandlerContext;


    @Override
    public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("channelRegistered event: association=%s", this.association));
        }
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("channelActive event: association=%s", this.association));
        }

        this.ctx = ctx;
        this.channel = ctx.channel();
        this.association.setChannelHandler(this);

        String host = null;
        int port = 0;
        InetSocketAddress sockAdd = ((InetSocketAddress) channel.remoteAddress());
        if (sockAdd != null) {
            host = sockAdd.getAddress().getHostAddress();
            port = sockAdd.getPort();
        }

        if (logger.isInfoEnabled()) {
            logger.info(String.format("Association=%s connected to host=%s port=%d", association.getName(), host, port));
        }

        if (association.getIpChannelType() == IpChannelType.TCP) {