@Override public SMPPSession create() throws Exception { // SMSC connection settings final String host = JiveGlobals.getProperty( "sms.smpp.host", "localhost" ); final int port = JiveGlobals.getIntProperty( "sms.smpp.port", 2775 ); final String systemId = JiveGlobals.getProperty( "sms.smpp.systemId" ); final String password = JiveGlobals.getProperty( "sms.smpp.password" ); final String systemType = JiveGlobals.getProperty( "sms.smpp.systemType" ); // Settings that apply to 'receiving' SMS. Should not apply to this implementation, as we're not receiving anything.. final TypeOfNumber receiveTon = JiveGlobals.getEnumProperty( "sms.smpp.receive.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN ); final NumberingPlanIndicator receiveNpi = JiveGlobals.getEnumProperty( "sms.smpp.receive.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN ); Log.debug( "Creating a new sesssion (host: '{}', port: '{}', systemId: '{}'.", host, port, systemId ); final SMPPSession session = new SMPPSession(); session.connectAndBind( host, port, new BindParameter( BindType.BIND_TX, systemId, password, systemType, receiveTon, receiveNpi, null ) ); Log.debug( "Created a new session with ID '{}'.", session.getSessionId() ); return session; }
@Override public SMPPSession create() throws Exception { // SMSC connection settings final String host = JiveGlobals.getProperty( "sms.smpp.host", "localhost" ); final int port = JiveGlobals.getIntProperty( "sms.smpp.port", 2775 ); final String systemId = JiveGlobals.getProperty( "sms.smpp.systemId" ); final String password = JiveGlobals.getProperty( "sms.smpp.password" ); final String systemType = JiveGlobals.getProperty( "sms.smpp.systemType" ); // Settings that apply to 'receiving' SMS. Should not apply to this implementation, as we're not receiving anything.. final TypeOfNumber receiveTon = JiveGlobals.getEnumProperty( "sms.smpp.receive.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN ); final NumberingPlanIndicator receiveNpi = JiveGlobals.getEnumProperty( "sms.smpp.receive.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN ); Log.debug( "Creating a new sesssion (host: '{}', port: '{}', systemId: '{}'.", host, port, systemId ); final SMPPSession session = new SMPPSession(); session.connectAndBind( host, port, new BindParameter( BindType.BIND_TX, systemId, password, systemType, receiveTon, receiveNpi, null ) ); Log.debug( "Created a new session with ID '{}'.", session.getSessionId() ); return session; }