Gosmpp
Smpp (3.4) Client Library for Go
Install / Use
/learn @linxGnu/GosmppREADME
gosmpp
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
- In this example, you should run smsc first:
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
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
338.7kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
