Code Monkey home page Code Monkey logo

gosms's Introduction

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

gosms's People

Contributors

batara666 avatar madhurjain avatar omie avatar yarons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gosms's Issues

No interface

Please after running dashboard.exe I only get a brief command line windows an the nothing. Kindly help.
Thanks

Stopped

Has the development of this project stopped ??

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: ?

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.

How to run in macOS

I don't know how to find my modem's COM port, could you please help me on it ?

New Error

github.com/satori/go.uuid v1.2.0
This package has changed the function of NewV1()
The new function is only one return

// NewV1 returns UUID based on current timestamp and MAC address.
func NewV1() UUID {
	return global.NewV1()
}

so , in /dashboard/server.go:71:13: assignment mismatch: 2 variables but uuid.NewV1 returns 1 value

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!

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

Support for MMS?

I didn't see it called out in the readme, but is there any (or any plans for) support for MMS?

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: hlandau/acmetool#293

Examples?

How to I actually use this? Need examples.

Line Error

when an error occur in sending, server can't send next sms anymore and restart server required.

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.