Giter Club home page Giter Club logo

melroselabs / smpp-smsc-simulator Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 29.0 35 KB

SMPP SMSC Simulator from Melrose Labs. Simulate SMSCs (short message service centres) and SMPP SMS gateways, and simulated SMS message delivery. Code represents old version of existing SMSC Simulator service available online.

Home Page: https://melroselabs.com/services/smsc-simulator/

License: MIT License

C++ 99.79% Dockerfile 0.21%
smpp smpp-protocol smpp-server smpp-smsc-simulator smsc

smpp-smsc-simulator's People

Contributors

ml-markhay avatar romank0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smpp-smsc-simulator's Issues

Can I disable output to console?

Is there any command line switch to disable output to console? While doing performance testing, writing to console has a cost.

simulator closes smpp connection after sm_submit

Describe the bug
Hello, I tested BIND TRANSCEIVER and ENQUIRE_LINK and both are replied succesfuly, but when I send SUBMIT_SM, simulator closes TCP connection (RST) inmediately.

To Reproduce

  1. Connection with ESME application

image

  1. Send SUBMIT_SM to simulator

image

Expected behavior
Simulator should return SUBMIT_SM response with Message ID. Otherwise, if some SMPP field is incorrect, simulator should send some SMPP error instead of closing TCP connection.

Packet capture
Attached is a SUBMIT_SM and TCP RST example:
submit_error.zip

Additional context
Tested with docker on Ubuntu 18 and g++ build on RHEL 7
ESME application succesfully tested with other SMSCs and with Melrose Labs online simulator.

Missing System ID and Password

Describe the bug
There is no System ID & Password specified. Receive 'bind_transceiver_resp :Invalid System ID' from smpplib client.

To Reproduce
Steps to reproduce the behavior:

  1. docker-compose up
  2. Test using SMPPLib https://pypi.org/project/smpplib/
  3. Leave System ID and Password empty

Expected behavior
Bind respond from SMSC

Additional context
Perhaps the System ID and password can be set somewhere?

When I used Inbound MO SMS, I found that the message id empty received

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Packet capture
If applicable, add a packet capture to help show your problem.

Additional context
Add any other context about the problem here.

submit_multi support

Describe the bug
I tried to test submi_multi for bulk SMS and failed, is it supported in this simulator?

I tried with nodejs

const smpp = require('smpp');

const session = smpp.connect({url: 'smpp://127.0.0.1:2775"', auto_enquire_link_period: 10000,});

session.bind_transceiver({system_id: "Y9Clav9OoiWu3I0", password: "wmpvI02g"}, function (pdu) {
    if (pdu.command_status === 0) { //Successfully bound
        console.log("Successfully bound!");
        session.submit_sm({
            destination_addr: "12345678911", // The destination phone number you want to send a message to
            source_addr_ton: 1, // Type of number of the source address
            source_addr_npi: 0, // 0 = Unknown, 1 = ISDN, 3 = Data, 4 = Telex, 5 = SMS, 6 = Radio, 7 = Fax, 8 = Videotelephony
            dest_addr_ton: 1, // Type of number of the destination phone number
            dest_addr_npi: 1, // 0 = Unknown, 1 = ISDN, 3 = Data, 4 = Telex, 5 = SMS, 6 = Radio, 7 = Fax, 8 = Videotelephony
            source_addr: '9929',       // The Sender ID or Address, This will be displayed to the destination phone number
            registered_delivery: 1, // Set registered delivery (0 = no, 1 = yes)
           // message_id: ID, // Message ID
            short_message: "Hello world!", 
            data_coding: 8
        }, function(pdu) {
            if(pdu.command_status === 0){
                console.log("The message successfully sent!");
                session.close();
            }else {
                console.log("Message didn't sent");
                session.close();
            }
        })
    }
})




//Error Handling

session.on('error', (e) => {
    if(e.code === 'ETIMEOUT') {
        console.log("Connection to SMS-C Timeout");
    }else if(e.code === 'ECONNREFUSED'){
        console.log("Connection to SMS-C Refused")
    }else if(e.code === 'EAI_AGAIN'){
        console.log("Connection to internet is lost!");
    }else {
        console.log(`There is something wrong connecting to SMS-C ${e.code}` );
    }
})


 

Build failed on macOS Catalina.

build info:

septs@CBDesktop02 ~/Projects/go-smpp (master*) $ g++ -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

build log:

septs@CBDesktop02 ~/Projects/go-smpp (master*) $ g++ ./smscsimulator.cpp -o MLSMSCSimulator
./smscsimulator.cpp:121:46: error: a space is required between consecutive right angle brackets (use '> >')
    typedef map<uint64_t/*time*/,list<Message>> MessageQueue;
                                             ^~
                                             > >
./smscsimulator.cpp:188:29: error: expected expression
            ret = mq.insert({timeDeliver,msgList});
                            ^
