gosms

package module
v0.0.0-...-a6b16e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: MIT Imports: 11 Imported by: 0

README

smsgate

Your own local SMS gateway

smsgate is a fork of gosms

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.

planned features

  • Allowing multiple mobile numbers with a single message.
  • go modules
  • Single executabe file using embed.
  • CRUD support for messages, possibly support cancellation of message
  • Support bulk messages from file.
  • Support huawei mifi router.
  • Auto configuration (no ini file).

Documentation

Index

Constants

View Source
const (
	SMSPending   = iota // 0
	SMSProcessed        // 1
	SMSError            // 2
)
View Source
const SMSRetryLimit = 3

TODO: should be configurable

Variables

This section is empty.

Functions

func EnqueueMessage

func EnqueueMessage(message *SMS, insertToDB bool)

func GetConfig

func GetConfig(configFilePath string) (ini.File, error)

func GetLast7DaysMessageCount

func GetLast7DaysMessageCount() (map[string]int, error)

func GetStatusSummary

func GetStatusSummary() ([]int, error)

func InitDB

func InitDB(driver, dbname string) (*sql.DB, error)

func InitWorker

func InitWorker(modems []*modem.GSMModem, bufferSize, bufferLow, loaderTimeout, countOut, loaderLongTimeout int)

Types

type SMS

type SMS struct {
	UUID      string `json:"uuid"`
	Mobile    string `json:"mobile"`
	Body      string `json:"body"`
	Status    int    `json:"status"`
	Retries   int    `json:"retries"`
	Device    string `json:"device"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

func GetMessages

func GetMessages(filter string) ([]SMS, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL