Search in sources :

Example 1 with TlvConvertException

use of com.zx.sms.codec.smpp.TlvConvertException 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

Tlv (com.zx.sms.codec.smpp.Tlv)1 TlvConvertException (com.zx.sms.codec.smpp.TlvConvertException)1 BaseBindResp (com.zx.sms.codec.smpp.msg.BaseBindResp)1