./smscsimulator.cpp:304:31: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    CmdStrings cmdStrings[34] = {
                              ^
./smscsimulator.cpp:407:39: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    const int max_command_body_length = 1024;
                                      ^
./smscsimulator.cpp:409:16: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    bool debug = false;
               ^
./smscsimulator.cpp:411:24: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    SMPPSocket* socket = NULL;
                       ^
./smscsimulator.cpp:430:39: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    PDUHeader command_received_header = {PV_INVALID,0,0,0,0};
                                      ^
./smscsimulator.cpp:431:35: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    PDUBody command_received_body = {false,NULL};
                                  ^
./smscsimulator.cpp:434:29: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    int enquire_link_period = 0; // seconds
                            ^
./smscsimulator.cpp:635:29: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    long sequence_number_in = -1;
                            ^
./smscsimulator.cpp:636:30: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    long sequence_number_out = 1;
                             ^
./smscsimulator.cpp:637:34: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    uint64_t lastPDUFromESMETime = 0;
                                 ^
./smscsimulator.cpp:638:37: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    uint64_t enquireLinkRespPending = 0;
                                    ^
./smscsimulator.cpp:639:26: warning: in-class initialization of non-static data member is a C++11 extension
      [-Wc++11-extensions]
    uint64_t closingTime = 0;
                         ^
./smscsimulator.cpp:670:24: warning: conversion from string literal to 'char *' is deprecated
      [-Wc++11-compat-deprecated-writable-strings]
            logCommand("session aborted", "--");
                       ^
./smscsimulator.cpp:734:67: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
        if ((system_id.length()>0) && ((bindState == SMPPSession::BindState::BS_TRX)||(bindState == SMPPSess...
                                                                  ^
./smscsimulator.cpp:734:114: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
  ...&& ((bindState == SMPPSession::BindState::BS_TRX)||(bindState == SMPPSession::BindState::BS_RX)))
                                                                                   ^
./smscsimulator.cpp:808:40: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
        if ((bindState == SMPPSession::BindState::BS_TRX)||(bindState == SMPPSession::BindState::BS_RX))
                                       ^
./smscsimulator.cpp:808:87: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
        if ((bindState == SMPPSession::BindState::BS_TRX)||(bindState == SMPPSession::BindState::BS_RX))
                                                                                      ^
./smscsimulator.cpp:857:43: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
            if (bindState == SMPPSession::BindState::BS_TRX)
                                          ^
./smscsimulator.cpp:911:48: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                if ( bindState != SMPPSession::BindState::BS_NONE ) // PROTOCOL must be in unbound state fo...
                                               ^
./smscsimulator.cpp:943:86: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        if (ClientConfig::instance().is(esme_system_id,ClientConfig::ConfigEntry::BINDRESP_W...
                                                                                     ^
./smscsimulator.cpp:957:95: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        if ( cmdid == SMPP::CmdID::BindTransceiver ) bindState = SMPPSession::BindState::BS_TRX;
                                                                                              ^
./smscsimulator.cpp:958:100: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        else if ( cmdid == SMPP::CmdID::BindTransmitter ) bindState = SMPPSession::BindState::BS_TX;
                                                                                                   ^
./smscsimulator.cpp:959:97: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        else if ( cmdid == SMPP::CmdID::BindReceiver ) bindState = SMPPSession::BindState::BS_RX;
                                                                                                ^
./smscsimulator.cpp:960:55: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        else bindState = SMPPSession::BindState::BS_NONE;
                                                      ^
./smscsimulator.cpp:967:50: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                        bindState = SMPPSession::BindState::BS_NONE;
                                                 ^
./smscsimulator.cpp:973:47: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                if (bindState != SMPPSession::BindState::BS_NONE)
                                              ^
./smscsimulator.cpp:976:46: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                    bindState = SMPPSession::BindState::BS_NONE;
                                             ^
./smscsimulator.cpp:997:48: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                if ((bindState == SMPPSession::BindState::BS_NONE)||(bindState == SMPPSession::BindState::BS_RX))
                                               ^
./smscsimulator.cpp:997:96: warning: use of enumeration in a nested name specifier is a C++11 extension
      [-Wc++11-extensions]
                if ((bindState == SMPPSession::BindState::BS_NONE)||(bindState == SMPPSession::BindState::BS_RX))
                                                                                               ^
29 warnings and 2 errors generated.

Inbound MO SMS Tool to send a long message

Describe the bug

When I use the Inbound MO SMS Tool to send a long message to the application, I can receive multiple short messages, but the OptionalParameters is empty

�Inbound MO SMS Tool submit success

Submit SUCCESS  00025812 > 99025812  01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

I can receive two message

Received SMPP message PDUHeader(201, 00000005, 00000000, 2) 00 01 01 30 30 30 32 35 38 31 32 00 01 01 39 39 30 32 35 38 31 32 00 00 00 00 00 00 00 00 00 00 98 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31

text: 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
Received SMPP message PDUHeader(157, 00000005, 00000000, 3) 00 01 01 30 30 30 32 35 38 31 32 00 01 01 39 39 30 32 35 38 31 32 00 00 00 00 00 00 00 00 00 00 6c 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39

text: 234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

But the optional parameters is empty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.