Comments (9)
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.
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.
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.
Do you still need this in the sumit_sm body?
abc42xyz_operator: 'CUSTMR_13914533_TESTIPC_111_D'
from node-smpp.
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.
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.
Yes, that is exactly how addTLV method should be used.
from node-smpp.
Thanks @farhadi
By the way this is a very nice tool you have built.
from node-smpp.
@yepher Thanks for your interest.
from node-smpp.
Related Issues (20)
- Pdu command length error HOT 2
- Support for user-defined TLVs
- Addition of more example on node-smpp usage HOT 10
- error on send pdu HOT 2
- Command status codes related to official SMPP Spec Error Codes
- Getting invalid password response from SMPP Server HOT 1
- Node client crash with ECONNRESET HOT 5
- Couldn't recieve SMS from SMSC HOT 7
- Differntiate between incoming message and an incoming message that gets triggered after a message is sent using smpp HOT 2
- Error while connecting to server PDU_STATUS 15 HOT 3
- connection issue when setting up the smpp server. HOT 6
- Getting esm_class === 4 for every sent SMS HOT 2
- [Support] total received DLR and Submit response vs total sent SMS
- message_payload or UDH header HOT 1
- Client Not reciving DLR Report
- Only one message recieved when multiple messages are sent. HOT 5
- couldn't perform submit_sm although there is a binding
- Rebind on reconnecting to smsc is not working
- Support for Session Pooling.
- How to handle bind_transrecivier command status 5 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-smpp.