Documentation ¶
Index ¶
- Constants
- Variables
- func CombineMultipartDeliverSM(on func([]*DeliverSM)) func(*DeliverSM)
- func Marshal(w io.Writer, packet any) (n int64, err error)
- func ReadSequence(packet any) int32
- func Unmarshal(r io.Reader) (pdu any, err error)
- func WriteSequence(packet any, sequence int32)
- type Address
- type AlertNotification
- type BindReceiver
- type BindReceiverResp
- type BindTransceiver
- type BindTransceiverResp
- type BindTransmitter
- type BindTransmitterResp
- type BroadcastSM
- type BroadcastSMResp
- type CancelBroadcastSM
- type CancelBroadcastSMResp
- type CancelSM
- type CancelSMResp
- type CommandID
- type CommandStatus
- type ConcatenatedHeader
- type DataSM
- type DataSMResp
- type DeliverSM
- type DeliverSMResp
- type DestinationAddresses
- type Duration
- type ESMClass
- type EnquireLink
- type EnquireLinkResp
- type GenericNACK
- type Header
- type InterfaceVersion
- type MessageState
- type Outbind
- type QueryBroadcastSM
- type QueryBroadcastSMResp
- type QuerySM
- type QuerySMResp
- type RegisteredDelivery
- type ReplaceSM
- type ReplaceSMResp
- type Responsable
- type ShortMessage
- type SubmitMulti
- type SubmitMultiResp
- type SubmitSM
- type SubmitSMResp
- type Tags
- type Time
- type Unbind
- type UnbindResp
- type UnsuccessfulRecord
- type UnsuccessfulRecords
- type UserDataHeader
Constants ¶
const (
MaxShortMessageLength = 140
)
Variables ¶
var ( ErrUnmarshalPDUFailed = errors.New("pdu: unmarshal pdu failed") ErrUnknownDataCoding = errors.New("pdu: unknown data coding") ErrInvalidSequence = errors.New("pdu: invalid sequence (should be 31 bit integer)") ErrItemTooMany = errors.New("pdu: item too many") ErrDataTooLarge = errors.New("pdu: data too large") ErrUnparseableTime = errors.New("pdu: unparseable time") ErrShortMessageTooLarge = errors.New("pdu: encoded short message data exceeds size of 140 bytes") ErrMultipartTooMuch = errors.New("pdu: multipart sms too much (max 254 segments)") )
Functions ¶
func ReadSequence ¶
func WriteSequence ¶
Types ¶
type Address ¶
type AlertNotification ¶
AlertNotification see SMPP v5, section 4.1.3.1 (64p)
type BindReceiver ¶
type BindReceiver struct { Header Header SystemID string Password string SystemType string Version InterfaceVersion AddressRange Address // see section 4.7.3.1 }
BindReceiver see SMPP v5, section 4.1.1.3 (58p)
func (*BindReceiver) Resp ¶
func (p *BindReceiver) Resp() any
type BindReceiverResp ¶
BindReceiverResp see SMPP v5, section 4.1.1.4 (59p)
type BindTransceiver ¶
type BindTransceiver struct { Header Header SystemID string Password string SystemType string Version InterfaceVersion AddressRange Address // see section 4.7.3.1 }
BindTransceiver see SMPP v5, section 4.1.1.5 (59p)
func (*BindTransceiver) Resp ¶
func (p *BindTransceiver) Resp() any
type BindTransceiverResp ¶
BindTransceiverResp see SMPP v5, section 4.1.1.6 (60p)
type BindTransmitter ¶
type BindTransmitter struct { Header Header SystemID string Password string SystemType string Version InterfaceVersion AddressRange Address // see section 4.7.3.1 }
BindTransmitter see SMPP v5, section 4.1.1.1 (56p)
func (*BindTransmitter) Resp ¶
func (p *BindTransmitter) Resp() any
type BindTransmitterResp ¶
BindTransmitterResp see SMPP v5, section 4.1.1.2 (57p)
type BroadcastSM ¶
type BroadcastSM struct { Header Header ServiceType string SourceAddr Address MessageID string PriorityFlag byte ScheduleDeliveryTime string ValidityPeriod string ReplaceIfPresent bool DataCoding DataCoding DefaultMessageID byte Tags Tags }
BroadcastSM see SMPP v5, section 4.4.1.1 (92p)
func (*BroadcastSM) Resp ¶
func (p *BroadcastSM) Resp() any
type BroadcastSMResp ¶
BroadcastSMResp see SMPP v5, section 4.4.1.2 (96p)
type CancelBroadcastSM ¶
type CancelBroadcastSM struct { Header Header ServiceType string MessageID string SourceAddr Address Tags Tags }
CancelBroadcastSM see SMPP v5, section 4.6.2.1 (110p)
func (*CancelBroadcastSM) Resp ¶
func (p *CancelBroadcastSM) Resp() any
type CancelBroadcastSMResp ¶
type CancelBroadcastSMResp struct {
Header Header
}
CancelBroadcastSMResp see SMPP v5, section 4.6.2.3 (112p)
type CancelSM ¶
type CancelSM struct { Header Header ServiceType string MessageID string SourceAddr Address DestAddr Address }
CancelSM see SMPP v5, section 4.5.1.1 (100p)
type CancelSMResp ¶
type CancelSMResp struct {
Header Header
}
CancelSMResp see SMPP v5, section 4.5.1.2 (101p)
type CommandStatus ¶
type CommandStatus uint32
CommandStatus see SMPP v5, section 4.7.6 (116p)
const ( ErrInvalidCommandLength CommandStatus = 0x002 ErrInvalidCommandID CommandStatus = 0x003 ErrInvalidDestCount CommandStatus = 0x033 ErrInvalidDestFlag CommandStatus = 0x040 ErrInvalidTagLength CommandStatus = 0x0C2 ErrUnknownError CommandStatus = 0x0FF )
func ReadCommandStatus ¶
func ReadCommandStatus(packet any) CommandStatus
func (CommandStatus) Error ¶
func (c CommandStatus) Error() string
func (CommandStatus) String ¶
func (c CommandStatus) String() string
type ConcatenatedHeader ¶
func (ConcatenatedHeader) Len ¶
func (h ConcatenatedHeader) Len() int
func (ConcatenatedHeader) Set ¶
func (h ConcatenatedHeader) Set(udh UserDataHeader)
type DataSM ¶
type DataSM struct { Header Header ServiceType string SourceAddr Address DestAddr Address ESMClass ESMClass RegisteredDelivery RegisteredDelivery DataCoding DataCoding Tags Tags }
DataSM see SMPP v5, section 4.2.2.1 (69p)
type DataSMResp ¶
DataSMResp see SMPP v5, section 4.2.2.2 (70p)
type DeliverSM ¶
type DeliverSM struct { Header Header ServiceType string SourceAddr Address DestAddr Address ESMClass ESMClass ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string ValidityPeriod string RegisteredDelivery RegisteredDelivery ReplaceIfPresent bool Message ShortMessage Tags Tags }
DeliverSM see SMPP v5, section 4.3.1.1 (85p)
type DeliverSMResp ¶
DeliverSMResp see SMPP v5, section 4.3.1.1 (87p)
type DestinationAddresses ¶
type ESMClass ¶
type ESMClass struct { MessageMode byte // __ ____ ** MessageType byte // __ **** __ UDHIndicator bool // _* ____ __ ReplyPath bool // *_ ____ __ }
ESMClass see SMPP v5, section 4.7.12 (125p)
type EnquireLink ¶
EnquireLink see SMPP v5, section 4.1.2.1 (63p)
func (*EnquireLink) Resp ¶
func (p *EnquireLink) Resp() any
type EnquireLinkResp ¶
type EnquireLinkResp struct {
Header Header
}
EnquireLinkResp see SMPP v5, section 4.1.2.2 (63p)
type GenericNACK ¶
GenericNACK see SMPP v5, section 4.1.4.1 (65p)
type Header ¶
type Header struct { CommandLength uint32 CommandID CommandID CommandStatus CommandStatus Sequence int32 }
type InterfaceVersion ¶
type InterfaceVersion byte
InterfaceVersion see SMPP v5, section 4.7.13 (126p)
const ( SMPPVersion33 InterfaceVersion = 0x33 SMPPVersion34 InterfaceVersion = 0x34 SMPPVersion50 InterfaceVersion = 0x50 )
func (InterfaceVersion) MarshalJSON ¶
func (v InterfaceVersion) MarshalJSON() (data []byte, err error)
func (InterfaceVersion) String ¶
func (v InterfaceVersion) String() string
func (*InterfaceVersion) UnmarshalJSON ¶
func (v *InterfaceVersion) UnmarshalJSON(data []byte) (err error)
type MessageState ¶
type MessageState byte
MessageState see SMPP v5, section 4.7.15 (127p)
func (MessageState) String ¶
func (m MessageState) String() string
type QueryBroadcastSM ¶
QueryBroadcastSM see SMPP v5, section 4.6.1.1 (107p)
func (*QueryBroadcastSM) Resp ¶
func (p *QueryBroadcastSM) Resp() any
type QueryBroadcastSMResp ¶
QueryBroadcastSMResp see SMPP v5, section 4.6.1.3 (108p)
type QuerySMResp ¶
type QuerySMResp struct { Header Header MessageID string FinalDate string MessageState MessageState ErrorCode CommandStatus }
QuerySMResp see SMPP v5, section 4.5.2.2 (103p)
type RegisteredDelivery ¶
type RegisteredDelivery struct { MCDeliveryReceipt byte // ___ _ __ ** SMEOriginatedAcknowledgment byte // ___ _ ** __ IntermediateNotification bool // ___ * __ __ Reserved byte // *** _ __ __ }
RegisteredDelivery see SMPP v5, section 4.7.21 (130p)
func (RegisteredDelivery) ReadByte ¶
func (r RegisteredDelivery) ReadByte() (c byte, err error)
func (RegisteredDelivery) String ¶
func (r RegisteredDelivery) String() string
func (*RegisteredDelivery) WriteByte ¶
func (r *RegisteredDelivery) WriteByte(c byte) error
type ReplaceSM ¶
type ReplaceSM struct { Header Header MessageID string SourceAddr Address ScheduleDeliveryTime string ValidityPeriod string RegisteredDelivery RegisteredDelivery Message ShortMessage Tags Tags }
ReplaceSM see SMPP v5, section 4.5.3.1 (104p)
type ReplaceSMResp ¶
type ReplaceSMResp struct {
Header Header
}
ReplaceSMResp see SMPP v5, section 4.5.3.2 (106p)
type Responsable ¶
type Responsable interface {
Resp() any
}
type ShortMessage ¶
type ShortMessage struct { DefaultMessageID byte // see SMPP v5, section 4.7.27 (134p) DataCoding DataCoding UDHeader UserDataHeader Message []byte }
func ComposeMultipartShortMessage ¶
func ComposeMultipartShortMessage(input string, coding DataCoding, reference uint16) (parts []ShortMessage, err error)
func (*ShortMessage) Compose ¶
func (p *ShortMessage) Compose(input string) (err error)
func (*ShortMessage) Parse ¶
func (p *ShortMessage) Parse() (message string, err error)
func (*ShortMessage) Prepare ¶
func (p *ShortMessage) Prepare(pdu any)
type SubmitMulti ¶
type SubmitMulti struct { Header Header ServiceType string SourceAddr Address DestAddrList DestinationAddresses ESMClass ESMClass ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string ValidityPeriod string RegisteredDelivery RegisteredDelivery ReplaceIfPresent bool Message ShortMessage Tags Tags }
SubmitMulti see SMPP v5, section 4.2.3.1 (71p)
func (*SubmitMulti) Resp ¶
func (p *SubmitMulti) Resp() any
type SubmitMultiResp ¶
type SubmitMultiResp struct { Header Header MessageID string UnsuccessfulSMEs UnsuccessfulRecords Tags Tags }
SubmitMultiResp see SMPP v5, section 4.2.3.2 (74p)
type SubmitSM ¶
type SubmitSM struct { Header Header ServiceType string SourceAddr Address DestAddr Address ESMClass ESMClass ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string ValidityPeriod string RegisteredDelivery RegisteredDelivery ReplaceIfPresent bool Message ShortMessage Tags Tags }
SubmitSM see SMPP v5, section 4.2.1.1 (66p)
type SubmitSMResp ¶
SubmitSMResp see SMPP v5, section 4.2.1.2 (68p)
type UnbindResp ¶
type UnbindResp struct {
Header Header
}
UnbindResp see SMPP v5, section 4.1.1.9 (62p)
type UnsuccessfulRecord ¶
type UnsuccessfulRecord struct { DestAddr Address ErrorStatusCode CommandStatus }
func (UnsuccessfulRecord) String ¶
func (i UnsuccessfulRecord) String() string
type UnsuccessfulRecords ¶
type UnsuccessfulRecords []UnsuccessfulRecord
type UserDataHeader ¶
func (UserDataHeader) ConcatenatedHeader ¶
func (h UserDataHeader) ConcatenatedHeader() *ConcatenatedHeader
func (UserDataHeader) Len ¶
func (h UserDataHeader) Len() (length int)