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

Is it possible to get delivery receipts with this module ? #46

Closed Xsmael closed 4 years ago

Xsmael commented 4 years ago

Hi again, I can successfully get sent receipt but is it possible to get delivery receipts with this module ?

zabsalahid commented 4 years ago

@Xsmael Hello!

Since the project is using node-pdu, it is possible, but I have not implemented it. Here's the link if you'd like to read about node-pdu. I'm a bit busy with other projects right now, so if you'd like to contribute, you can make a PR. 👍

Xsmael commented 4 years ago

Alright. Got it!

ekoeryanto commented 3 years ago

@Xsmael can you share how to implement that?

Xsmael commented 3 years ago

@Xsmael can you share how to implement that?

Hey, sorry did this very loong ago, and dont have it with me right, now, if i happen to find it i'll post it and probably make a PR.

till then you may check this link in case of hurry https://www.npmjs.com/package/node-pdu .

ekoeryanto commented 3 years ago

@Xsmael thanks for the reply. I knew about node-pdu package but i don't know how to implement that.

Thanks, anyway

ekoeryanto commented 3 years ago

I dig it 6 hours today. I think this issue should be reopen.

  1. we need to activate srr after https://github.com/zabsalahid/serialport-gsm/blob/d7e578d7c00eceaf72c934d86a5e6299b264e8a5/lib/functions/modem.js#L529 with
    submit.getType().setSrr(1)
  2. https://github.com/zabsalahid/serialport-gsm/blob/d7e578d7c00eceaf72c934d86a5e6299b264e8a5/lib/functions/modem.js#L1405 should be updated to AT+CNMI=2,1,0,1,0, after that. I have this on terminal
    {"level":20,"time":1602343537811,"pid":18814,"hostname":"sulap","msg":"Modem Received: +CDS: 27"}
    {"level":20,"time":1602343537816,"pid":18814,"hostname":"sulap","msg":"Modem Received: 0006590D91265887328412F202010122523382020101225253820000"}

    ~but 0006590D91265887328412F202010122523382020101225253820000 can't be parsed as pdu.parseStatusReport is not there.~

ekoeryanto commented 3 years ago

I have problem, how to get only 0006590D91265887328412F202010122523382020101225253820000 on dataReceived method?