use of org.jsmpp.session.BindParameter 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.BindParameter 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.BindParameter in project camel by apache.
the class SmppConsumerTest method addressRangeFromConfigurationIsUsed.
@Test
public void addressRangeFromConfigurationIsUsed() throws Exception {
resetToNice(endpoint, session);
configuration.setAddressRange("(111*|222*|333*)");
expect(session.connectAndBind("localhost", new Integer(2775), new BindParameter(BindType.BIND_RX, "smppclient", "password", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "(111*|222*|333*)"))).andReturn("1");
replay(endpoint, processor, session);
consumer.doStart();
verify(endpoint, processor, session);
}
use of org.jsmpp.session.BindParameter in project camel by apache.
the class SmppConsumerTest method doStartShouldStartANewSmppSession.
@Test
public void doStartShouldStartANewSmppSession() throws Exception {
resetToNice(endpoint, session);
expect(endpoint.getConnectionString()).andReturn("smpp://smppclient@localhost:2775").times(2);
//expectation
session.setEnquireLinkTimer(5000);
//expectation
session.setTransactionTimer(10000);
session.addSessionStateListener(isA(SessionStateListener.class));
//expectation
session.setMessageReceiverListener(isA(MessageReceiverListener.class));
expect(session.connectAndBind("localhost", new Integer(2775), new BindParameter(BindType.BIND_RX, "smppclient", "password", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, ""))).andReturn("1");
expect(endpoint.getConnectionString()).andReturn("smpp://smppclient@localhost:2775");
replay(endpoint, processor, session);
consumer.doStart();
verify(endpoint, processor, session);
}
Aggregations