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

How to send USSD, an example would be great #43

Closed narai420 closed 4 years ago

narai420 commented 5 years ago

Can you please, give me an example of how to use mode.sendUSSD() function properly. I can understand it . Thank You

narai420 commented 5 years ago

When I run any USSD command I just get the "OK" response, but I don't know how to get the full result. Like *566# should return the balance , but it returns ok

Xsmael commented 4 years ago

@narai420 check out #17

karianpour commented 4 years ago

To get the USSD answer you have to register an event listener, something like:

      modem.on('onNewIncomingUSSD', (data)=>{
        console.log('onNewIncomingUSSD', {data});
      })

@zabsalahid please close the issue.

narai420 commented 4 years ago

Thank You