Updated README according to how the lib actually works
This commit is contained in:
@@ -51,7 +51,6 @@ larvitsmpp.client({
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('SMS sent, smsId(s): ' + smsId.join(', '));
|
|
||||||
console.log('Return PDU object:');
|
console.log('Return PDU object:');
|
||||||
console.log(retPduObj);
|
console.log(retPduObj);
|
||||||
});
|
});
|
||||||
@@ -113,26 +112,32 @@ larvitsmpp.server({
|
|||||||
|
|
||||||
// Incoming SMS!
|
// Incoming SMS!
|
||||||
serverSession.on('sms', function(sms) {
|
serverSession.on('sms', function(sms) {
|
||||||
|
|
||||||
// It is important to run the sms.resp() since this is a part of the protocol
|
// It is important to run the sms.resp() since this is a part of the protocol
|
||||||
sms.resp({
|
sms.sendResp(
|
||||||
|
// Status code
|
||||||
// Decimal value status code
|
// Default is ESME_ROK == no error
|
||||||
// Default is 0 == no error
|
|
||||||
// See SMPP spec for all available status codes
|
// See SMPP spec for all available status codes
|
||||||
// For example: 11 == 0000000B == ESME_RINVDSTADR == "Invalid destination address".
|
// For example: ESME_RINVDSTADR == "Invalid destination address".
|
||||||
'status': 0,
|
'ESME_ROK'
|
||||||
|
);
|
||||||
// Set SMS id, this is important if DLR is to be connected with the right SMS but is not mandatory
|
|
||||||
'smsId': 450
|
|
||||||
});
|
|
||||||
|
|
||||||
// Oh, the sms sender wants a dlr (delivery report), send it!
|
// Oh, the sms sender wants a dlr (delivery report), send it!
|
||||||
if (sms.dlr === true) {
|
if (sms.dlr === true) {
|
||||||
serverSession.sendDlr(sms);
|
sms.sendDlr(); // Equalent to sms.sendDlr('DELIVERED');
|
||||||
|
|
||||||
// To send a negative delivery report do:
|
// To send a negative delivery report for example do:
|
||||||
//serverSession.sendDlr(sms, false);
|
sms.sendDlr('UNDELIVERABLE');
|
||||||
|
// Possible values are:
|
||||||
|
// SCHEDULED
|
||||||
|
// ENROUTE
|
||||||
|
// DELIVERED <-- Default
|
||||||
|
// EXPIRED
|
||||||
|
// DELETED
|
||||||
|
// UNDELIVERABLE
|
||||||
|
// ACCEPTED
|
||||||
|
// UNKNOWN
|
||||||
|
// REJECTED
|
||||||
|
// SKIPPED
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user