Git Product home page Git Product logo

Comments (9)

ihusejnovic avatar ihusejnovic commented on July 19, 2024

Try:

smpp.tlvs['abc42xyz_operator'] = {
    id: 0x1520,
    type: smpp.types.tlv.string
};

session.submit_sm({
                destination_addr: '8475551212',
                short_message: 'Hello!',
                abc42xyz_operator: 'CUSTMR_13914533_TESTIPC_111_D'    
           }, function(pdu) {
                if (pdu.command_status == 0) {
                    // Message successfully sent
                    console.log(pdu.message_id);
                }
           });

from node-smpp.

yepher avatar yepher commented on July 19, 2024

Yes, you were exactly right. Thank you. I've seen question here and there for how to do this. I will add an example to the README and send a pull request. Use it if you want.

from node-smpp.

farhadi avatar farhadi commented on July 19, 2024

The correct way to add a custom TLV is by using addTLV method like this:

smpp.addTLV('abc42xyz_operator', {
    id: 0x1520,
    type: smpp.types.tlv.string
});

from node-smpp.

yepher avatar yepher commented on July 19, 2024

Do you still need this in the sumit_sm body?

abc42xyz_operator: 'CUSTMR_13914533_TESTIPC_111_D' 

from node-smpp.

farhadi avatar farhadi commented on July 19, 2024

Yes, you need to use addTLV once to tell smpp module how to handle a abc42xyz_operator TLV parameter. And then you can use this TLV parameter in your PDUs e.g. in a submit_sm.

from node-smpp.

yepher avatar yepher commented on July 19, 2024

Since you said to only include once is this what you mean?

var smpp = require('smpp');
smpp.addTLV('abc42xyz_operator', {
    id: 0x1520,
    type: smpp.types.tlv.string
});
var session = smpp.connect('smpp_server', 2775);
session.bind_transceiver({
    system_id: 'smppclient1',
    password: 'password'
}, function(pdu) {
    if (pdu.command_status == 0) {
        // Successfully bound
        session.submit_sm({
            destination_addr: '8475551212',
            short_message: 'Hello!'
            abc42xyz_operator: 'CUSTMR_13914533_TESTIPC_111_D'    
        }, function(pdu) {
            if (pdu.command_status == 0) {
                // Message successfully sent
                console.log(pdu.message_id);
            }
        });
    }
});

Originally I was doing the tlv setup in the just before session_submit_sm but I think based on your feedback that is wrong.

from node-smpp.

farhadi avatar farhadi commented on July 19, 2024

Yes, that is exactly how addTLV method should be used.

from node-smpp.

yepher avatar yepher commented on July 19, 2024

Thanks @farhadi

By the way this is a very nice tool you have built.

from node-smpp.

farhadi avatar farhadi commented on July 19, 2024

@yepher Thanks for your interest.

from node-smpp.

Related Issues (20)

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.