use of org.jsmpp.session.SMPPSession in project wso2-axis2-transports by wso2.
the class SMPPImplManager method start.
public void start() {
inSession = new SMPPSession();
try {
inSession.connectAndBind(smppTransportInDetails.getHost(), smppTransportInDetails.getPort(), new BindParameter(BindType.BIND_RX, smppTransportInDetails.getSystemId(), smppTransportInDetails.getPassword(), smppTransportInDetails.getSystemType(), TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
SMPPListener listener = new SMPPListener(smsInManeger);
inSession.setMessageReceiverListener(listener);
stop = false;
System.out.println(" [Axis2] bind and connect to " + smppTransportInDetails.getHost() + " : " + smppTransportInDetails.getPort() + " on SMPP Transport");
} catch (IOException e) {
log.error("Unable to conncet" + e);
}
}
use of org.jsmpp.session.SMPPSession in project camel by apache.
the class SmppProducer method createSession.
private SMPPSession createSession() throws IOException {
LOG.debug("Connecting to: {}...", getEndpoint().getConnectionString());
SMPPSession session = createSMPPSession();
session.setEnquireLinkTimer(this.configuration.getEnquireLinkTimer());
session.setTransactionTimer(this.configuration.getTransactionTimer());
session.addSessionStateListener(internalSessionStateListener);
session.connectAndBind(this.configuration.getHost(), this.configuration.getPort(), new BindParameter(BindType.BIND_TX, this.configuration.getSystemId(), this.configuration.getPassword(), this.configuration.getSystemType(), TypeOfNumber.valueOf(configuration.getTypeOfNumber()), NumberingPlanIndicator.valueOf(configuration.getNumberingPlanIndicator()), ""));
LOG.info("Connected to: {}", getEndpoint().getConnectionString());
return session;
}
use of org.jsmpp.session.SMPPSession in project camel by apache.
the class SmppBindingTest method createSmppSubmitSmCommand.
@Test
public void createSmppSubmitSmCommand() {
SMPPSession session = new SMPPSession();
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
SmppCommand command = binding.createSmppCommand(session, exchange);
assertTrue(command instanceof SmppSubmitSmCommand);
}
use of org.jsmpp.session.SMPPSession in project camel by apache.
the class SmppBindingTest method createSmppCancelSmCommand.
@Test
public void createSmppCancelSmCommand() {
SMPPSession session = new SMPPSession();
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
exchange.getIn().setHeader(SmppConstants.COMMAND, "CancelSm");
SmppCommand command = binding.createSmppCommand(session, exchange);
assertTrue(command instanceof SmppCancelSmCommand);
}
use of org.jsmpp.session.SMPPSession in project camel by apache.
the class MessageReceiverListenerImplTest method onAcceptDataSmSuccess.
@Test
public void onAcceptDataSmSuccess() throws Exception {
SMPPSession session = createMock(SMPPSession.class);
DataSm dataSm = createMock(DataSm.class);
Exchange exchange = createMock(Exchange.class);
OptionalParameter[] optionalParameters = new OptionalParameter[] {};
expect(endpoint.createOnAcceptDataSm(dataSm, "1")).andReturn(exchange);
processor.process(exchange);
expect(exchange.getException()).andReturn(null);
expect(dataSm.getOptionalParameters()).andReturn(optionalParameters);
replay(endpoint, processor, exceptionHandler, session, dataSm, exchange);
DataSmResult result = listener.onAcceptDataSm(dataSm, session);
verify(endpoint, processor, exceptionHandler, session, dataSm, exchange);
assertEquals("1", result.getMessageId());
assertSame(optionalParameters, result.getOptionalParameters());
}
Aggregations