SkillAgentSearch skills...

Gosmpp

Smpp (3.4) Client Library for Go

Install / Use

/learn @linxGnu/Gosmpp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

gosmpp

Go Report Card Coverage Status godoc

SMPP (3.4) Client Library in pure Go.

This library is well tested with SMSC simulators:

Installation

go get -u github.com/linxGnu/gosmpp

Usage

Highlight

  • From v0.1.4, gosmpp is written in event-based style and fully-manage your smpp session, connection, error, rebinding, etc. You only need to implement some hooks:
		trans, err := gosmpp.NewSession(
		gosmpp.TRXConnector(gosmpp.NonTLSDialer, auth),
		gosmpp.Settings{
			EnquireLink: 5 * time.Second,

			ReadTimeout: 10 * time.Second,

			OnSubmitError: func(_ pdu.PDU, err error) {
				log.Fatal("SubmitPDU error:", err)
			},

			OnReceivingError: func(err error) {
				fmt.Println("Receiving PDU/Network error:", err)
			},

			OnRebindingError: func(err error) {
				fmt.Println("Rebinding but error:", err)
			},

			OnPDU: handlePDU(),

			OnClosed: func(state gosmpp.State) {
				fmt.Println(state)
			},
		}, 5*time.Second)
		if err != nil {
		  log.Println(err)
		}
		defer func() {
		  _ = trans.Close()
		}()

Version (0.1.4.RC+)

  • Full example could be found: here
    • In this example, you should run smsc first:
      • Build and run SMSC Simulator:
      g++ -std=c++11 example/smsc_simulator/smsc.cpp -o smsc
      ./smsc &
      
      • Run smpp client in the example: https://github.com/linxGnu/gosmpp/blob/master/example/main.go
      go run example/main.go
      

Old version (0.1.3 and previous)

Full example could be found: gist

Supported PDUs

  • [x] bind_transmitter
  • [x] bind_transmitter_resp
  • [x] bind_receiver
  • [x] bind_receiver_resp
  • [x] bind_transceiver
  • [x] bind_transceiver_resp
  • [x] outbind
  • [x] unbind
  • [x] unbind_resp
  • [x] submit_sm
  • [x] submit_sm_resp
  • [x] submit_sm_multi
  • [x] submit_sm_multi_resp
  • [x] data_sm
  • [x] data_sm_resp
  • [x] deliver_sm
  • [x] deliver_sm_resp
  • [x] query_sm
  • [x] query_sm_resp
  • [x] cancel_sm
  • [x] cancel_sm_resp
  • [x] replace_sm
  • [x] replace_sm_resp
  • [x] enquire_link
  • [x] enquire_link_resp
  • [x] alert_notification
  • [x] generic_nack

Related Skills

View on GitHub
GitHub Stars190
CategoryDevelopment
Updated3d ago
Forks78

Languages

Go

Security Score

100/100

Audited on Mar 24, 2026

No findings