Comments (10)
If your broker support 2-ways message, you will receive it on deliver_sm
PDU.
I think that is something more related to your user-case/business logic then the lib feature itself.
WIth that you do whatever you want such as some auto-reply rule. A small example of how to do it:
session.on('deliver_sm', (pdu) => {
const { short_message, destination_addr, esm_class } = pdu
if(esm_class !== 4 && short_message.message == 'hi') {
session.submit_sm({
destination_addr,
short_message: 'Welcome'
});
}
});
from node-smpp.
On deliver_sm
PDU you will receive the further data of DLR of your provider (delivery report) from messages that you have sent by submit_sm
.
The MO (message originator - the arrived messages) your provider will sent you by the same PDU, the deliver_sm
.
These messages you will receive every time that one destination answer some of message that you sent or when they sent directly for your number that you have with your provider.
This is the "default" scenario but is always good ask your provider by which PDU they will sent the MO data.
from node-smpp.
Probably on both.
7929 the MO will be related to some MT that you sent (like one answer)
7233 the MO that the originator send for you regardless of a MT. (like one request)
But these are assumptions based on what i've already saw outthere.
So the best hint that i can give to you about it is check with them how it will works the flow of these shortcodes that they provide to you 😄
from node-smpp.
Have in mind that the SMPP are responsible just for send and/or receive SMS messages. Nothing else.
Any additional control like auto-reply, count users, etc, etc you will need to develop your own solution rules with caching, dabatases and so on.
would you mind adding the code snippet you shared above to Readme just incase...
As the code snippet is to particular with your user-case imho it might not be relevant made one PR with this suggestion, but Im glad that were helpfull for you 😄
from node-smpp.
It turned out I was using an incorrect password although the error message is misleading.
from node-smpp.
@guicuton thank you so much for the support,
Something I couldn't understand is, isn't deliver_sm
PDU sent from SMSC after submit_sm
request sent to SMPP Server? shouldn't my SMPP Client listen for any arrived SMS?
I am sorry am new to SMPP world.
from node-smpp.
They have already said that they will invoke the deliver_sm API to send MO SMS messages to
the App(SMPP Client), therefore I think the scenario you have specified is correct.
Can I please add something that's a little bit confusing related to MO and MT, they have already provided me e.g 7922 as MT and 7233 as MO.
when I send I will use MT code (7922) as a source address right? and use MO (7233) as a destination address for SMSC (SMPP Server) will send SMS to my app, or in which my app receives SMS?
from node-smpp.
Thanks a lot, I will do that they are not that cooperative tbh, they just sent me a document that is identical to the SMPP V5 specification 😄.
I have no idea how I get the total number of subscribers from my App, I don't think SMPP can provide such implementation.
But I will try my best. THank you so much for the support, would you mind adding the code snippet you shared above to Readme just incase...
from node-smpp.
Have in mind that the SMPP are responsible just for send and/or receive SMS messages. Nothing else.
Any additional control like auto-reply, count users, etc, etc you will need to develop your own solution rules with caching, dabatases and so on.
This is good info thank you so much, now I am getting the idea. I thought the SMSC will provide such info but I understand now.
Thanks again.
from node-smpp.
Hello @guicuton I am sorry to bother you, but I don't where else I should go, there is no great forum regarding SMPP.
I was trying to connect to a real SMSC and I keep getting command_status=14 here is my code:
var smpp = require('smpp');
var session = smpp.connect({
url: 'smpp://HOST_NAME:PORT',
auto_enquire_link_period: 10000,
debug: true
}, function() {
session.bind_transceiver({
system_id: 'ID', //Some number
password: 'password', //8
interface_version: '0x34',
system_type: '0x00',
addr_ton: '0x00',
addr_npi: '0x00',
address_range: '0x00'
}, function(pdu) {
if (pdu.command_status === 0) {
// Successfully bound
console.log("Successfully Created Bound");
}else if(pdu.command_status === 14){
console.log("Invalid Password");
}
});
});
session.on('deliver_sm', (pdu) => {
const { short_message, destination_addr, esm_class} = pdu;
if(esm_class !== 4 && short_message.message === 'ok') { //Indicates Message Type and enhanced network services, if it's 4 then it's a delivery receipt >
console.log("Recieved SMS");
}
console.log("PDU IS : " + pdu);
})
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, Error code: ${e.code}` );
}
})
session.on('debug', function(type, msg, payload) {
console.log({type: type, msg: msg, payload: payload});
});
I just read about command_status = 14 and it's about an invalid password but I really couldn't understand how that is possible. Can such restrictions be applied on the SMPP Server side? The password is right as far as I know.
from node-smpp.
Related Issues (20)
- Pdu command length error HOT 2
- Support for user-defined TLVs
- error on send pdu HOT 4
- 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.