npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ggsmsc

v0.1.8

Published

GeoGate is an opensource GPS tracking server framework

Downloads

13

Readme

GeoGate-SmsClient

SmsClient supports SMS interface with Gammu SMS gateway. It is used for tracker initial configuration by SMS. This module leverage MySQL Gammy backend to exchange with the gateway.

In order to use this module, you need a working Gammy SMS gateway configure with MySQL backend. For details check http://fr.wammu.eu/smsd/

Install

   npm install ggsmsc
   cd node_modules/ggsmsc/

Command line

   # Standalone send/receive SMS
   node ./bin/SendRecSms.js --config=config/SampleConfig.js --getall
   node ./bin/SendRecSms.js --config=config/SampleConfig.js --getfrom=+33619921323 --limit=1
   node ./bin/SendRecSms.js --config=config/SampleConfig.js --sendto=+33xxxxxxx --msg='ceci est un message de test'

Raw API Usage

   var GGsmsc = require("ggsmsc").Client;
   
   var SmscConfig =
       { debug   : 1            // can be overloaded with --debug in cli
       , hostname: '10.10.11.1' // Gammu MySql config
       , username: 'smsd'  
       , basename: 'smsd'
       , password: '123456'
   
       , smsc    : '+33xxxxxxx'  // your SMS gateway phone number
       , report  : true          // enforce delivery report when sending
       };

   function DisplayCallback (message) {
       var count=1;
       for (var sms in message) {
           console.log("-%d- Inbox SMS=%j", count++, message[sms]);
       }
   }

   var smsc = new GGsmsc (SmscConfig);
   simulator.event.on("position",MyEventHandler4Position);   // GPS position report
   simulator.event.on("static"  ,MyEventHandler4Statics);    // AIS static data report

   smsc.GetAll  (DisplayCallBack);
   smsc.GetFrom (DisplayCallBack, '+xxPhonexxxNumberxxx');
   smsc.DelById (this.cli.smsid);
   smsc.CheckById (this.cli.smsid);
   smsc.SendTo  (DisplayCallBack, {phone: '+xxPhonexxxNumberxxx', 'This is my message'});

Api with Acknowledgement

   var GammuConfig =
       { debug   : 1            // can be overloaded with --debug in cli
       , hostname: '10.10.11.1' // Gammu MySql hostname
       , username: 'smsd'       // MySql user
       , basename: 'smsd'       // MySql base
       , password: '123456'     // MySql password

       , smsc    : '+33123456'  // your SMS gateway phone number
       , report  : true         // enforce delivery report when sending [not an application acknowledgement]

       , delay   : 4000         // xx mseconds delay in between two check of outbox send sms table
       , retry   : 10           // number of retry before refusing removing waiting sms from Gammu output queue
       };

   function TestSmsRequest (config, phonenumber) {

       function ResponseCB (data) {
            switch (data.status ) {
                case -1: console.log ("Id=%s Fail to Send SMS", data.smsid)
                    break;
                case -2: console.log ("Id=%s Timeout waiting acknowledgement", data.smsid);
                    break;
                case 1: console.log ("Id=%s Message Sent", data.smsid);
                    break;
                case 2: console.log ("Id=%s Ack Received [%s]", data.smsid, data.msg);
                    break;
                case 0: console.log ("Id=%s SMS sent complete status OK", data.smsid);
                    break;
            }
       };

       var MySmsRqt =  {
             phone   : '+33............'      // warning phone number should be a string not a number
           , ack     : true                   // wait for target to send back an acknowledgement response
           , msg     : "This is my Test Message"
       };

       smsc= new GGsmsc (config);    // connect gammu SMS gateway
       new SmsRequest (smsc, ResponseCB, MySmsRqt); // send SMS and Request ACK in ResponseCB
   }


   new TestSmsRequest (GammuConfig, process.env.GSMFULUP);

API SMS Batch

    function ResponseCB (response) {
        console.log ("### Testing CallBack --> Response=%j", response);
        if (response.status ===0) process.exit();
    };

    var MySmsRqt1 =  {
          phone   : phonenumber            // warning phone number should be a string not a number
        , ack     : false                  // don't wait for target to send back an acknowledgement response
        , msg     : "This is my 1st Testing Message"
    };
    var MySmsRqt2 =  {
          phone   : phonenumber            // warning phone number should be a string not a number
        , ack     : false                  // don'twait for target to send back an acknowledgement response
        , msg     : "This is my 2nd Testing Message"
    };
    var MySmsRqt3 =  {
          phone   : phonenumber            // warning phone number should be a string not a number
        , ack     : false                  // don't wait for target to send back an acknowledgement response
        , msg     : "This is my 3rd Testing Message"
    };

    this.smsc= new GGsms.Client (config);     // connect onto gammu SMSgateway
    new SmsBatch   (this.smsc, ResponseCB, [MySmsRqt1,MySmsRqt2,MySmsRqt3]);