Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- func (c Address) Address() string
- func (c *Address) Marshal(b *ByteBuffer)
- func (c Address) Npi() byte
- func (c *Address) SetAddress(addr string) (err error)
- func (c *Address) SetNpi(npi byte)
- func (c *Address) SetTon(ton byte)
- func (c Address) String() string
- func (c Address) Ton() byte
- func (c *Address) Unmarshal(b *ByteBuffer) (err error)
- type AddressRange
- type AlertNotification
- func (a *AlertNotification) CanResponse() bool
- func (c *AlertNotification) GetHeader() Header
- func (a *AlertNotification) GetResponse() PDU
- func (c *AlertNotification) IsGNack() bool
- func (c *AlertNotification) IsOk() bool
- func (a *AlertNotification) Marshal(b *ByteBuffer)
- func (c *AlertNotification) RegisterOptionalParam(tlv Field)
- func (a *AlertNotification) Unmarshal(b *ByteBuffer) error
- type BindRequest
- func (b *BindRequest) CanResponse() bool
- func (c *BindRequest) GetHeader() Header
- func (b *BindRequest) GetResponse() PDU
- func (c *BindRequest) IsGNack() bool
- func (c *BindRequest) IsOk() bool
- func (b *BindRequest) Marshal(w *ByteBuffer)
- func (c *BindRequest) RegisterOptionalParam(tlv Field)
- func (b *BindRequest) Unmarshal(w *ByteBuffer) error
- type BindResp
- func (c *BindResp) CanResponse() bool
- func (c *BindResp) GetHeader() Header
- func (c *BindResp) GetResponse() PDU
- func (c *BindResp) IsGNack() bool
- func (c *BindResp) IsOk() bool
- func (c *BindResp) Marshal(b *ByteBuffer)
- func (c *BindResp) RegisterOptionalParam(tlv Field)
- func (c *BindResp) Unmarshal(b *ByteBuffer) error
- type BindingType
- type ByteBuffer
- func (c *ByteBuffer) HexDump() string
- func (c *ByteBuffer) ReadCString() (st string, err error)
- func (c *ByteBuffer) ReadInt() (r int32, err error)
- func (c *ByteBuffer) ReadN(n int) (r []byte, err error)
- func (c *ByteBuffer) ReadShort() (r int16, err error)
- func (c *ByteBuffer) WriteBuffer(d *ByteBuffer)
- func (c *ByteBuffer) WriteCString(s string) error
- func (c *ByteBuffer) WriteCStringWithEnc(s string, enc data.Encoding) error
- func (c *ByteBuffer) WriteInt(v int32)
- func (c *ByteBuffer) WriteShort(v int16)
- type CancelSM
- func (c *CancelSM) CanResponse() bool
- func (c *CancelSM) GetHeader() Header
- func (c *CancelSM) GetResponse() PDU
- func (c *CancelSM) IsGNack() bool
- func (c *CancelSM) IsOk() bool
- func (c *CancelSM) Marshal(b *ByteBuffer)
- func (c *CancelSM) RegisterOptionalParam(tlv Field)
- func (c *CancelSM) Unmarshal(b *ByteBuffer) error
- type CancelSMResp
- func (c *CancelSMResp) CanResponse() bool
- func (c *CancelSMResp) GetHeader() Header
- func (c *CancelSMResp) GetResponse() PDU
- func (c *CancelSMResp) IsGNack() bool
- func (c *CancelSMResp) IsOk() bool
- func (c *CancelSMResp) Marshal(b *ByteBuffer)
- func (c *CancelSMResp) RegisterOptionalParam(tlv Field)
- func (c *CancelSMResp) Unmarshal(b *ByteBuffer) error
- type DataSM
- func (c *DataSM) CanResponse() bool
- func (c *DataSM) GetHeader() Header
- func (c *DataSM) GetResponse() PDU
- func (c *DataSM) IsGNack() bool
- func (c *DataSM) IsOk() bool
- func (c *DataSM) Marshal(b *ByteBuffer)
- func (c *DataSM) RegisterOptionalParam(tlv Field)
- func (c *DataSM) Unmarshal(b *ByteBuffer) error
- type DataSMResp
- func (c *DataSMResp) CanResponse() bool
- func (c *DataSMResp) GetHeader() Header
- func (c *DataSMResp) GetResponse() PDU
- func (c *DataSMResp) IsGNack() bool
- func (c *DataSMResp) IsOk() bool
- func (c *DataSMResp) Marshal(b *ByteBuffer)
- func (c *DataSMResp) RegisterOptionalParam(tlv Field)
- func (c *DataSMResp) Unmarshal(b *ByteBuffer) error
- type DeliverSM
- func (c *DeliverSM) CanResponse() bool
- func (c *DeliverSM) GetHeader() Header
- func (c *DeliverSM) GetResponse() PDU
- func (c *DeliverSM) IsGNack() bool
- func (c *DeliverSM) IsOk() bool
- func (c *DeliverSM) Marshal(b *ByteBuffer)
- func (c *DeliverSM) RegisterOptionalParam(tlv Field)
- func (c *DeliverSM) Unmarshal(b *ByteBuffer) error
- type DeliverSMResp
- func (c *DeliverSMResp) CanResponse() bool
- func (c *DeliverSMResp) GetHeader() Header
- func (c *DeliverSMResp) GetResponse() PDU
- func (c *DeliverSMResp) IsGNack() bool
- func (c *DeliverSMResp) IsOk() bool
- func (c *DeliverSMResp) Marshal(b *ByteBuffer)
- func (c *DeliverSMResp) RegisterOptionalParam(tlv Field)
- func (c *DeliverSMResp) Unmarshal(b *ByteBuffer) error
- type DestinationAddress
- func (c *DestinationAddress) Address() Address
- func (c *DestinationAddress) DistributionList() DistributionList
- func (c *DestinationAddress) HasValue() bool
- func (c *DestinationAddress) IsAddress() bool
- func (c *DestinationAddress) IsDistributionList() bool
- func (c *DestinationAddress) Marshal(b *ByteBuffer)
- func (c *DestinationAddress) SetAddress(addr Address)
- func (c *DestinationAddress) SetDistributionList(list DistributionList)
- func (c *DestinationAddress) Unmarshal(b *ByteBuffer) (err error)
- type DestinationAddresses
- type DistributionList
- type EnquireLink
- func (c *EnquireLink) CanResponse() bool
- func (c *EnquireLink) GetHeader() Header
- func (c *EnquireLink) GetResponse() PDU
- func (c *EnquireLink) IsGNack() bool
- func (c *EnquireLink) IsOk() bool
- func (c *EnquireLink) Marshal(b *ByteBuffer)
- func (c *EnquireLink) RegisterOptionalParam(tlv Field)
- func (c *EnquireLink) Unmarshal(b *ByteBuffer) error
- type EnquireLinkResp
- func (c *EnquireLinkResp) CanResponse() bool
- func (c *EnquireLinkResp) GetHeader() Header
- func (c *EnquireLinkResp) GetResponse() PDU
- func (c *EnquireLinkResp) IsGNack() bool
- func (c *EnquireLinkResp) IsOk() bool
- func (c *EnquireLinkResp) Marshal(b *ByteBuffer)
- func (c *EnquireLinkResp) RegisterOptionalParam(tlv Field)
- func (c *EnquireLinkResp) Unmarshal(b *ByteBuffer) error
- type Field
- type GenericNack
- func (c *GenericNack) CanResponse() bool
- func (c *GenericNack) GetHeader() Header
- func (c *GenericNack) GetResponse() PDU
- func (c *GenericNack) IsGNack() bool
- func (c *GenericNack) IsOk() bool
- func (c *GenericNack) Marshal(b *ByteBuffer)
- func (c *GenericNack) RegisterOptionalParam(tlv Field)
- func (c *GenericNack) Unmarshal(b *ByteBuffer) error
- type Header
- type InfoElement
- type Outbind
- func (c *Outbind) CanResponse() bool
- func (c *Outbind) GetHeader() Header
- func (c *Outbind) GetResponse() PDU
- func (c *Outbind) IsGNack() bool
- func (c *Outbind) IsOk() bool
- func (c *Outbind) Marshal(b *ByteBuffer)
- func (c *Outbind) RegisterOptionalParam(tlv Field)
- func (c *Outbind) Unmarshal(b *ByteBuffer) error
- type PDU
- func CreatePDUFromCmdID(cmdID data.CommandIDType) (PDU, error)
- func NewAlertNotification() PDU
- func NewBindReceiver() PDU
- func NewBindReceiverResp() PDU
- func NewBindTransceiver() PDU
- func NewBindTransceiverResp() PDU
- func NewBindTransmitter() PDU
- func NewBindTransmitterResp() PDU
- func NewCancelSM() PDU
- func NewCancelSMResp() PDU
- func NewCancelSMRespFromReq(req *CancelSM) PDU
- func NewDataSM() PDU
- func NewDataSMResp() PDU
- func NewDataSMRespFromReq(req *DataSM) PDU
- func NewDeliverSM() PDU
- func NewDeliverSMResp() PDU
- func NewDeliverSMRespFromReq(req *DeliverSM) PDU
- func NewEnquireLink() PDU
- func NewEnquireLinkResp() PDU
- func NewEnquireLinkRespFromReq(req *EnquireLink) PDU
- func NewGenericNack() PDU
- func NewOutbind() PDU
- func NewQuerySM() PDU
- func NewQuerySMResp() PDU
- func NewQuerySMRespFromReq(req *QuerySM) PDU
- func NewReplaceSM() PDU
- func NewReplaceSMResp() PDU
- func NewReplaceSMRespFromReq(req *ReplaceSM) PDU
- func NewSubmitMulti() PDU
- func NewSubmitMultiResp() PDU
- func NewSubmitMultiRespFromReq(req *SubmitMulti) PDU
- func NewSubmitSM() PDU
- func NewSubmitSMResp() PDU
- func NewSubmitSMRespFromReq(req *SubmitSM) PDU
- func NewUnbind() PDU
- func NewUnbindResp() PDU
- func NewUnbindRespFromReq(req *Unbind) PDU
- func Parse(r io.Reader) (pdu PDU, err error)
- type QuerySM
- func (c *QuerySM) CanResponse() bool
- func (c *QuerySM) GetHeader() Header
- func (c *QuerySM) GetResponse() PDU
- func (c *QuerySM) IsGNack() bool
- func (c *QuerySM) IsOk() bool
- func (c *QuerySM) Marshal(b *ByteBuffer)
- func (c *QuerySM) RegisterOptionalParam(tlv Field)
- func (c *QuerySM) Unmarshal(b *ByteBuffer) error
- type QuerySMResp
- func (c *QuerySMResp) CanResponse() bool
- func (c *QuerySMResp) GetHeader() Header
- func (c *QuerySMResp) GetResponse() PDU
- func (c *QuerySMResp) IsGNack() bool
- func (c *QuerySMResp) IsOk() bool
- func (c *QuerySMResp) Marshal(b *ByteBuffer)
- func (c *QuerySMResp) RegisterOptionalParam(tlv Field)
- func (c *QuerySMResp) Unmarshal(b *ByteBuffer) error
- type ReplaceSM
- func (c *ReplaceSM) CanResponse() bool
- func (c *ReplaceSM) GetHeader() Header
- func (c *ReplaceSM) GetResponse() PDU
- func (c *ReplaceSM) IsGNack() bool
- func (c *ReplaceSM) IsOk() bool
- func (c *ReplaceSM) Marshal(b *ByteBuffer)
- func (c *ReplaceSM) RegisterOptionalParam(tlv Field)
- func (c *ReplaceSM) Unmarshal(b *ByteBuffer) error
- type ReplaceSMResp
- func (c *ReplaceSMResp) CanResponse() bool
- func (c *ReplaceSMResp) GetHeader() Header
- func (c *ReplaceSMResp) GetResponse() PDU
- func (c *ReplaceSMResp) IsGNack() bool
- func (c *ReplaceSMResp) IsOk() bool
- func (c *ReplaceSMResp) Marshal(b *ByteBuffer)
- func (c *ReplaceSMResp) RegisterOptionalParam(tlv Field)
- func (c *ReplaceSMResp) Unmarshal(b *ByteBuffer) error
- type ShortMessage
- func NewBinaryShortMessage(messageData []byte) (s ShortMessage, err error)
- func NewBinaryShortMessageWithEncoding(messageData []byte, enc data.Encoding) (s ShortMessage, err error)
- func NewLongMessage(message string) (s []*ShortMessage, err error)
- func NewLongMessageWithEncoding(message string, enc data.Encoding) (s []*ShortMessage, err error)
- func NewShortMessage(message string) (s ShortMessage, err error)
- func NewShortMessageWithEncoding(message string, enc data.Encoding) (s ShortMessage, err error)
- func (c *ShortMessage) Encoding() data.Encoding
- func (c *ShortMessage) GetMessage() (st string, err error)
- func (c *ShortMessage) GetMessageData() (d []byte, err error)
- func (c *ShortMessage) GetMessageWithEncoding(enc data.Encoding) (st string, err error)
- func (c *ShortMessage) Marshal(b *ByteBuffer)
- func (c *ShortMessage) SetLongMessageWithEnc(message string, enc data.Encoding) (err error)
- func (c *ShortMessage) SetMessageDataWithEncoding(d []byte, enc data.Encoding) (err error)
- func (c *ShortMessage) SetMessageWithEncoding(message string, enc data.Encoding) (err error)
- func (c *ShortMessage) SetMessageWithEncodingBasic(ud []byte, udh UDH) (err error)
- func (c *ShortMessage) SetUDH(udh UDH)
- func (c *ShortMessage) UDH() UDH
- func (c *ShortMessage) Unmarshal(b *ByteBuffer, udhi bool) (err error)
- type SubmitMulti
- func (c *SubmitMulti) CanResponse() bool
- func (c *SubmitMulti) GetHeader() Header
- func (c *SubmitMulti) GetResponse() PDU
- func (c *SubmitMulti) IsGNack() bool
- func (c *SubmitMulti) IsOk() bool
- func (c *SubmitMulti) Marshal(b *ByteBuffer)
- func (c *SubmitMulti) RegisterOptionalParam(tlv Field)
- func (c *SubmitMulti) Unmarshal(b *ByteBuffer) error
- type SubmitMultiResp
- func (c *SubmitMultiResp) CanResponse() bool
- func (c *SubmitMultiResp) GetHeader() Header
- func (c *SubmitMultiResp) GetResponse() PDU
- func (c *SubmitMultiResp) IsGNack() bool
- func (c *SubmitMultiResp) IsOk() bool
- func (c *SubmitMultiResp) Marshal(b *ByteBuffer)
- func (c *SubmitMultiResp) RegisterOptionalParam(tlv Field)
- func (c *SubmitMultiResp) Unmarshal(b *ByteBuffer) error
- type SubmitSM
- func (c *SubmitSM) CanResponse() bool
- func (c *SubmitSM) GetHeader() Header
- func (c *SubmitSM) GetResponse() PDU
- func (c *SubmitSM) IsGNack() bool
- func (c *SubmitSM) IsOk() bool
- func (c *SubmitSM) Marshal(b *ByteBuffer)
- func (c *SubmitSM) RegisterOptionalParam(tlv Field)
- func (c *SubmitSM) ShouldSplit() bool
- func (c *SubmitSM) Split() (multiSubSM []*SubmitSM, err error)
- func (c *SubmitSM) Unmarshal(b *ByteBuffer) error
- type SubmitSMResp
- func (c *SubmitSMResp) CanResponse() bool
- func (c *SubmitSMResp) GetHeader() Header
- func (c *SubmitSMResp) GetResponse() PDU
- func (c *SubmitSMResp) IsGNack() bool
- func (c *SubmitSMResp) IsOk() bool
- func (c *SubmitSMResp) Marshal(b *ByteBuffer)
- func (c *SubmitSMResp) RegisterOptionalParam(tlv Field)
- func (c *SubmitSMResp) Unmarshal(b *ByteBuffer) error
- type Tag
- type UDH
- type Unbind
- func (c *Unbind) CanResponse() bool
- func (c *Unbind) GetHeader() Header
- func (c *Unbind) GetResponse() PDU
- func (c *Unbind) IsGNack() bool
- func (c *Unbind) IsOk() bool
- func (c *Unbind) Marshal(b *ByteBuffer)
- func (c *Unbind) RegisterOptionalParam(tlv Field)
- func (c *Unbind) Unmarshal(b *ByteBuffer) error
- type UnbindResp
- func (c *UnbindResp) CanResponse() bool
- func (c *UnbindResp) GetHeader() Header
- func (c *UnbindResp) GetResponse() PDU
- func (c *UnbindResp) IsGNack() bool
- func (c *UnbindResp) IsOk() bool
- func (c *UnbindResp) Marshal(b *ByteBuffer)
- func (c *UnbindResp) RegisterOptionalParam(tlv Field)
- func (c *UnbindResp) Unmarshal(b *ByteBuffer) error
- type UnsuccessSME
- type UnsuccessSMEs
Constants ¶
const ( // SizeByte is size of byte. SizeByte = 1 // SizeShort is size of short. SizeShort = 2 // SizeInt is size of int. SizeInt = 4 // SizeLong is size of long. SizeLong = 8 )
Variables ¶
var ( // ErrBufferNotEnoughByteToRead indicates not enough byte(s) to read from buffer. ErrBufferNotEnoughByteToRead = fmt.Errorf("Not enough byte to read from buffer") )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address smpp address of src and dst.
func NewAddressWithAddr ¶
NewAddressWithAddr returns new address.
func NewAddressWithTonNpi ¶
NewAddressWithTonNpi returns new address with ton, npi.
func NewAddressWithTonNpiAddr ¶
NewAddressWithTonNpiAddr returns new address with ton, npi, addr string.
func (*Address) SetAddress ¶
SetAddress sets address.
func (*Address) Unmarshal ¶
func (c *Address) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type AddressRange ¶
AddressRange smpp address range of src and dst.
func NewAddressRange ¶
func NewAddressRange() AddressRange
NewAddressRange create new AddressRange with default max length.
func NewAddressRangeWithAddr ¶
func NewAddressRangeWithAddr(addr string) AddressRange
NewAddressRangeWithAddr create new AddressRange.
func NewAddressRangeWithTonNpi ¶
func NewAddressRangeWithTonNpi(ton, npi byte) AddressRange
NewAddressRangeWithTonNpi create new AddressRange with ton, npi.
func NewAddressRangeWithTonNpiAddr ¶
func NewAddressRangeWithTonNpiAddr(ton, npi byte, addr string) AddressRange
NewAddressRangeWithTonNpiAddr returns new address with ton, npi, addr string.
func (*AddressRange) Unmarshal ¶
func (c *AddressRange) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type AlertNotification ¶
type AlertNotification struct { SourceAddr Address EsmeAddr Address // contains filtered or unexported fields }
AlertNotification PDU is sent by the SMSC to the ESME, when the SMSC has detected that a particular mobile subscriber has become available and a delivery pending flag had been set for that subscriber from a previous data_sm operation.
func (*AlertNotification) CanResponse ¶
func (a *AlertNotification) CanResponse() bool
CanResponse implements PDU interface.
func (*AlertNotification) GetHeader ¶
func (c *AlertNotification) GetHeader() Header
GetHeader returns pdu header.
func (*AlertNotification) GetResponse ¶
func (a *AlertNotification) GetResponse() PDU
GetResponse implements PDU interface.
func (*AlertNotification) IsGNack ¶
func (c *AlertNotification) IsGNack() bool
IsGNack is generic n-ack.
func (*AlertNotification) Marshal ¶
func (a *AlertNotification) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*AlertNotification) RegisterOptionalParam ¶
func (c *AlertNotification) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*AlertNotification) Unmarshal ¶
func (a *AlertNotification) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type BindRequest ¶
type BindRequest struct { SystemID string Password string SystemType string InterfaceVersion byte AddressRange AddressRange BindingType BindingType // contains filtered or unexported fields }
BindRequest represents a bind request.
func NewBindRequest ¶
func NewBindRequest(t BindingType) (b *BindRequest)
NewBindRequest returns new bind request.
func (*BindRequest) CanResponse ¶
func (b *BindRequest) CanResponse() bool
CanResponse implements PDU interface.
func (*BindRequest) GetHeader ¶
func (c *BindRequest) GetHeader() Header
GetHeader returns pdu header.
func (*BindRequest) GetResponse ¶
func (b *BindRequest) GetResponse() PDU
GetResponse implements PDU interface.
func (*BindRequest) Marshal ¶
func (b *BindRequest) Marshal(w *ByteBuffer)
Marshal implements PDU interface.
func (*BindRequest) RegisterOptionalParam ¶
func (c *BindRequest) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*BindRequest) Unmarshal ¶
func (b *BindRequest) Unmarshal(w *ByteBuffer) error
Unmarshal implements PDU interface.
type BindResp ¶
type BindResp struct { SystemID string // contains filtered or unexported fields }
BindResp PDU.
func (*BindResp) CanResponse ¶
CanResponse implements PDU interface.
func (*BindResp) GetResponse ¶
GetResponse implements PDU interface.
func (*BindResp) Marshal ¶
func (c *BindResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*BindResp) RegisterOptionalParam ¶
func (c *BindResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*BindResp) Unmarshal ¶
func (c *BindResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type BindingType ¶
type BindingType byte
BindingType indicates type of binding.
const ( // Receiver indicates Receiver binding. Receiver BindingType = iota // Transceiver indicates Transceiver binding. Transceiver // Transmitter indicate Transmitter binding. Transmitter )
type ByteBuffer ¶
ByteBuffer wraps over bytes.Buffer with additional features.
func NewBuffer ¶
func NewBuffer(inp []byte) *ByteBuffer
NewBuffer create new buffer from preallocated buffer array.
func (*ByteBuffer) ReadCString ¶
func (c *ByteBuffer) ReadCString() (st string, err error)
ReadCString read c-string.
func (*ByteBuffer) ReadInt ¶
func (c *ByteBuffer) ReadInt() (r int32, err error)
ReadInt reads int from buffer.
func (*ByteBuffer) ReadN ¶
func (c *ByteBuffer) ReadN(n int) (r []byte, err error)
ReadN read n-bytes from buffer.
func (*ByteBuffer) ReadShort ¶
func (c *ByteBuffer) ReadShort() (r int16, err error)
ReadShort reads short from buffer.
func (*ByteBuffer) WriteBuffer ¶
func (c *ByteBuffer) WriteBuffer(d *ByteBuffer)
WriteBuffer appends buffer.
func (*ByteBuffer) WriteCString ¶
func (c *ByteBuffer) WriteCString(s string) error
WriteCString writes c-string.
func (*ByteBuffer) WriteCStringWithEnc ¶
func (c *ByteBuffer) WriteCStringWithEnc(s string, enc data.Encoding) error
WriteCStringWithEnc write c-string with encoding.
func (*ByteBuffer) WriteShort ¶
func (c *ByteBuffer) WriteShort(v int16)
WriteShort writes short to buffer.
type CancelSM ¶
type CancelSM struct { ServiceType string MessageID string SourceAddr Address DestAddr Address // contains filtered or unexported fields }
CancelSM PDU is issued by the ESME to cancel one or more previously submitted short messages that are still pending delivery. The command may specify a particular message to cancel, or all messages for a particular source, destination and service_type are to be cancelled.
func (*CancelSM) CanResponse ¶
CanResponse implements PDU interface.
func (*CancelSM) GetResponse ¶
GetResponse implements PDU interface.
func (*CancelSM) Marshal ¶
func (c *CancelSM) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*CancelSM) RegisterOptionalParam ¶
func (c *CancelSM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*CancelSM) Unmarshal ¶
func (c *CancelSM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type CancelSMResp ¶
type CancelSMResp struct {
// contains filtered or unexported fields
}
CancelSMResp PDU.
func (*CancelSMResp) CanResponse ¶
func (c *CancelSMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*CancelSMResp) GetHeader ¶
func (c *CancelSMResp) GetHeader() Header
GetHeader returns pdu header.
func (*CancelSMResp) GetResponse ¶
func (c *CancelSMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*CancelSMResp) Marshal ¶
func (c *CancelSMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*CancelSMResp) RegisterOptionalParam ¶
func (c *CancelSMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*CancelSMResp) Unmarshal ¶
func (c *CancelSMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type DataSM ¶
type DataSM struct { ServiceType string SourceAddr Address DestAddr Address EsmClass byte RegisteredDelivery byte DataCoding byte // contains filtered or unexported fields }
DataSM PDU is used to transfer data between the SMSC and the ESME. It may be used by both the ESME and SMSC.
func (*DataSM) CanResponse ¶
CanResponse implements PDU interface.
func (*DataSM) GetResponse ¶
GetResponse implements PDU interface.
func (*DataSM) RegisterOptionalParam ¶
func (c *DataSM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*DataSM) Unmarshal ¶
func (c *DataSM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type DataSMResp ¶
type DataSMResp struct { MessageID string // contains filtered or unexported fields }
DataSMResp PDU.
func (*DataSMResp) CanResponse ¶
func (c *DataSMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*DataSMResp) GetHeader ¶
func (c *DataSMResp) GetHeader() Header
GetHeader returns pdu header.
func (*DataSMResp) GetResponse ¶
func (c *DataSMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*DataSMResp) Marshal ¶
func (c *DataSMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*DataSMResp) RegisterOptionalParam ¶
func (c *DataSMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*DataSMResp) Unmarshal ¶
func (c *DataSMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type DeliverSM ¶
type DeliverSM struct { ServiceType string SourceAddr Address DestAddr Address EsmClass byte ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string // not used ValidityPeriod string // not used RegisteredDelivery byte ReplaceIfPresentFlag byte // not used Message ShortMessage // contains filtered or unexported fields }
DeliverSM PDU is issued by the SMSC to send a message to an ESME. Using this command, the SMSC may route a short message to the ESME for delivery.
func (*DeliverSM) CanResponse ¶
CanResponse implements PDU interface.
func (*DeliverSM) GetResponse ¶
GetResponse implements PDU interface.
func (*DeliverSM) Marshal ¶
func (c *DeliverSM) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*DeliverSM) RegisterOptionalParam ¶
func (c *DeliverSM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*DeliverSM) Unmarshal ¶
func (c *DeliverSM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type DeliverSMResp ¶
type DeliverSMResp struct { MessageID string // contains filtered or unexported fields }
DeliverSMResp PDU.
func (*DeliverSMResp) CanResponse ¶
func (c *DeliverSMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*DeliverSMResp) GetHeader ¶
func (c *DeliverSMResp) GetHeader() Header
GetHeader returns pdu header.
func (*DeliverSMResp) GetResponse ¶
func (c *DeliverSMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*DeliverSMResp) Marshal ¶
func (c *DeliverSMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*DeliverSMResp) RegisterOptionalParam ¶
func (c *DeliverSMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*DeliverSMResp) Unmarshal ¶
func (c *DeliverSMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type DestinationAddress ¶
type DestinationAddress struct {
// contains filtered or unexported fields
}
DestinationAddress represents Address or Distribution List based on destination flag.
func NewDestinationAddress ¶
func NewDestinationAddress() (c DestinationAddress)
NewDestinationAddress returns new DestinationAddress.
func (*DestinationAddress) Address ¶
func (c *DestinationAddress) Address() Address
Address returns underlying Address.
func (*DestinationAddress) DistributionList ¶
func (c *DestinationAddress) DistributionList() DistributionList
DistributionList returns underlying DistributionList.
func (*DestinationAddress) HasValue ¶
func (c *DestinationAddress) HasValue() bool
HasValue returns true if underlying DistributionList/Address is assigned.
func (*DestinationAddress) IsAddress ¶
func (c *DestinationAddress) IsAddress() bool
IsAddress returns true if DestinationAddress is a SME Address.
func (*DestinationAddress) IsDistributionList ¶
func (c *DestinationAddress) IsDistributionList() bool
IsDistributionList returns true if DestinationAddress is a DistributionList.
func (*DestinationAddress) Marshal ¶
func (c *DestinationAddress) Marshal(b *ByteBuffer)
Marshal to buffer.
func (*DestinationAddress) SetAddress ¶
func (c *DestinationAddress) SetAddress(addr Address)
SetAddress marks DistributionAddress as a SME Address and assign.
func (*DestinationAddress) SetDistributionList ¶
func (c *DestinationAddress) SetDistributionList(list DistributionList)
SetDistributionList marks DistributionAddress as a DistributionList and assign.
func (*DestinationAddress) Unmarshal ¶
func (c *DestinationAddress) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type DestinationAddresses ¶
type DestinationAddresses struct {
// contains filtered or unexported fields
}
DestinationAddresses represents list of DestinationAddress.
func NewDestinationAddresses ¶
func NewDestinationAddresses() (u DestinationAddresses)
NewDestinationAddresses returns list of DestinationAddress.
func (*DestinationAddresses) Add ¶
func (c *DestinationAddresses) Add(addresses ...DestinationAddress)
Add to list.
func (*DestinationAddresses) Get ¶
func (c *DestinationAddresses) Get() []DestinationAddress
Get list.
func (*DestinationAddresses) Marshal ¶
func (c *DestinationAddresses) Marshal(b *ByteBuffer)
Marshal to buffer.
func (*DestinationAddresses) Unmarshal ¶
func (c *DestinationAddresses) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type DistributionList ¶
type DistributionList struct {
// contains filtered or unexported fields
}
DistributionList represents group of contacts.
func NewDistributionList ¶
func NewDistributionList(name string) (c DistributionList, err error)
NewDistributionList returns a new DistributionList.
func (*DistributionList) Marshal ¶
func (c *DistributionList) Marshal(b *ByteBuffer)
Marshal to buffer.
func (DistributionList) Name ¶
func (c DistributionList) Name() string
Name returns name of DistributionList
func (*DistributionList) SetName ¶
func (c *DistributionList) SetName(name string) (err error)
SetName sets DistributionList name.
func (*DistributionList) Unmarshal ¶
func (c *DistributionList) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type EnquireLink ¶
type EnquireLink struct {
// contains filtered or unexported fields
}
EnquireLink PDU. This message can be sent by either the ESME or SMSC and is used to provide a confidence- check of the communication path between an ESME and an SMSC. On receipt of this request the receiving party should respond with an enquire_link_resp, thus verifying that the application level connection between the SMSC and the ESME is functioning. The ESME may also respond by sending any valid SMPP primitive.
func (*EnquireLink) CanResponse ¶
func (c *EnquireLink) CanResponse() bool
CanResponse implements PDU interface.
func (*EnquireLink) GetHeader ¶
func (c *EnquireLink) GetHeader() Header
GetHeader returns pdu header.
func (*EnquireLink) GetResponse ¶
func (c *EnquireLink) GetResponse() PDU
GetResponse implements PDU interface.
func (*EnquireLink) Marshal ¶
func (c *EnquireLink) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*EnquireLink) RegisterOptionalParam ¶
func (c *EnquireLink) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*EnquireLink) Unmarshal ¶
func (c *EnquireLink) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type EnquireLinkResp ¶
type EnquireLinkResp struct {
// contains filtered or unexported fields
}
EnquireLinkResp PDU.
func (*EnquireLinkResp) CanResponse ¶
func (c *EnquireLinkResp) CanResponse() bool
CanResponse implements PDU interface.
func (*EnquireLinkResp) GetHeader ¶
func (c *EnquireLinkResp) GetHeader() Header
GetHeader returns pdu header.
func (*EnquireLinkResp) GetResponse ¶
func (c *EnquireLinkResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*EnquireLinkResp) IsGNack ¶
func (c *EnquireLinkResp) IsGNack() bool
IsGNack is generic n-ack.
func (*EnquireLinkResp) Marshal ¶
func (c *EnquireLinkResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*EnquireLinkResp) RegisterOptionalParam ¶
func (c *EnquireLinkResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*EnquireLinkResp) Unmarshal ¶
func (c *EnquireLinkResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type Field ¶
Field is a PDU Tag-Length-Value (TLV) field
func (*Field) Unmarshal ¶
func (t *Field) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from reader.
type GenericNack ¶
type GenericNack struct {
// contains filtered or unexported fields
}
GenericNack PDU is a generic negative acknowledgement to an SMPP PDU submitted with an invalid message header. A generic_nack response is returned in the following cases:
- Invalid command_length If the receiving SMPP entity, on decoding an SMPP PDU, detects an invalid command_length (either too short or too long), it should assume that the data is corrupt. In such cases a generic_nack PDU must be returned to the message originator.
- Unknown command_id If an unknown or invalid command_id is received, a generic_nack PDU must also be returned to the originator.
func (*GenericNack) CanResponse ¶
func (c *GenericNack) CanResponse() bool
CanResponse implements PDU interface.
func (*GenericNack) GetHeader ¶
func (c *GenericNack) GetHeader() Header
GetHeader returns pdu header.
func (*GenericNack) GetResponse ¶
func (c *GenericNack) GetResponse() PDU
GetResponse implements PDU interface.
func (*GenericNack) Marshal ¶
func (c *GenericNack) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*GenericNack) RegisterOptionalParam ¶
func (c *GenericNack) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*GenericNack) Unmarshal ¶
func (c *GenericNack) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type Header ¶
type Header struct { CommandLength int32 CommandID data.CommandIDType CommandStatus data.CommandStatusType SequenceNumber int32 }
Header represents PDU header.
func (*Header) AssignSequenceNumber ¶
func (c *Header) AssignSequenceNumber()
AssignSequenceNumber assigns sequence number auto-incrementally.
func (*Header) GetSequenceNumber ¶
GetSequenceNumber returns assigned sequence number.
func (*Header) ResetSequenceNumber ¶
func (c *Header) ResetSequenceNumber()
ResetSequenceNumber resets sequence number.
func (*Header) SetSequenceNumber ¶
SetSequenceNumber manually sets sequence number.
func (*Header) Unmarshal ¶
func (c *Header) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type InfoElement ¶
InfoElement represent a 3 parts Information-Element as defined in 3GPP TS 23.040 Section 9.2.3.24 Each InfoElement is comprised of it's identifier and data
func NewIEConcatMessage ¶
func NewIEConcatMessage(totalParts, partNum, mref byte) InfoElement
NewIEConcatMessage turn a new IE element for concat message info IE.Data is populated at time of object creation
func (*InfoElement) UnmarshalBinary ¶
func (ie *InfoElement) UnmarshalBinary(src []byte) (int, error)
UnmarshalBinary unmarshal IE from binary in src, only read a single IE, expect src at least of length 2 with correct IE format:
[ ID_1, LENGTH_1, DATA_N ]
type Outbind ¶
Outbind PDU is used by the SMSC to signal an ESME to originate a bind_receiver request to the SMSC.
func (*Outbind) CanResponse ¶
CanResponse implements PDU interface.
func (*Outbind) GetResponse ¶
GetResponse implements PDU interface.
func (*Outbind) Marshal ¶
func (c *Outbind) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*Outbind) RegisterOptionalParam ¶
func (c *Outbind) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*Outbind) Unmarshal ¶
func (c *Outbind) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type PDU ¶
type PDU interface { // Marshal PDU to buffer. Marshal(*ByteBuffer) // Unmarshal PDU from buffer. Unmarshal(*ByteBuffer) error // CanResponse indicates that PDU could response to SMSC. CanResponse() bool // GetResponse PDU. GetResponse() PDU // RegisterOptionalParam assigns an optional param. RegisterOptionalParam(Field) // GetHeader returns PDU header. GetHeader() Header // IsOk returns true if command status is OK. IsOk() bool // IsGNack returns true if PDU is GNack. IsGNack() bool // AssignSequenceNumber assigns sequence number auto-incrementally. AssignSequenceNumber() // ResetSequenceNumber resets sequence number. ResetSequenceNumber() // GetSequenceNumber returns assigned sequence number. GetSequenceNumber() int32 // SetSequenceNumber manually sets sequence number. SetSequenceNumber(int32) }
PDU represents PDU interface.
func CreatePDUFromCmdID ¶
func CreatePDUFromCmdID(cmdID data.CommandIDType) (PDU, error)
CreatePDUFromCmdID creates PDU from cmd id.
func NewAlertNotification ¶
func NewAlertNotification() PDU
NewAlertNotification create new alert notification pdu.
func NewBindReceiverResp ¶
func NewBindReceiverResp() PDU
NewBindReceiverResp returns new bind receiver resp.
func NewBindTransceiver ¶
func NewBindTransceiver() PDU
NewBindTransceiver returns new bind transceiver pdu.
func NewBindTransceiverResp ¶
func NewBindTransceiverResp() PDU
NewBindTransceiverResp returns new bind transceiver resp.
func NewBindTransmitter ¶
func NewBindTransmitter() PDU
NewBindTransmitter returns new bind transmitter pdu.
func NewBindTransmitterResp ¶
func NewBindTransmitterResp() PDU
NewBindTransmitterResp returns new bind transmitter resp.
func NewCancelSMRespFromReq ¶
NewCancelSMRespFromReq returns CancelSMResp.
func NewDataSMRespFromReq ¶
NewDataSMRespFromReq returns DataSMResp.
func NewDeliverSMRespFromReq ¶
NewDeliverSMRespFromReq returns new DeliverSMResp.
func NewEnquireLinkRespFromReq ¶
func NewEnquireLinkRespFromReq(req *EnquireLink) PDU
NewEnquireLinkRespFromReq returns EnquireLinkResp.
func NewQuerySMRespFromReq ¶
NewQuerySMRespFromReq returns new QuerySM PDU.
func NewReplaceSMRespFromReq ¶
NewReplaceSMRespFromReq returns ReplaceSMResp.
func NewSubmitMultiResp ¶
func NewSubmitMultiResp() PDU
NewSubmitMultiResp returns new SubmitMultiResp.
func NewSubmitMultiRespFromReq ¶
func NewSubmitMultiRespFromReq(req *SubmitMulti) PDU
NewSubmitMultiRespFromReq returns new SubmitMultiResp.
func NewSubmitSMRespFromReq ¶
NewSubmitSMRespFromReq returns new SubmitSMResp.
func NewUnbindRespFromReq ¶
NewUnbindRespFromReq returns UnbindResp.
type QuerySM ¶
type QuerySM struct { MessageID string SourceAddr Address // contains filtered or unexported fields }
QuerySM PDU is issued by the ESME to query the status of a previously submitted short message. The matching mechanism is based on the SMSC assigned message_id and source address. Where the original submit_sm, data_sm or submit_multi ‘source address’ was defaulted to NULL, then the source address in the query_sm command should also be set to NULL.
func (*QuerySM) CanResponse ¶
CanResponse implements PDU interface.
func (*QuerySM) GetResponse ¶
GetResponse implements PDU interface.
func (*QuerySM) Marshal ¶
func (c *QuerySM) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*QuerySM) RegisterOptionalParam ¶
func (c *QuerySM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*QuerySM) Unmarshal ¶
func (c *QuerySM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type QuerySMResp ¶
type QuerySMResp struct { MessageID string FinalDate string MessageState byte ErrorCode byte // contains filtered or unexported fields }
QuerySMResp PDU.
func (*QuerySMResp) CanResponse ¶
func (c *QuerySMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*QuerySMResp) GetHeader ¶
func (c *QuerySMResp) GetHeader() Header
GetHeader returns pdu header.
func (*QuerySMResp) GetResponse ¶
func (c *QuerySMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*QuerySMResp) Marshal ¶
func (c *QuerySMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*QuerySMResp) RegisterOptionalParam ¶
func (c *QuerySMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*QuerySMResp) Unmarshal ¶
func (c *QuerySMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type ReplaceSM ¶
type ReplaceSM struct { MessageID string SourceAddr Address ScheduleDeliveryTime string ValidityPeriod string RegisteredDelivery byte Message ShortMessage // contains filtered or unexported fields }
ReplaceSM PDU is issued by the ESME to replace a previously submitted short message that is still pending delivery. The matching mechanism is based on the message_id and source address of the original message. Where the original submit_sm ‘source address’ was defaulted to NULL, then the source address in the replace_sm command should also be NULL.
func (*ReplaceSM) CanResponse ¶
CanResponse implements PDU interface.
func (*ReplaceSM) GetResponse ¶
GetResponse implements PDU interface.
func (*ReplaceSM) Marshal ¶
func (c *ReplaceSM) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*ReplaceSM) RegisterOptionalParam ¶
func (c *ReplaceSM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*ReplaceSM) Unmarshal ¶
func (c *ReplaceSM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type ReplaceSMResp ¶
type ReplaceSMResp struct {
// contains filtered or unexported fields
}
ReplaceSMResp PDU.
func (*ReplaceSMResp) CanResponse ¶
func (c *ReplaceSMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*ReplaceSMResp) GetHeader ¶
func (c *ReplaceSMResp) GetHeader() Header
GetHeader returns pdu header.
func (*ReplaceSMResp) GetResponse ¶
func (c *ReplaceSMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*ReplaceSMResp) Marshal ¶
func (c *ReplaceSMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*ReplaceSMResp) RegisterOptionalParam ¶
func (c *ReplaceSMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*ReplaceSMResp) Unmarshal ¶
func (c *ReplaceSMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type ShortMessage ¶
type ShortMessage struct { SmDefaultMsgID byte // contains filtered or unexported fields }
ShortMessage message.
func NewBinaryShortMessage ¶
func NewBinaryShortMessage(messageData []byte) (s ShortMessage, err error)
NewBinaryShortMessage returns new ShortMessage.
func NewBinaryShortMessageWithEncoding ¶
func NewBinaryShortMessageWithEncoding(messageData []byte, enc data.Encoding) (s ShortMessage, err error)
NewBinaryShortMessageWithEncoding returns new ShortMessage with predefined encoding.
func NewLongMessage ¶
func NewLongMessage(message string) (s []*ShortMessage, err error)
NewLongMessage returns long message splitted into multiple short message
func NewLongMessageWithEncoding ¶
func NewLongMessageWithEncoding(message string, enc data.Encoding) (s []*ShortMessage, err error)
NewLongMessageWithEncoding returns long message splitted into multiple short message with encoding of choice
func NewShortMessage ¶
func NewShortMessage(message string) (s ShortMessage, err error)
NewShortMessage returns new ShortMessage.
func NewShortMessageWithEncoding ¶
func NewShortMessageWithEncoding(message string, enc data.Encoding) (s ShortMessage, err error)
NewShortMessageWithEncoding returns new ShortMessage with predefined encoding.
func (*ShortMessage) Encoding ¶
func (c *ShortMessage) Encoding() data.Encoding
Encoding returns message encoding.
func (*ShortMessage) GetMessage ¶
func (c *ShortMessage) GetMessage() (st string, err error)
GetMessage returns underlying message.
func (*ShortMessage) GetMessageData ¶
func (c *ShortMessage) GetMessageData() (d []byte, err error)
GetMessageData returns underlying binary message.
func (*ShortMessage) GetMessageWithEncoding ¶
func (c *ShortMessage) GetMessageWithEncoding(enc data.Encoding) (st string, err error)
GetMessageWithEncoding returns (decoded) underlying message.
func (*ShortMessage) Marshal ¶
func (c *ShortMessage) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*ShortMessage) SetLongMessageWithEnc ¶
func (c *ShortMessage) SetLongMessageWithEnc(message string, enc data.Encoding) (err error)
SetLongMessageWithEnc sets ShortMessage with message longer than 256 bytes callers are expected to call Split() after this
func (*ShortMessage) SetMessageDataWithEncoding ¶
func (c *ShortMessage) SetMessageDataWithEncoding(d []byte, enc data.Encoding) (err error)
SetMessageDataWithEncoding sets underlying raw data which is used for pdu marshalling.
func (*ShortMessage) SetMessageWithEncoding ¶
func (c *ShortMessage) SetMessageWithEncoding(message string, enc data.Encoding) (err error)
SetMessageWithEncoding sets message with encoding.
func (*ShortMessage) SetMessageWithEncodingBasic ¶
func (c *ShortMessage) SetMessageWithEncodingBasic(ud []byte, udh UDH) (err error)
func (*ShortMessage) SetUDH ¶
func (c *ShortMessage) SetUDH(udh UDH)
SetUDH sets user data header for short message also appends udh to the beginning of messageData
func (*ShortMessage) UDH ¶
func (c *ShortMessage) UDH() UDH
UDH gets user data header for short message
func (*ShortMessage) Unmarshal ¶
func (c *ShortMessage) Unmarshal(b *ByteBuffer, udhi bool) (err error)
Unmarshal implements PDU interface.
type SubmitMulti ¶
type SubmitMulti struct { ServiceType string SourceAddr Address DestAddrs DestinationAddresses EsmClass byte ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string ValidityPeriod string // not used RegisteredDelivery byte ReplaceIfPresentFlag byte // not used Message ShortMessage // contains filtered or unexported fields }
SubmitMulti PDU is used to submit an SMPP message for delivery to multiple recipients or to one or more Distribution Lists. The submit_multi PDU does not support the transaction message mode.
func (*SubmitMulti) CanResponse ¶
func (c *SubmitMulti) CanResponse() bool
CanResponse implements PDU interface.
func (*SubmitMulti) GetHeader ¶
func (c *SubmitMulti) GetHeader() Header
GetHeader returns pdu header.
func (*SubmitMulti) GetResponse ¶
func (c *SubmitMulti) GetResponse() PDU
GetResponse implements PDU interface.
func (*SubmitMulti) Marshal ¶
func (c *SubmitMulti) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*SubmitMulti) RegisterOptionalParam ¶
func (c *SubmitMulti) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*SubmitMulti) Unmarshal ¶
func (c *SubmitMulti) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type SubmitMultiResp ¶
type SubmitMultiResp struct { MessageID string UnsuccessSMEs UnsuccessSMEs // contains filtered or unexported fields }
SubmitMultiResp PDU.
func (*SubmitMultiResp) CanResponse ¶
func (c *SubmitMultiResp) CanResponse() bool
CanResponse implements PDU interface.
func (*SubmitMultiResp) GetHeader ¶
func (c *SubmitMultiResp) GetHeader() Header
GetHeader returns pdu header.
func (*SubmitMultiResp) GetResponse ¶
func (c *SubmitMultiResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*SubmitMultiResp) IsGNack ¶
func (c *SubmitMultiResp) IsGNack() bool
IsGNack is generic n-ack.
func (*SubmitMultiResp) Marshal ¶
func (c *SubmitMultiResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*SubmitMultiResp) RegisterOptionalParam ¶
func (c *SubmitMultiResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*SubmitMultiResp) Unmarshal ¶
func (c *SubmitMultiResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type SubmitSM ¶
type SubmitSM struct { ServiceType string SourceAddr Address DestAddr Address EsmClass byte ProtocolID byte PriorityFlag byte ScheduleDeliveryTime string // not used ValidityPeriod string // not used RegisteredDelivery byte ReplaceIfPresentFlag byte // not used Message ShortMessage // contains filtered or unexported fields }
SubmitSM PDU is used by an ESME to submit a short message to the SMSC for onward transmission to a specified short message entity (SME). The submit_sm PDU does not support the transaction message mode.
func (*SubmitSM) CanResponse ¶
CanResponse implements PDU interface.
func (*SubmitSM) GetResponse ¶
GetResponse implements PDU interface.
func (*SubmitSM) Marshal ¶
func (c *SubmitSM) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*SubmitSM) RegisterOptionalParam ¶
func (c *SubmitSM) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*SubmitSM) ShouldSplit ¶
ShouldSplit check if this the user data of submitSM PDU
func (*SubmitSM) Split ¶
Split split a single long text message into multiple SubmitSM PDU, Each have the TPUD within the GSM's User Data limit of 140 octet If the message is short enough and doesn't need splitting, Split() returns an array of length 1
func (*SubmitSM) Unmarshal ¶
func (c *SubmitSM) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type SubmitSMResp ¶
type SubmitSMResp struct { MessageID string // contains filtered or unexported fields }
SubmitSMResp PDU.
func (*SubmitSMResp) CanResponse ¶
func (c *SubmitSMResp) CanResponse() bool
CanResponse implements PDU interface.
func (*SubmitSMResp) GetHeader ¶
func (c *SubmitSMResp) GetHeader() Header
GetHeader returns pdu header.
func (*SubmitSMResp) GetResponse ¶
func (c *SubmitSMResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*SubmitSMResp) Marshal ¶
func (c *SubmitSMResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*SubmitSMResp) RegisterOptionalParam ¶
func (c *SubmitSMResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*SubmitSMResp) Unmarshal ¶
func (c *SubmitSMResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type Tag ¶
type Tag uint16
Tag is the tag of a Tag-Length-Value (TLV) field.
const ( TagDestAddrSubunit Tag = 0x0005 TagDestNetworkType Tag = 0x0006 TagDestBearerType Tag = 0x0007 TagDestTelematicsID Tag = 0x0008 TagSourceAddrSubunit Tag = 0x000D TagSourceNetworkType Tag = 0x000E TagSourceBearerType Tag = 0x000F TagSourceTelematicsID Tag = 0x0010 TagQosTimeToLive Tag = 0x0017 TagPayloadType Tag = 0x0019 TagAdditionalStatusInfoText Tag = 0x001D TagReceiptedMessageID Tag = 0x001E TagMsMsgWaitFacilities Tag = 0x0030 TagPrivacyIndicator Tag = 0x0201 TagSourceSubaddress Tag = 0x0202 TagDestSubaddress Tag = 0x0203 TagUserMessageReference Tag = 0x0204 TagUserResponseCode Tag = 0x0205 TagSourcePort Tag = 0x020A TagDestinationPort Tag = 0x020B TagSarMsgRefNum Tag = 0x020C TagLanguageIndicator Tag = 0x020D TagSarTotalSegments Tag = 0x020E TagSarSegmentSeqnum Tag = 0x020F TagCallbackNumPresInd Tag = 0x0302 TagCallbackNumAtag Tag = 0x0303 TagNumberOfMessages Tag = 0x0304 TagCallbackNum Tag = 0x0381 TagDpfResult Tag = 0x0420 TagSetDpf Tag = 0x0421 TagMsAvailabilityStatus Tag = 0x0422 TagNetworkErrorCode Tag = 0x0423 TagMessagePayload Tag = 0x0424 TagDeliveryFailureReason Tag = 0x0425 TagMoreMessagesToSend Tag = 0x0426 TagMessageStateOption Tag = 0x0427 TagUssdServiceOp Tag = 0x0501 TagDisplayTime Tag = 0x1201 TagSmsSignal Tag = 0x1203 TagMsValidity Tag = 0x1204 TagAlertOnMessageDelivery Tag = 0x130C TagItsReplyType Tag = 0x1380 TagItsSessionInfo Tag = 0x1383 )
Common Tag-Length-Value (TLV) tags.
type UDH ¶
type UDH []InfoElement
UDH represent User Data Header as defined in 3GPP TS 23.040 Section 9.2.3.24.
func (UDH) FindInfoElement ¶
func (u UDH) FindInfoElement(id byte) (ie *InfoElement, found bool)
FindInfoElement find the first occurrence of the Information Element with id
func (UDH) GetConcatInfo ¶
GetConcatInfo return the FIRST concatenated message IE,
func (UDH) MarshalBinary ¶
MarshalBinary marshal UDH into bytes array The first byte is UDHL MarshalBinary preserve InformationElement order as they appears in the UDH
If the total UDHL is larger than what length(byte) can specified, this will truncate IE until total length fit within 256, if you want to check if any IE has been truncated, see if UDHL() < -1, notes on UDHL()
func (UDH) UDHL ¶
UDHL returns length (octets) of encoded UDH, including the UDHL byte.
If there is no InfoElement (IE), returns 0. If total length exceed 255, return -1.
func (*UDH) UnmarshalBinary ¶
UnmarshalBinary reads the InformationElements from raw binary UDH. Unmarshal preserve InfoElement order as they appears in the raw data The src contains the complete UDH, including the UDHL and all IEs. Returns the number of bytes read from src, and the first error detected while unmarshalling.
Since UDHL can only represented in 1 byte, UnmarshalBinary will only read up to a maximum of 256 byte regardless of src length
type Unbind ¶
type Unbind struct {
// contains filtered or unexported fields
}
Unbind PDU is to deregister an instance of an ESME from the SMSC and inform the SMSC that the ESME no longer wishes to use this network connection for the submission or delivery of messages.
func (*Unbind) CanResponse ¶
CanResponse implements PDU interface.
func (*Unbind) GetResponse ¶
GetResponse implements PDU interface.
func (*Unbind) RegisterOptionalParam ¶
func (c *Unbind) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*Unbind) Unmarshal ¶
func (c *Unbind) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type UnbindResp ¶
type UnbindResp struct {
// contains filtered or unexported fields
}
UnbindResp PDU.
func (*UnbindResp) CanResponse ¶
func (c *UnbindResp) CanResponse() bool
CanResponse implements PDU interface.
func (*UnbindResp) GetHeader ¶
func (c *UnbindResp) GetHeader() Header
GetHeader returns pdu header.
func (*UnbindResp) GetResponse ¶
func (c *UnbindResp) GetResponse() PDU
GetResponse implements PDU interface.
func (*UnbindResp) Marshal ¶
func (c *UnbindResp) Marshal(b *ByteBuffer)
Marshal implements PDU interface.
func (*UnbindResp) RegisterOptionalParam ¶
func (c *UnbindResp) RegisterOptionalParam(tlv Field)
RegisterOptionalParam register optional param.
func (*UnbindResp) Unmarshal ¶
func (c *UnbindResp) Unmarshal(b *ByteBuffer) error
Unmarshal implements PDU interface.
type UnsuccessSME ¶
type UnsuccessSME struct { Address // contains filtered or unexported fields }
UnsuccessSME indicates submission was unsuccessful and the respective errors.
func NewUnsuccessSME ¶
func NewUnsuccessSME() (c UnsuccessSME)
NewUnsuccessSME returns new UnsuccessSME
func NewUnsuccessSMEWithAddr ¶
func NewUnsuccessSMEWithAddr(addr string, status data.CommandStatusType) (c UnsuccessSME, err error)
NewUnsuccessSMEWithAddr returns new UnsuccessSME with address.
func NewUnsuccessSMEWithTonNpi ¶
func NewUnsuccessSMEWithTonNpi(ton, npi byte, status data.CommandStatusType) UnsuccessSME
NewUnsuccessSMEWithTonNpi create new address with ton, npi and error code.
func (*UnsuccessSME) ErrorStatusCode ¶
func (c *UnsuccessSME) ErrorStatusCode() data.CommandStatusType
ErrorStatusCode returns assigned status code.
func (*UnsuccessSME) SetErrorStatusCode ¶
func (c *UnsuccessSME) SetErrorStatusCode(v data.CommandStatusType)
SetErrorStatusCode sets error status code.
func (*UnsuccessSME) Unmarshal ¶
func (c *UnsuccessSME) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
type UnsuccessSMEs ¶
type UnsuccessSMEs struct {
// contains filtered or unexported fields
}
UnsuccessSMEs represents list of UnsuccessSME.
func NewUnsuccessSMEs ¶
func NewUnsuccessSMEs() (u UnsuccessSMEs)
NewUnsuccessSMEs returns list of UnsuccessSME.
func (*UnsuccessSMEs) Unmarshal ¶
func (c *UnsuccessSMEs) Unmarshal(b *ByteBuffer) (err error)
Unmarshal from buffer.
Source Files ¶
- Address.go
- AddressRange.go
- AlertNotification.go
- BindRequest.go
- BindResponse.go
- Buffer.go
- CancelSM.go
- CancelSMResp.go
- DataSM.go
- DataSMResp.go
- DeliverSM.go
- DeliverSMResp.go
- DestinationAddress.go
- DistributionList.go
- EnquireLink.go
- EnquireLinkResp.go
- GenericNack.go
- Outbind.go
- PDU.go
- PDUFactory.go
- PDUHeader.go
- QuerySM.go
- QuerySMResp.go
- ReplaceSM.go
- ReplaceSMResp.go
- ShortMessage.go
- SubmitMulti.go
- SubmitMultiResp.go
- SubmitSM.go
- SubmitSMResp.go
- TLV.go
- UDH.go
- Unbind.go
- UnbindResp.go
- UnsuccessSME.go