:mailbox_closed: Your own local SMS gateway in Go

Related tags

Miscellaneous gosms
Overview

gosms

Your own local SMS gateway

What's the use ?

Can be used to send SMS, where you don't have access to internet or cannot use Web SMS gateways or want to save some money per SMS, or have minimal requirements for personal / internal use and such

  • deploy in less than 1 minute
  • supports Windows, GNU\Linux, Mac OS
  • works with GSM modems
  • provides API over HTTP to push messages to gateway, just like the internet based gateways do
  • takes care of queuing, throttling and retrying
  • supports multiple devices at once

gosms dashboard

deployment

  • Update conf.ini [DEVICES] section with your modem's COM port. for ex. COM10 or /dev/USBtty2
  • Run

API specification

  • /api/sms/ [POST]
    • param mobile
      • mobile number to send message to
      • number should have contry code prefix
      • for ex. +919890098900
    • param message
      • message text
      • max length is limited to 160 characters
    • response
{
  "status": 200,
  "message": "ok"
}
  • /api/logs/ [GET]
    • response
{
  "status": 200,
  "message": "ok",
  "summary": [ 10, 50, 2 ],
  "daycount": { "2015-01-22": 10, "2015-01-23": 25 },
  "messages": [
    {
      "uuid": "d04f17c4-a32c-11e4-827f-00ffcf62442b",
      "mobile": "+1858111222",
      "body": "Hey! Just playing around with gosms.",
      "status": 1
    },
  ]
}
- message status codes
  - 0 : Pending
  - 1 : Processed
  - 2 : Error

planned features

  • Allowing multiple mobile numbers with a single message in /api/sms/
  • CRUD support for messages, possibly support cancellation of message
  • Authentication support for API
  • Adding authentication for Dashboard
  • Send an email to admin on high failure rate

building from source

On Ubuntu

  • go get github.com/haxpax/gosms
  • cd $GOPATH/src/github.com/haxpax/gosms/dashboard
  • go get
  • go build

On Windows

  • Setup GCC for go-sqlite3 package

    • For 32 bit
    • For 64 bit
    • Install
    • Add its bin dir to path, typically C:\Program Files\mingw-w64\x86_64-4.9.2-posix-seh-rt_v3-rev1\mingw64\bin
  • go get github.com/haxpax/gosms

  • cd $GOPATH/src/github.com/haxpax/gosms/dashboard

  • go get

  • go build

run dashboard executable. Copy assets, templates, conf.ini, dashboard[.exe] if you want to move to another directory db.sqlite is created at first run if not present, copy that too if its there

