Comments (25)
checkAsyncUserPass()
is custom function, you can define it by yourself:function checkAsyncUserPass(system_id, password, callback) { if (system_id === 'wavesmpp1' && password === 'wavesmp1') { callback(0); // no error } else { callback(1); // error } }
Ok, thanks. But now i gat the error like :
Error: Cannot find module 'smpp'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/root/smppserver.js:1:74)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
from node-smpp.
I believe you have in mind sender value which is set as source_addr
:
session.submit_sm({
destination_addr: '<phone_number>',
source_addr: '<sender/shortcode>',
short_message: '<SMS_body>'
});
from node-smpp.
var smpp = require('smpp');
var server = smpp.createServer(function(session) {
session.on('bind_transceiver', function(pdu) {
// we pause the session to prevent further incoming pdu events,
// untill we authorize the session with some async operation.
session.pause();
checkAsyncUserPass(pdu.system_id, pdu.password, function(err) {
if (err) {
session.send(pdu.response({
command_status: smpp.ESME_RBINDFAIL
}));
session.close();
return;
}
session.send(pdu.response());
session.resume();
});
});
});
server.listen(2775);
// Using This to create server please Hellp
Getting Error Of checkAsyncUserPass is not defined
from node-smpp.
It's not clear in this code snippet whether you have defined such function checkAsyncUserPass
from node-smpp.
i have copy this fuction from README and there was exact the same
from node-smpp.
This example is quite old and misleading. My suggestion is not to use checkAsyncUserPass()
and do your own actions as successful bind_transceiver
callback is all what you need - once it's fired up, you may send/receive messages.
from node-smpp.
ok Thankss And Can Transeceiver set to be multiple Connection at same time
from node-smpp.
Well transceiver
mode is dedicated for bidirectional communication, which means the same session supports both transmitter
(sending messages) & receiver
(receiving messages) modes. In other words, you don't have to initiate two connections at the same time to fully support communication with SMSC.
It's enough to maintain single session with SMSC for sending multiple messages and handling received ones at the same time. But if you want to handle multiple sessions to the same SMSC make sure SMSC configuration allows you to do that. In most cases, it should be restricted to 1-2 sessions only with different TPS, etc.
from node-smpp.
as My Connection is always open using node server.js . But At Same TIme How Can I Send Message
from node-smpp.
It's given in README
as an example, you need to use session.submit_sm();
from node-smpp.
but the sms number and message are dynamic as it would be send by android
how can i send SMS then
from node-smpp.
When I Get message Id that means Message has been Sent
from node-smpp.
Not really. It means SMSC has accepted your request to send message. Later SMSC will notify you whether SMS has been successfully sent to user or not - that's delivery report. You should handle it upon received PDU with:
session.on('deliver_sm', function(pdu) {
// parse/handle PDU
session.send(pdu.response());
});
PDU example of deliveyr report is:
{
command_length: 144,
command_id: 5,
command_status: 0,
sequence_number: 33576672,
command: 'deliver_sm',
service_type: '',
source_addr_ton: 1,
source_addr_npi: 1,
source_addr: '<phone>',
dest_addr_ton: 2,
dest_addr_npi: 1,
destination_addr: '<schortcode>',
esm_class: 4,
protocol_id: 0,
priority_flag: 0,
schedule_delivery_time: '',
validity_period: '',
registered_delivery: 0,
replace_if_present_flag: 0,
data_coding: 0,
sm_default_msg_id: 0,
short_message: {
message:'id:37bc0c3 sub:001 dlvrd:000 submit date:1705190504 done date:1705190504 stat:DELIVRD err:000'
}
}
Here stat:DELIVRD
indicates SMS has successfully reached destination.
from node-smpp.
Means i have to Implement this on Reciever
from node-smpp.
How to send
SMSC --> ESME
i mean can i work like this
session.deliver_sm({
command_length: 144,
command_id: 5,
command_status: 0,
sequence_number: 33576672,
command: 'deliver_sm',
service_type: '',
source_addr_ton: 1,
source_addr_npi: 1,
source_addr: 'Custom SMPP Service',
dest_addr_ton: 2,
dest_addr_npi: 1,
destination_addr: 'Client',
esm_class: 4,
protocol_id: 0,
priority_flag: 0,
schedule_delivery_time: '',
validity_period: '',
registered_delivery: 0,
replace_if_present_flag: 0,
data_coding: 0,
sm_default_msg_id: 0,
short_message: {
message:'id:123 sub:001 dlvrd:000 submit date:1705190504 done date:1705190504 stat:DELIVRD err:000'
}
}, function(pdu) {
if (pdu.command_status == 0) {
// Message successfully sent
console.log('The Delivary report is successfully sent');
}
});
from node-smpp.
session.deliver_sm it's working finally . Thanks to all :)
from node-smpp.
So, how can i does cuz i have this error :
checkAsyncUserPass('wavesmpp1', 'wavesmp1', function(err) {
^
ReferenceError: checkAsyncUserPass is not defined
at Session. (/root/smppserver.js:7:9)
at emitOne (events.js:96:13)
at Session.emit (events.js:188:7)
at Session.extractPDUs (/root/node_modules/smpp/lib/smpp.js:67:8)
at emitNone (events.js:86:13)
at Socket.emit (events.js:185:7)
at emitReadable (_stream_readable.js:432:10)
at emitReadable (_stream_readable.js:426:7)
at readableAddChunk (_stream_readable.js:187:13)
at Socket.Readable.push (_stream_readable.js:134:10)
from node-smpp.
The checkAsyncUserPass is not defined for me.
Please i need a help !
from node-smpp.
checkAsyncUserPass()
is custom function, you can define it by yourself:
function checkAsyncUserPass(system_id, password, callback) {
if (system_id === 'wavesmpp1' && password === 'wavesmp1') {
callback(0); // no error
} else {
callback(1); // error
}
}
from node-smpp.
function checkAsyncUserPass(pdu.system_id, pdu.password, function(err) {
You've defined function parameters as pdu
object properties, but I assume you're passing them as variables
. Double check on the code itself on how you're calling checkAsyncUserPass()
.
from node-smpp.
function checkAsyncUserPass(pdu.system_id, pdu.password, function(err) {
You've defined function parameters as
pdu
object properties, but I assume you're passing them asvariables
. Double check on the code itself on how you're callingcheckAsyncUserPass()
.
The error is : Error: Cannot find module 'smpp'
Please how can i fixe it ?
from node-smpp.
I install smpp like : npm install smpp it work. Thanks !
from node-smpp.
But i can not connect to it.
from node-smpp.
@Kindlysertir have you required the module in the code?
var smpp = require('smpp');
from node-smpp.
It's been almost 3 months since last answer, I assume we can close this issue. Feel free to comment again if needed
from node-smpp.
Related Issues (20)
- Client not Connected HOT 1
- define wait-ack
- Crash when short_message misstype
- 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 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
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.