Git Product home page Git Product logo

sms-gateway's Introduction

SMS Gateway

This REST API allow you to send and receive SMS using gammu-smsd.

A 2.0 swagger documentation is provided at the root URL.

All routes can be protected by an authentication methode (Basic, Bearer).

Table of Contents

Requirements

This project require a SQL database (mySQL, MariaDB, ...).

A device supported by Gammu library

A sim card to send and received SMS.

Installation (docker-compose)

Create a folder into the host for persistant data (SQL data)

$ mkdir -p /opt/mariadb

Create docker-complose.yml file then modify or add environment variables if necessary

services:
  backend:
    image: fizcko/sms-gateway
    restart: always
    ports:
      - 5000:5000
    devices:
      - "/dev/ttyUSB2:/dev/ttyUSB2"
    depends_on:
      - "db"
    environment:
      GAMMU_DEVICE: /dev/ttyUSB2
      MYSQL_HOST: db
      MYSQL_USERNAME: root
      MYSQL_PASSWORD: 88qpRR87pa78fff
      MYSQL_DATABASE: smsd
  db:
    image: mariadb
    restart: always
    volumes:
      - /opt/mariadb:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 88qpRR87pa78fff
      MYSQL_DATABASE: smsd

Linux\arm64

If you are not able to pull mariadb image on arm64 you can change mariadb image to webhippie/mariadb

Run containers

$ docker-compose up -d

Environment Variables

SERVER_IP

default value   : "0.0.0.0"
description     : Bind to a specific interface

SERVER_PORT

default value   : "5000"
description     : Define server port for backend API

GAMMU_SMSD_CONF

default value   : "/etc/gammu-smsdrc"
description     : Set path of the configuration file for gammu-smsd. This file is dynamically generated at container startup

GAMMU_DEVICE

default value   : "/dev/ttyUSB0"
description     : Path of the modem device mounted into the container
more            : https://wammu.eu/docs/manual/config/index.html#option-Device

GAMMU_DEVICE_CONNECTION

default value   : "at"
description     : Protocol which will be used to talk to your device
more            : https://wammu.eu/docs/manual/config/index.html#option-Connection

GAMMU_PIN

default value   : "1234"
description     : PIN for SIM card. If no pin on the SIM card leave default value
more            : https://wammu.eu/docs/manual/smsd/config.html#option-PIN

GAMMU_DEBUG_LEVEL

default value   : "0"
description     : Log level for gammu-smsd
more            : https://wammu.eu/docs/manual/smsd/config.html#option-DebugLevel

MYSQL_HOST

default value   : "localhost"
description     : Database server address

MYSQL_USERNAME

default value   : "root"
description     : User name used for connection to a database

MYSQL_PASSWORD

default value   : "toor"
description     : Password used for connection to a database

MYSQL_DATABASE

default value   : "smsd"
description     : Name of database dedicated for gammu-smsd

JWT_SECRET

default value   : "Change-this-secret-phrase"
description     : The secret key needed for symmetric based signing algorithms

JWT_ALGORITHM

default value   : "HS256"
description     : Which algorithm to sign the JWT with
more            : https://pyjwt.readthedocs.io/en/latest/algorithms.html

JWT_ACCESS_TOKEN_EXPIRES

default value   : "900"
description     : How long (in ms) an access token should live before it expires. Can be set to 0 to disable expiration.

API_SECURITY

default value   : "None"
allowed values  : "None" | "Bearer" | "Basic"
description     : Select the authentication methode for the routes of the Rest API

API_USERNAME

default value   : "admin"
description     : User name used for connection to the rest API

API_PASSWORD

default value   : "admin"
description     : Password used for connection to the rest API

My setup

Raspberry Pi 4 Model B

Quectel EC25 Mini PCle 4G/LTE Module

Raspberry Pi interface bridge

LTE Antenna

Screenshots

Swagger

sms-gateway's People

Contributors

fizcko avatar

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.