Issues
  • Configuration assistance

    Configuration assistance

    I want to run the app on Linux and I can't really figure out the COMPORT value.

    How do I find my device? Should I write the device as /dev/tty... or COMn?

    Thanks!

    opened by yarons 5
  • Minor improvements

    Minor improvements

    Made modem.go compatible with siemens MC75, extended methods to allow future SMS reading (will do in couple days). Added optional http basic auth. (all changes should not cause any problems to current installations)

    opened by analogic 4
  • multiple-value uuid.NewV1() in single-value context

    multiple-value uuid.NewV1() in single-value context

    Issue when building with go build.

    Issue in server.go, line 71. Output: multiple-value uuid.NewV1() in single-value context

    changed line 71 from uuid := uuid.NewV1() to uuid,_ := uuid.NewV1()

    go build is successful with modification. Able to execute binary.

    Believe this is due to update of go.uuid, ref: https://github.com/hlandau/acme/issues/293

    opened by charlieuk2k 3
  • Question

    Question

    On Ubuntu: $ go get github.com/haxpax/gosms $ cd $GOPATH/src/github.com/haxpax/gosms/dashboard $ go get error :

    github.com/haxpax/gosms/dashboard

    ./server.go:71:20: multiple-value uuid.NewV1() in single-value context $ go build

    Solutions to issue please, Running in local.

    Thx.

    opened by aguspriy 3
  • undefined: gosms.GSMModem

    undefined: gosms.GSMModem

    ~/Desktop/go/src/github.com/haxpax/gosms/dashboard$ go build
    # github.com/haxpax/gosms/dashboard
    ./main.go:36: undefined: gosms.GSMModem
    

    Any idea :octocat: ?

    opened by demogorgonz 2
  • Help need got error

    Help need got error "InitDB: database does not exist db.sqlite"

    Hi,

    i am able to build dashboard.exe on windows but i get following error when i try to execute it.

    2015/02/12 14:14:10 main:  Initializing gosms
    2015/02/12 14:14:10 InitDB: database does not exist db.sqlite
    2015/02/12 14:14:10 --- syncDB
    fatal error: unexpected signal during runtime execution
    [signal 0xc0000005 code=0x1 addr=0x123083c4 pc=0x626db4]
    
    runtime stack:
    invalid spdelta 0x626d70 0x626db4 0xc4ee2 7015
    runtime.gothrow(0x7afce8, 0x2a)
            c:/go/src/runtime/panic.go:503 +0x67
    runtime.sigpanic()
            c:/go/src/runtime/os_windows.go:36 +0x53
    invalid spdelta 0x626d70 0x626db4 0xc4ee2 7015
    _cgo_ddefa58cbe9d_Cfunc__sqlite3_open_v2()
            ?:0 +0x44
    
    goroutine 1 [syscall, locked to thread]:
    runtime.cgocall_errno(0x626d70, 0x11c3da1c, 0x0)
            c:/go/src/runtime/cgocall.go:130 +0xbc fp=0x11c3da0c sp=0x11c3d9f4
    github.com/mattn/go-sqlite3._Cfunc__sqlite3_open_v2(0xcf1708, 0x11c3da40, 0x10006, 0x0, 0x0)
            github.com/mattn/go-sqlite3/_obj/_cgo_gotypes.go:104 +0x3f fp=0x11c3da1c sp=0x11c3da0c
    github.com/mattn/go-sqlite3.(*SQLiteDriver).Open(0x11c18740, 0x75a768, 0x9, 0x0, 0x0, 0x0, 0x0)
            C:/Go/src/github.com/mattn/go-sqlite3/sqlite3.go:269 +0x1ac fp=0x11c3daf0 sp=0x11c3da1c
    database/sql.(*DB).conn(0x11c1c9b0, 0x11c1231f, 0x0, 0x0)
            c:/go/src/database/sql/sql.go:664 +0x414 fp=0x11c3dba0 sp=0x11c3daf0
    database/sql.(*DB).exec(0x11c1c9b0, 0x7eb348, 0x1d0, 0x11c3dcdc, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)
            c:/go/src/database/sql/sql.go:884 +0x8a fp=0x11c3dc5c sp=0x11c3dba0
    database/sql.(*DB).Exec(0x11c1c9b0, 0x7eb348, 0x1d0, 0x11c3dcdc, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)
            c:/go/src/database/sql/sql.go:875 +0x9b fp=0x11c3dc9c sp=0x11c3dc5c
    github.com/haxpax/gosms.syncDB(0x0, 0x0)
            C:/Go/src/github.com/haxpax/gosms/db.go:44 +0x13f fp=0x11c3dcf4 sp=0x11c3dc9c
    github.com/haxpax/gosms.InitDB(0x74ea18, 0x7, 0x75a768, 0x9, 0x0, 0x0, 0x0)
            C:/Go/src/github.com/haxpax/gosms/db.go:23 +0x189 fp=0x11c3dd60 sp=0x11c3dcf4
    main.main()
            C:/Go/src/github.com/haxpax/gosms/dashboard/main.go:21 +0x38e fp=0x11c3dfcc sp=0x11c3dd60
    runtime.main()
            c:/go/src/runtime/proc.go:63 +0xcc fp=0x11c3dff0 sp=0x11c3dfcc
    runtime.goexit()
            c:/go/src/runtime/asm_386.s:2287 +0x1 fp=0x11c3dff4 sp=0x11c3dff0
    
    goroutine 17 [syscall, locked to thread]:
    runtime.goexit()
            c:/go/src/runtime/asm_386.s:2287 +0x1
    
    goroutine 6 [chan receive]:
    database/sql.(*DB).connectionOpener(0x11c1c9b0)
            c:/go/src/database/sql/sql.go:589 +0x43
    created by database/sql.Open
            c:/go/src/database/sql/sql.go:452 +0x256
    
    opened by haroonabbasi 2
  • How do I send custom sender ID instead of real sender phone number?

    How do I send custom sender ID instead of real sender phone number?

    Hi,

    I want to send SMS from custom sender ID like (From "Mailko") instead of actual phone number? Just like Telco companies send SMS to our phone without their phone number, but through a custom sender ID

    opened by cyantarek 1
  • multiple-value uuid.NewV1() in single-value context

    multiple-value uuid.NewV1() in single-value context

    github.com/haxpax/gosms/dashboard

    .\server.go:71:20: multiple-value uuid.NewV1() in single-value context

    It is appear when I do go get in dashboard, please fix it

    opened by FeyDo 1
  • Send unicode SMS (PDU)

    Send unicode SMS (PDU)

    To send messages in Unicode SMS must use the PDU format About PDU http://www.smartposition.nl/resources/sms_pdu.html or http://subnets.ru/saved/sms_pdu_format.html

    opened by dshumko 2
