Search in sources :

Example 1 with BaseBindResp

use of com.zx.sms.codec.smpp.msg.BaseBindResp in project SMSGate by Lihuanghe.

the class SMPPSessionLoginManager method doLoginSuccess.

@Override
protected void doLoginSuccess(ChannelHandlerContext ctx, EndpointEntity entity, Object message) {
    // 发送bind请求
    SMPPEndpointEntity smppentity = (SMPPEndpointEntity) entity;
    BaseBind bind = (BaseBind) message;
    BaseBindResp resp = (BaseBindResp) bind.createResponse();
    resp.setSystemId(bind.getSystemId());
    ctx.channel().writeAndFlush(resp);
}
Also used : SMPPEndpointEntity(com.zx.sms.connect.manager.smpp.SMPPEndpointEntity) BaseBindResp(com.zx.sms.codec.smpp.msg.BaseBindResp) BaseBind(com.zx.sms.codec.smpp.msg.BaseBind)

Example 2 with BaseBindResp

use of com.zx.sms.codec.smpp.msg.BaseBindResp in project SMSGate by Lihuanghe.

the class SMPPSessionLoginManager method validServermsg.

@Override
protected int validServermsg(Object message) {
    if (message instanceof BaseBindResp) {
        BaseBindResp resp = (BaseBindResp) message;
        Tlv scInterfaceVersion = resp.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
        if (scInterfaceVersion != null) {
            try {
                byte tempInterfaceVersion = scInterfaceVersion.getValueAsByte();
                logger.info("Server support version : {}", tempInterfaceVersion);
            } catch (TlvConvertException e) {
                logger.warn("Unable to convert sc_interface_version to a byte value: {}", e.getMessage());
            }
        }
        return resp.getCommandStatus();
    } else {
        logger.error("connect msg type error : {}", message);
        return 9;
    }
}
Also used : TlvConvertException(com.zx.sms.codec.smpp.TlvConvertException) BaseBindResp(com.zx.sms.codec.smpp.msg.BaseBindResp) Tlv(com.zx.sms.codec.smpp.Tlv)

Aggregations

BaseBindResp (com.zx.sms.codec.smpp.msg.BaseBindResp)2 Tlv (com.zx.sms.codec.smpp.Tlv)1 TlvConvertException (com.zx.sms.codec.smpp.TlvConvertException)1 BaseBind (com.zx.sms.codec.smpp.msg.BaseBind)1 SMPPEndpointEntity (com.zx.sms.connect.manager.smpp.SMPPEndpointEntity)1