Now Particularly Misnamed
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

obs-sms-plugin

0.0.2 • Public • Published

obd-sms-plugin

obd-sms-plugin is a pomelo plugin for pomelo4obd. It provides sms send and revice service for pomelo4obd.

Usage

the sms config use json format. For example:

var smsService = require('obd-sms-plugin');
app.use(smsService, {
    "server": {
        "port" : "6789",
        "path" : "/sms",
        "ip" : "*.*.*.*" // to filter illegal ip
    },
    "sender" : {
        "format" : "0",
        "sendSmsUrl" : "http://WWW",
        "corpinfo" : "0"
      },
      "crypto" : {
        "alg" : "des-ede3-cbc", // or other crypto alg
        "secretKey" : "zaqwsaqd"
      }
});
//send sms. In obd, we use to send at command.
var smsService = app.get('smsService');
smsService.send({phones: ["131****, 132****"], message : plaintext}, function(err, res) {
    if(err) {
        //error
    } else {
        //do something about res
    }
});
//receive message from device
smsService.on('message', function(msg) {
    var phoneNum = msg.phone;
    var content = msg.content;
    var date = msg.date;
    //do something
});

Keywords

none

install

npm i obs-sms-plugin

Downloadsweekly downloads

1

version

0.0.2

license

none

last publish

collaborators

  • avatar
Report a vulnerability