Releases(0.4.0)
Owner
Hax by Madhur and Omkarnath
null
Every grain of sand on Earth has its own ID.

SandID Every grain of sand on Earth has its own ID. Note that the algorithm used to generate the sandid.SandID mainly come from the UUID version 1. So

Aofei Sheng 36 Jun 28, 2022
Multi-cluster api gateway based on apiserver-aggregation.

Cluster Gateway "Cluster-Gateway" is a gateway apiserver for routing kubernetes api traffic to multiple kubernetes clusters. Additionally, the gateway

Open Application Model 35 Jun 20, 2022
grpc + grpc gateway demo

grpc + grpc gateway demo

null 0 Nov 5, 2021
Get notifications about unexpected system state from your local Gesundheitsdienst.

Get notifications about unexpected system state from your local Gesundheitsdienst.

ushi 2 Feb 27, 2022
Host yo' self from your browser, your phone, your toaster.

A hosting service from the browser, because why not. Try it at hostyoself.com. See it in action Here's an example where I use hostyoself.com to host i

Zack 1.7k Jun 28, 2022
Best-effort CPU-local sharded values for Go

percpu Percpu is a Go package to support best-effort CPU-local sharded values. This package is something of an experiment. See Go issue #18802 for dis

Caleb Spare 180 Feb 22, 2022
🔄 Maintain a local copy of you dot files

Dotup This command line is in charge of maintaining a local copy of you dot files from a <source> folder. It copies all the files in the <source> fold

Kevin Disneur 2 Oct 20, 2021
State observer - StateObserver used to synchronize the local(cached) state of the remote object with the real state

state observer StateObserver used to synchronize the local(cached) state of the

Ilya 2 Jan 19, 2022
James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Pieter Claerhout 50 Mar 8, 2022
An easy way to add useful startup banners into your Go applications

Try browsing the code on Sourcegraph! Banner Add beautiful banners into your Go applications Table of Contents Motivation Usage API Command line flags

Claudemiro 396 Jun 23, 2022
:guardsman: A teeny tiny and somewhat opinionated generator for your next golang project

A Yeoman Golang Generator We are very sorry Gophers, but other names for the generator where taken, so we choose go-lang. But we have gocreate as an a

Axel Springer SE 24 Jun 17, 2022
GoThanks automatically stars Go's official repository and your go.mod github dependencies, providing a simple way to say thanks to the maintainers of the modules you use and the contributors of Go itself.

Give thanks (in the form of a GitHub ★) to your fellow Go modules maintainers. About GoThanks performs the following operations Sends a star to Go's r

psampaz 112 Jun 12, 2022
Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Charles Weill 4k Jul 1, 2022
Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubico Yubikey into your existing Go-based user authentication infrastructure.

yubigo Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubikey into any Go application. Installation Installation is

Geert-Johan Riemer 119 Apr 28, 2022
An HTTP service for customizing import path of your Go packages.

Go Packages A self-host HTTP service that allow customizing your Go package import paths. Features Reports. Badges. I18N. Preview I launch up a free H

Razon Yang 18 Nov 18, 2021
Enable your Golang applications to self update with S3

s3update Enable your Golang applications to self update with S3. Requires Go 1.8+ This package enables our internal tools to be updated when new commi

Heetch 104 Jun 22, 2021
Give your dependencies stars on GitHub! 🌟

Give stars to your dependencies of Go repositories and say thank you to developers!!

Kensei Nakada 19 May 29, 2022
Auto-evaluate your Golang code.

Ginker Ginker is a GUI application for auto-evaluating your Golang code. It allows you to write and run Golang code on the fly and it will help you to

nkoporec 8 Jun 24, 2021
Default godoc generator - make your first steps towards better code documentation

godoc-generate Overview godoc-generate is a simple command line tool that generates default godoc comments on all exported types, functions, consts an

Dimitar Petrov 18 Nov 14, 2021