Giter VIP home page Giter VIP logo

http-sms-gateway's People

Contributors

timdaub avatar

Stargazers

 avatar

Watchers

 avatar  avatar

http-sms-gateway's Issues

Webhook for outgoing message's status

  • usually modem takes a while to send a message
  • during this time, the status of a message can be updated multiple times
  • a webhook that would allow synchronization of these statuses (e.g. via webhook) would be interesting

Webhook timeout may lead to memory leak

0|http-sms-gateway  | 2021-02-25T17:01:01: {"level":30,"time":1614268861516,"pid":14487,"hostname":"ubuntu","msg":"Requesting POST https://server.de/api/v1/incoming to deliver webhook message \"{\\\"sender\\\":\\\"+number\\\",\\\"message\\\":\\\"CONFIRM\\\",\\\"dateTimeSent\\\":\\\"20
21-02-25T16:00:51.000Z\\\",\\\"id\\\":\\\"1ef9d3c02428ee52da19853bee889cb3c857fafa9b81b4dee4d83db28f4b9c55\\\"}\""}
0|http-sms-gateway  | 2021-02-25T17:01:01: Error: Webhook delivery aborted; timeout
0|http-sms-gateway  | 2021-02-25T17:01:01:     at AbortSignal.<anonymous> (/home/ubuntu/http-sms-gateway/src/controllers/webhooks.js:59:13)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at AbortSignal.dispatchEvent (/home/ubuntu/http-sms-gateway/node_modules/event-target-shim/dist/event-targ
et-shim.js:818:35)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at abortSignal (/home/ubuntu/http-sms-gateway/node_modules/abort-controller/dist/abort-controller.js:52:12
)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at AbortController.abort (/home/ubuntu/http-sms-gateway/node_modules/abort-controller/dist/abort-controlle
r.js:91:9)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at Timeout._onTimeout (/home/ubuntu/http-sms-gateway/src/controllers/webhooks.js:64:35)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at listOnTimeout (internal/timers.js:554:17)
0|http-sms-gateway  | 2021-02-25T17:01:01:     at processTimers (internal/timers.js:497:7)
0|http-sms-gateway  | 2021-02-25T17:01:01: {"level":50,"time":1614268861529,"pid":14487,"hostname":"ubuntu","msg":"Looks like the server wasn't respondin
g. Hit error when delivering webhook with id: e2c4c770-69ac-405a-965e-8b78412413cd and error msg: The user aborted a request. and result undefined"}
.
.
.
(tries delivering webhook for a few times)

and later

PM2                 | [PM2][WORKER] Process 0 restarted because it exceeds --max-memory-restart value (current_memory=104882176 max_memory_limit=10485760
0 [octets])
PM2                 | Process 0 in a stopped status, starting it
PM2                 | Stopping app:http-sms-gateway id:0
PM2                 | App [http-sms-gateway:0] exited with code [0] via signal [SIGINT]
PM2                 | pid=14487 msg=process killed
PM2                 | App [http-sms-gateway:0] starting in -fork mode-
PM2                 | App [http-sms-gateway:0] online

as pm2 has max_memory_restart: "100M"

TODOs for MVP

  • Sanitize inputs for REST methods
  • Launch continuous process that handles outcoming messages
  • Basic authorization
  • Periodically check for incoming messages and store them in DB
  • serve received messages from REST API
  • divide endpoints in /incoming and /outgoing
  • Release on npm
  • Make init part of the start-up procedure
  • Avoid throwing errors to http api
    • SqliteError: UNIQUE constraint failed
  • Write proper setup documentation
  • Allow filtering for country specific mobile phone numbers
  • Remove unique constraint of receiver-text in db to allow sending the same sms twice
  • ensure unsent SMS stay in system (e.g. because of errors)

Allow users to have a conversation; allow operators to script conversations

  • Allow an operator to request a sorted conversation for a receiver
    • timestamp outgoing messages
    • add a gateway-specific timestamp to incoming messages
  • Add endpoints for
    • creating
    • deleting
    • listing
    • getting
  • Find out how to authenticate the webhook request
  • Write routine that can deliver webhooks with an exponential delay
  • Document endpoints and behavior

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.