zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
90 stars 47 forks source link

Custom messageId when sending SMSs #47

Closed Xsmael closed 4 years ago

Xsmael commented 4 years ago

Hello, Is it possible to supply a custom made messageId, when sending an sms ?

Xsmael commented 4 years ago

Okay, I finally found my way out in modem.js to add it optionally

line 513

- modem.sendSMS = function (number, message, alert = false, smsId, callback) {
+ modem.sendSMS = function (number, message, alert = false, smsId, callback) {

line 527

- let messageID = modem.makeId(25);
+ let messageID = smsId || modem.makeId(25);

so it will be nice if you can add that Thanks.

Apollon77 commented 4 years ago

Can you prepare a PR?

Xsmael commented 4 years ago

sure