Search in sources :

Example 1 with SMPPSession

use of org.jsmpp.session.SMPPSession in project camel by apache.

the class SmppConsumer method createSession.

private SMPPSession createSession() throws IOException {
    SMPPSession session = createSMPPSession();
    session.setEnquireLinkTimer(configuration.getEnquireLinkTimer());
    session.setTransactionTimer(configuration.getTransactionTimer());
    session.addSessionStateListener(internalSessionStateListener);
    session.setMessageReceiverListener(messageReceiverListener);
    session.connectAndBind(this.configuration.getHost(), this.configuration.getPort(), new BindParameter(BindType.BIND_RX, this.configuration.getSystemId(), this.configuration.getPassword(), this.configuration.getSystemType(), TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, configuration.getAddressRange()));
    return session;
}
Also used : BindParameter(org.jsmpp.session.BindParameter) SMPPSession(org.jsmpp.session.SMPPSession)

Example 2 with SMPPSession

use of org.jsmpp.session.SMPPSession in project camel by apache.

the class AbstractSmppCommandTest method setUp.

@Before
public void setUp() {
    session = new SMPPSession();
    config = new SmppConfiguration();
    command = new AbstractSmppCommand(session, config) {

        @Override
        public void execute(Exchange exchange) throws SmppException {
        }
    };
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) SMPPSession(org.jsmpp.session.SMPPSession) Before(org.junit.Before)

Example 3 with SMPPSession

use of org.jsmpp.session.SMPPSession in project camel by apache.

the class SmppBindingTest method createSmppDataSmCommand.

@Test
public void createSmppDataSmCommand() {
    SMPPSession session = new SMPPSession();
    Exchange exchange = new DefaultExchange(new DefaultCamelContext());
    exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
    SmppCommand command = binding.createSmppCommand(session, exchange);
    assertTrue(command instanceof SmppDataSmCommand);
}
Also used : Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) SMPPSession(org.jsmpp.session.SMPPSession) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Test(org.junit.Test)

Example 4 with SMPPSession

use of org.jsmpp.session.SMPPSession in project camel by apache.

the class SmppBindingTest method createSmppSubmitMultiCommand.

@Test
public void createSmppSubmitMultiCommand() {
    SMPPSession session = new SMPPSession();
    Exchange exchange = new DefaultExchange(new DefaultCamelContext());
    exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
    SmppCommand command = binding.createSmppCommand(session, exchange);
    assertTrue(command instanceof SmppSubmitMultiCommand);
}
Also used : Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) SMPPSession(org.jsmpp.session.SMPPSession) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Test(org.junit.Test)

Example 5 with SMPPSession

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);
    }
}
Also used : BindParameter(org.jsmpp.session.BindParameter) SMPPSession(org.jsmpp.session.SMPPSession) IOException(java.io.IOException)

Aggregations

SMPPSession (org.jsmpp.session.SMPPSession)15 Exchange (org.apache.camel.Exchange)8 DefaultExchange (org.apache.camel.impl.DefaultExchange)7 Test (org.junit.Test)7 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)6 BindParameter (org.jsmpp.session.BindParameter)4 IOException (java.io.IOException)3 OutboundMessageResponse (org.hisp.dhis.outboundmessage.OutboundMessageResponse)2 Date (java.util.Date)1 AxisFault (org.apache.axis2.AxisFault)1 OutboundMessage (org.hisp.dhis.outboundmessage.OutboundMessage)1 InvalidResponseException (org.jsmpp.InvalidResponseException)1 PDUException (org.jsmpp.PDUException)1 DataSm (org.jsmpp.bean.DataSm)1 OptionalParameter (org.jsmpp.bean.OptionalParameter)1 NegativeResponseException (org.jsmpp.extra.NegativeResponseException)1 ResponseTimeoutException (org.jsmpp.extra.ResponseTimeoutException)1 DataSmResult (org.jsmpp.session.DataSmResult)1 Before (org.junit.Before)1