smpp

package module
v0.0.0-...-7a00922 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: MIT Imports: 8 Imported by: 4

README

smpp

GoDoc GoCard

smpp - golang package for sending SMS via SMPP service. This is a simple wrapper on github.com/CodeMonkeyKevin/smpp34

Install

go get github.com/LeKovr/smpp

License

The MIT License (MIT), see LICENSE.

Copyright (c) 2016 Alexey Kovrizhkin [email protected]

Documentation

Overview

Package smpp allows sending SMS via SMPP server

Index

Constants

This section is empty.

Variables

View Source
var Params = &smpp34.Params{
	"registered_delivery": 1,
}

Params - attributes for SubmitSm

Functions

func IsBalanceOk

func IsBalanceOk(cfg *Flags, logger *log.Logger) (ok bool, err error)

IsBalanceOk checks smsc balance via http API if BalFormat config given code tested only with bytehand.com provider

func Send

func Send(cfg *Flags, logger *log.Logger, phone, code string) error

Send sends given code to phone number via SMS

Types

type Flags

type Flags struct {
	SmppHost string `long:"smpp_host"                description:"SMPP server ip (default: do not send SMS)"`
	SmppPort int    `long:"smpp_port" default:"3200" description:"SMPP server port"`
	SmppID   string `long:"smpp_id"                  description:"SMPP user id"`
	SmppPass string `long:"smpp_pass"                description:"SMPP user key"`

	SmppFrom          string `long:"smpp_from"   default:"a.elfire.ru"     description:"SMPP message signature"`
	SmppMessageFormat string `long:"smpp_msg"    default:"Access code: %s" description:"SMPP message format"`
	SmppPhonePrefix   string `long:"smpp_prefix" default:"+7"              description:"SMPP phone prefix"`

	BalFormat  string `long:"smpp_bal"               description:"SMPP account balance request format"`
	BalKey     string `long:"smpp_key"               description:"SMPP account balance request key"`
	MinBalance int    `long:"smpp_minbalance" default:"1" description:"Do not send SMS if balance is lower than"`
}

Flags is a package flags sample in form ready for use with github.com/jessevdk/go-flags

Jump to

Keyboard shortcuts

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