Documentation ¶
Index ¶
- Constants
- Variables
- func IsRequest(id CommandID) bool
- func SeparateUDH(c []byte) ([]byte, []byte, error)
- func SystemID(p PDU) string
- type AlertNotification
- type BindRx
- type BindRxResp
- type BindTRx
- type BindTRxResp
- type BindTx
- type BindTxResp
- type CancelSm
- type CancelSmResp
- type CommandID
- type DataSm
- type DataSmResp
- type Decoder
- type DelStat
- type DeliverSm
- type DeliverSmResp
- type DeliveryReceipt
- type Encoder
- type EncoderOption
- type EnquireLink
- type EnquireLinkResp
- type EsmClass
- type GenericNack
- type Header
- type Options
- func (o *Options) Get(tag TagID) ([]byte, bool)
- func (o *Options) GetCString(tag TagID) (string, bool)
- func (o *Options) GetDouble(tag TagID) (int, bool)
- func (o *Options) GetSingle(tag TagID) (int, bool)
- func (o *Options) GetString(tag TagID) (string, bool)
- func (o *Options) MarshalBinary() ([]byte, error)
- func (o *Options) MessagePayload() string
- func (o *Options) MessageState() int
- func (o *Options) ReceiptedMessageID() string
- func (o *Options) SarMsgRefNum() int
- func (o *Options) SarSegmentSeqnum() int
- func (o *Options) SarTotalSegments() int
- func (o *Options) ScInterfaceVersion() int
- func (o *Options) Set(tag TagID, val []byte) *Options
- func (o *Options) SetCString(tag TagID, val string) *Options
- func (o *Options) SetDouble(tag TagID, val int) *Options
- func (o *Options) SetMessagePayload(val string) *Options
- func (o *Options) SetMessageState(val int) *Options
- func (o *Options) SetReceiptedMessageID(val string) *Options
- func (o *Options) SetSarMsgRefNum(val int) *Options
- func (o *Options) SetSarSegmentSeqnum(val int) *Options
- func (o *Options) SetSarTotalSegments(val int) *Options
- func (o *Options) SetScInterfaceVersion(val int) *Options
- func (o *Options) SetSingle(tag TagID, val int) *Options
- func (o *Options) SetString(tag TagID, val string) *Options
- func (o *Options) SetUserMessageReference(val int) *Options
- func (o *Options) UnmarshalBinary(buf []byte) error
- func (o *Options) UserMessageReference() int
- type Outbind
- type PDU
- type QuerySm
- type QuerySmResp
- type RegisteredDelivery
- type ReplaceSm
- type ReplaceSmResp
- type Sequencer
- type Status
- type SubmitMulti
- type SubmitMultiResp
- type SubmitSm
- type SubmitSmResp
- type TagID
- type Unbind
- type UnbindResp
Constants ¶
const ( SystemIDFld string = "system_id" PasswordFld string = "password" SystemTypeFld string = "system_type" InterfaceVersionFld string = "interface_version" AddrTonFld string = "addr_ton" AddrNpiFld string = "addr_npi" AddressRangeFld string = "address_range" ServiceTypeFld string = "service_type" SourceAddrTonFld string = "source_addr_ton" SourceAddrNpiFld string = "source_addr_npi" SourceAddrFld string = "source_addr" DestAddrTonFld string = "dest_addr_ton" DestAddrNpiFld string = "dest_addr_npi" NumberOfDestsFld string = "number_of_dests" DestFlagFld string = "dest_flag" DlNameFld string = "dl_name" DestinationAddrFld string = "destination_addr" NoUnsuccessFld string = "no_unsuccess" EsmClassFld string = "esm_class" ProtocolIDFld string = "protocol_id" PriorityFlagFld string = "priority_flag" ScheduleDeliveryTimeFld string = "schedule_delivery_time" ValidityPeriodFld string = "validity_period" RegisteredDeliveryFld string = "registered_delivery" ReplaceIfPresentFlagFld string = "replace_if_present_flag" DataCodingFld string = "data_coding" SmDefaultMsgIDFld string = "sm_default_msg_id" SmLengthFld string = "sm_length" ShortMessageFld string = "short_message" MessageIDFld string = "message_id" FinalDateFld string = "final_date" MessageStateFld string = "message_state" ErrorCodeFld string = "error_code" EsmeAddrTonFld string = "esme_addr_ton" EsmeAddrNpiFld string = "esme_addr_npi" EsmeAddrFld string = "esme_addr" )
SMPP mandatory fields set.
const ( DefaultEsmMode = 0x0 DatagramEsmMode = 0x1 ForwardEsmMode = 0x2 StoreAndForwardEsmMode = 0x3 NotApplicableEsmMode = 0x7 )
const ( DefaultEsmType = 0x0 DelRecEsmType = 0x1 DelAckEsmType = 0x2 UsrAckEsmType = 0x4 ConAbtEsmType = 0x6 IDNEsmType = 0x8 )
const ( NoEsmFeat = 0x0 UDHIEsmFeat = 0x1 RepPathEsmFeat = 0x2 UDHIRepPathEsmFeat = 0x3 )
const ( NoDeliveryReceipt = 0x0 YesDeliveryReceipt = 0x1 FailDeliveryReceipt = 0x2 )
const ( NoSMEAck = 0x0 YesSMEAck = 0x1 ManualSMEAck = 0x2 AllSMEAck = 0x3 )
const ( NoInterNotification = 0x0 YesInterNotification = 0x1 )
const ( // MaxPDUSize is maximal size of the PDU in bytes. MaxPDUSize = 4096 // 4KB )
Variables ¶
var DelStatMap = map[uint8]DelStat{ 1: DelStatEnRoute, 2: DelStatDelivered, 3: DelStatExpired, 4: DelStatDeleted, 5: DelStatUndeliverable, 6: DelStatAccepted, 7: DelStatUnknown, 8: DelStatRejected, }
Functions ¶
func SeparateUDH ¶
SeparateUDH takes input bytes and separates them into UDH header and content.
Types ¶
type AlertNotification ¶
type AlertNotification struct { }
AlertNotification Not supported yet.
func (AlertNotification) CommandID ¶
func (p AlertNotification) CommandID() CommandID
func (AlertNotification) MarshalBinary ¶
func (p AlertNotification) MarshalBinary() ([]byte, error)
func (*AlertNotification) UnmarshalBinary ¶
func (p *AlertNotification) UnmarshalBinary(body []byte) error
type BindRx ¶
type BindRx struct { SystemID string Password string SystemType string InterfaceVersion int AddrTon int AddrNpi int AddressRange string }
BindRx binding pdu in receiver mode.
func (BindRx) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (BindRx) Response ¶
func (p BindRx) Response(sysID string) *BindRxResp
Response creates new BindRxResp.
func (*BindRx) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type BindRxResp ¶
BindRxResp bind response.
func (BindRxResp) CommandID ¶
func (p BindRxResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (BindRxResp) MarshalBinary ¶
func (p BindRxResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*BindRxResp) UnmarshalBinary ¶
func (p *BindRxResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type BindTRx ¶
type BindTRx struct { SystemID string Password string SystemType string InterfaceVersion int AddrTon int AddrNpi int AddressRange string }
BindTRx binding PDU in receiver mode.
func (BindTRx) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (BindTRx) Response ¶
func (p BindTRx) Response(sysID string) *BindTRxResp
Response creates new BindTRxResp.
func (*BindTRx) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type BindTRxResp ¶
BindTRxResp bind response.
func (BindTRxResp) CommandID ¶
func (p BindTRxResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (BindTRxResp) MarshalBinary ¶
func (p BindTRxResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*BindTRxResp) UnmarshalBinary ¶
func (p *BindTRxResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type BindTx ¶
type BindTx struct { SystemID string Password string SystemType string InterfaceVersion int AddrTon int AddrNpi int AddressRange string }
BindTx binding pdu in transmitter mode.
func (BindTx) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (BindTx) Response ¶
func (p BindTx) Response(sysID string) *BindTxResp
Response creates new BindTxResp.
func (*BindTx) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type BindTxResp ¶
BindTxResp bind response.
func (BindTxResp) CommandID ¶
func (p BindTxResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (BindTxResp) MarshalBinary ¶
func (p BindTxResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*BindTxResp) UnmarshalBinary ¶
func (p *BindTxResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type CancelSm ¶
type CancelSm struct { }
CancelSm Not supported yet.
func (CancelSm) MarshalBinary ¶
func (*CancelSm) UnmarshalBinary ¶
type CancelSmResp ¶
type CancelSmResp struct { }
CancelSmResp Not supported yet.
func (CancelSmResp) CommandID ¶
func (p CancelSmResp) CommandID() CommandID
func (CancelSmResp) MarshalBinary ¶
func (p CancelSmResp) MarshalBinary() ([]byte, error)
func (*CancelSmResp) UnmarshalBinary ¶
func (p *CancelSmResp) UnmarshalBinary(body []byte) error
type CommandID ¶
type CommandID uint32
CommandID is four byte PDU command identifier.
const ( GenericNackID CommandID = 0x80000000 BindReceiverID CommandID = 0x00000001 BindReceiverRespID CommandID = 0x80000001 BindTransmitterID CommandID = 0x00000002 BindTransmitterRespID CommandID = 0x80000002 QuerySmID CommandID = 0x00000003 QuerySmRespID CommandID = 0x80000003 SubmitSmID CommandID = 0x00000004 SubmitSmRespID CommandID = 0x80000004 DeliverSmID CommandID = 0x00000005 DeliverSmRespID CommandID = 0x80000005 UnbindID CommandID = 0x00000006 UnbindRespID CommandID = 0x80000006 ReplaceSmID CommandID = 0x00000007 ReplaceSmRespID CommandID = 0x80000007 CancelSmID CommandID = 0x00000008 CancelSmRespID CommandID = 0x80000008 BindTransceiverID CommandID = 0x00000009 BindTransceiverRespID CommandID = 0x80000009 OutbindID CommandID = 0x0000000B EnquireLinkID CommandID = 0x00000015 EnquireLinkRespID CommandID = 0x80000015 SubmitMultiID CommandID = 0x00000021 SubmitMultiRespID CommandID = 0x80000021 AlertNotificationID CommandID = 0x00000102 DataSmID CommandID = 0x00000103 DataSmRespID CommandID = 0x80000103 )
SMPP command set.
type DataSm ¶
type DataSm struct { }
DataSm Not supported yet.
func (DataSm) MarshalBinary ¶
func (*DataSm) UnmarshalBinary ¶
type DataSmResp ¶
type DataSmResp struct { }
DataSmResp Not supported yet.
func (DataSmResp) CommandID ¶
func (p DataSmResp) CommandID() CommandID
func (DataSmResp) MarshalBinary ¶
func (p DataSmResp) MarshalBinary() ([]byte, error)
func (*DataSmResp) UnmarshalBinary ¶
func (p *DataSmResp) UnmarshalBinary(body []byte) error
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads input from reader and marshals it into PDU.
type DeliverSm ¶
type DeliverSm struct { ServiceType string SourceAddrTon int SourceAddrNpi int SourceAddr string DestAddrTon int DestAddrNpi int DestinationAddr string EsmClass EsmClass ProtocolID int PriorityFlag int ScheduleDeliveryTime time.Time ValidityPeriod time.Time RegisteredDelivery RegisteredDelivery ReplaceIfPresentFlag int DataCoding int SmDefaultMsgID int ShortMessage string Options *Options }
DeliverSm contains mandatory fields for delivering short message. There is no need to set SmLength it will be automatically set when encoding pdu to binary representation.
func (DeliverSm) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (DeliverSm) Response ¶
func (p DeliverSm) Response(msgID string) *DeliverSmResp
Response creates new DeliverSmResp.
func (*DeliverSm) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type DeliverSmResp ¶
type DeliverSmResp struct {
MessageID string
}
DeliverSmResp contains mandatory fields for deliver_sm response.
func (DeliverSmResp) CommandID ¶
func (p DeliverSmResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (DeliverSmResp) MarshalBinary ¶
func (p DeliverSmResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*DeliverSmResp) UnmarshalBinary ¶
func (p *DeliverSmResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type DeliveryReceipt ¶
type DeliveryReceipt struct { Id string Sub string Dlvrd string SubmitDate time.Time DoneDate time.Time Stat DelStat Err string Text string }
DeliveryReceipt in format “id:IIIIIIIIII sub:SSS dlvrd:DDD submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DDDDDDD err:E Text: ...”
func ParseDeliveryReceipt ¶
func ParseDeliveryReceipt(sm string) (*DeliveryReceipt, error)
ParseDeliveryReceipt parses delivery receipt format defined in smpp 3.4 specification
func (*DeliveryReceipt) String ¶
func (dr *DeliveryReceipt) String() string
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is responsible for encoding PDU structure to writer.
func NewEncoder ¶
NewEncoder instantiates pdu encoder.
type EncoderOption ¶
type EncoderOption func(*encoderOpts)
func EncodeSeq ¶
func EncodeSeq(seq uint32) EncoderOption
func EncodeStatus ¶
func EncodeStatus(status Status) EncoderOption
type EnquireLink ¶
type EnquireLink struct{}
EnquireLink PDU.
func (EnquireLink) CommandID ¶
func (p EnquireLink) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (EnquireLink) MarshalBinary ¶
func (p EnquireLink) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (EnquireLink) Response ¶
func (p EnquireLink) Response() *EnquireLinkResp
Response creates new EnquireLinkResp.
func (EnquireLink) UnmarshalBinary ¶
func (p EnquireLink) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type EnquireLinkResp ¶
type EnquireLinkResp struct{}
EnquireLinkResp PDU response.
func (EnquireLinkResp) CommandID ¶
func (p EnquireLinkResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (EnquireLinkResp) MarshalBinary ¶
func (p EnquireLinkResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (EnquireLinkResp) UnmarshalBinary ¶
func (p EnquireLinkResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type EsmClass ¶
EsmClass is used to indicate special message attributes associated with the short message.
type GenericNack ¶
type GenericNack struct{}
GenericNack PDU.
func (GenericNack) CommandID ¶
func (p GenericNack) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (GenericNack) MarshalBinary ¶
func (p GenericNack) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (GenericNack) UnmarshalBinary ¶
func (p GenericNack) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type Header ¶
type Header interface { encoding.BinaryUnmarshaler Length() uint32 CommandID() CommandID Status() Status Sequence() uint32 }
Header represents PDU header.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options maps all optional values and provides simple API for access. Only comonly used parameters have helpers, others have to be created by the users.
func (*Options) Get ¶
Get tries to get byte value out of TLV field if present. If it's not it returns ok as false.
func (*Options) GetCString ¶
GetCString returns tag value as string.
func (*Options) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*Options) MessagePayload ¶
MessagePayload is helper function for getting this option.
func (*Options) MessageState ¶
MessageState is helper function for getting this option.
func (*Options) ReceiptedMessageID ¶
ReceiptedMessageID is helper function for getting this option.
func (*Options) SarMsgRefNum ¶
SarMsgRefNum is helper function for getting this option.
func (*Options) SarSegmentSeqnum ¶
SarSegmentSeqnum is helper function for getting this option.
func (*Options) SarTotalSegments ¶
SarTotalSegments is helper function for getting this option.
func (*Options) ScInterfaceVersion ¶
ScInterfaceVersion is helper function for getting this option.
func (*Options) SetCString ¶
SetCString assigns new TLV field with string value.
func (*Options) SetMessagePayload ¶
SetMessagePayload is helper function for setting this option.
func (*Options) SetMessageState ¶
SetMessageState is helper function for setting this option.
func (*Options) SetReceiptedMessageID ¶
SetReceiptedMessageID is helper function for setting this option.
func (*Options) SetSarMsgRefNum ¶
SetSarMsgRefNum is helper function for setting this option.
func (*Options) SetSarSegmentSeqnum ¶
SetSarSegmentSeqnum is helper function for setting this option.
func (*Options) SetSarTotalSegments ¶
SetSarTotalSegments is helper function for setting this option.
func (*Options) SetScInterfaceVersion ¶
SetScInterfaceVersion is helper function for setting this option.
func (*Options) SetUserMessageReference ¶
SetUserMessageReference is helper function for setting this option.
func (*Options) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
func (*Options) UserMessageReference ¶
UserMessageReference is helper function for getting this option.
type Outbind ¶
type Outbind struct { }
Outbind Not supported yet.
func (Outbind) MarshalBinary ¶
func (*Outbind) UnmarshalBinary ¶
type PDU ¶
type PDU interface { CommandID() CommandID encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
PDU defines interface for PDU structures
type QuerySm ¶
QuerySm represents quering PDU.
func (QuerySm) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (QuerySm) Response ¶
func (p QuerySm) Response(date time.Time, state, err int) *QuerySmResp
Response creates new QuerySmResp.
func (*QuerySm) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type QuerySmResp ¶
QuerySmResp holds response to query_sm PDU.
func (QuerySmResp) CommandID ¶
func (p QuerySmResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (QuerySmResp) MarshalBinary ¶
func (p QuerySmResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*QuerySmResp) UnmarshalBinary ¶
func (p *QuerySmResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type RegisteredDelivery ¶
RegisteredDelivery is used to request an SMSC delivery receipt and/or SME originated acknowledgements.
func ParseRegisteredDelivery ¶
func ParseRegisteredDelivery(b byte) RegisteredDelivery
ParseRegisteredDelivery parses registered_delivery from pdu.
func (RegisteredDelivery) Byte ¶
func (rd RegisteredDelivery) Byte() byte
Byte converts RegisteredDelivery into a single byte for pdu encoding.
type ReplaceSm ¶
type ReplaceSm struct { }
ReplaceSm Not supported yet.
func (ReplaceSm) MarshalBinary ¶
func (*ReplaceSm) UnmarshalBinary ¶
type ReplaceSmResp ¶
type ReplaceSmResp struct { }
ReplaceSmResp Not supported yet.
func (ReplaceSmResp) CommandID ¶
func (p ReplaceSmResp) CommandID() CommandID
func (ReplaceSmResp) MarshalBinary ¶
func (p ReplaceSmResp) MarshalBinary() ([]byte, error)
func (*ReplaceSmResp) UnmarshalBinary ¶
func (p *ReplaceSmResp) UnmarshalBinary(body []byte) error
type Sequencer ¶
type Sequencer interface {
Next() uint32
}
Sequencer provides way of altering default PDU sequencing. This can be useful for load balancing requests.
func NewSequencer ¶
NewSequencer creates new sequencer with starting value set to n. Allowed range is 0x00000001 to 0x7FFFFFFF.
type Status ¶
type Status uint32
Status represents four byte command status.
const ( StatusOK Status = 0x00000000 StatusInvMsgLen Status = 0x00000001 StatusInvCmdLen Status = 0x00000002 StatusInvCmdID Status = 0x00000003 StatusInvBnd Status = 0x00000004 StatusAlyBnd Status = 0x00000005 StatusInvPrtFlg Status = 0x00000006 StatusInvRegDlvFlg Status = 0x00000007 StatusSysErr Status = 0x00000008 StatusInvSrcAdr Status = 0x0000000A StatusInvDstAdr Status = 0x0000000B StatusInvMsgID Status = 0x0000000C StatusBindFail Status = 0x0000000D StatusInvPaswd Status = 0x0000000E StatusInvSysID Status = 0x0000000F StatusCancelFail Status = 0x00000011 StatusReplaceFail Status = 0x00000013 StatusMsgQFul Status = 0x00000014 StatusInvSerTyp Status = 0x00000015 StatusInvNumDe Status = 0x00000033 StatusInvDLName Status = 0x00000034 StatusInvDestFlag Status = 0x00000040 StatusInvSubRep Status = 0x00000042 StatusInvEsmClass Status = 0x00000043 StatusCntSubDL Status = 0x00000044 StatusSubmitFail Status = 0x00000045 StatusInvSrcTON Status = 0x00000048 StatusInvSrcNPI Status = 0x00000049 StatusInvDstTON Status = 0x00000050 StatusInvDstNPI Status = 0x00000051 StatusInvSysTyp Status = 0x00000053 StatusInvRepFlag Status = 0x00000054 StatusInvNumMsgs Status = 0x00000055 StatusThrottled Status = 0x00000058 StatusInvSched Status = 0x00000061 StatusInvExpiry Status = 0x00000062 StatusInvDftMsgID Status = 0x00000063 StatusTempAppErr Status = 0x00000064 StatusPermAppErr Status = 0x00000065 StatusRejeAppErr Status = 0x00000066 StatusQueryFail Status = 0x00000067 StatusInvOptParStream Status = 0x000000C0 StatusOptParNotAllwd Status = 0x000000C1 StatusInvParLen Status = 0x000000C2 StatusMissingOptParam Status = 0x000000C3 StatusInvOptParamVal Status = 0x000000C4 StatusDeliveryFailure Status = 0x000000FE StatusUnknownErr Status = 0x000000FF )
PDU Command Status set.
type SubmitMulti ¶
type SubmitMulti struct { }
SubmitMulti Not supported yet.
func (SubmitMulti) CommandID ¶
func (p SubmitMulti) CommandID() CommandID
func (SubmitMulti) MarshalBinary ¶
func (p SubmitMulti) MarshalBinary() ([]byte, error)
func (*SubmitMulti) UnmarshalBinary ¶
func (p *SubmitMulti) UnmarshalBinary(body []byte) error
type SubmitMultiResp ¶
type SubmitMultiResp struct { }
SubmitMultiResp Not supported yet.
func (SubmitMultiResp) CommandID ¶
func (p SubmitMultiResp) CommandID() CommandID
func (SubmitMultiResp) MarshalBinary ¶
func (p SubmitMultiResp) MarshalBinary() ([]byte, error)
func (*SubmitMultiResp) UnmarshalBinary ¶
func (p *SubmitMultiResp) UnmarshalBinary(body []byte) error
type SubmitSm ¶
type SubmitSm struct { ServiceType string SourceAddrTon int SourceAddrNpi int SourceAddr string DestAddrTon int DestAddrNpi int DestinationAddr string EsmClass EsmClass ProtocolID int PriorityFlag int ScheduleDeliveryTime time.Time ValidityPeriod time.Time RegisteredDelivery RegisteredDelivery ReplaceIfPresentFlag int DataCoding int SmDefaultMsgID int ShortMessage string Options *Options }
SubmitSm contains mandatory fields for submiting short message. There is no need to set SmLength it will be automatically set when encoding pdu to binary representation. Also long ShortMessages will be marshaled as payload in options.
func (SubmitSm) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (SubmitSm) Response ¶
func (p SubmitSm) Response(msgID string) *SubmitSmResp
Response creates new SubmitSmResp.
func (*SubmitSm) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type SubmitSmResp ¶
SubmitSmResp contains mandatory fields for submit_sm response.
func (SubmitSmResp) CommandID ¶
func (p SubmitSmResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (SubmitSmResp) MarshalBinary ¶
func (p SubmitSmResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*SubmitSmResp) UnmarshalBinary ¶
func (p *SubmitSmResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type TagID ¶
type TagID uint16
TagID represents two byte optional tag identifier.
const ( TagDestAddrSubUnit TagID = 0x0005 TagDestNetworkType TagID = 0x0006 TagDestBearerType TagID = 0x0007 TagDestTelematicsID TagID = 0x0008 TagSourceAddrSubunit TagID = 0x000D TagSourceNetworkType TagID = 0x000E TagSourceBearerType TagID = 0x000F TagSourceTelematicsID TagID = 0x0010 TagQosTimeToLive TagID = 0x0017 TagPayloadType TagID = 0x0019 TagAdditionalStatusInfoTe TagID = 0x001D TagReceiptedMessageID TagID = 0x001E TagMsMsgWaitFacilities TagID = 0x0030 TagPrivacyIndicator TagID = 0x0201 TagSourceSubaddress TagID = 0x0202 TagDestSubaddress TagID = 0x0203 TagUserMessageReference TagID = 0x0204 TagUserResponseCode TagID = 0x0205 TagSourcePort TagID = 0x020A TagDestinationPort TagID = 0x020B TagSarMsgRefNum TagID = 0x020C TagLanguageIndicator TagID = 0x020D TagSarTotalSegments TagID = 0x020E TagSarSegmentSeqnum TagID = 0x020F TagScInterfaceVersion TagID = 0x0210 TagCallbackNumPresInd TagID = 0x0302 TagCallbackNumA TagID = 0x0303 TagNumberOfMessages TagID = 0x0304 TagCallbackNum TagID = 0x0381 TagDpfResult TagID = 0x0420 TagSetDPF TagID = 0x0421 TagMsAvailabilityStatus TagID = 0x0422 TagNetworkErrorCode TagID = 0x0423 TagMessagePayload TagID = 0x0424 TagDeliveryFailureReason TagID = 0x0425 TagMoreMessagesToSend TagID = 0x0426 TagMessageState TagID = 0x0427 TagUssdServiceOp TagID = 0x0501 TagDisplayTime TagID = 0x1201 TagSmsSignal TagID = 0x1203 TagMsValidity TagID = 0x1204 TagAlertOnMessageDeliv TagID = 0x130C TagItsReplyType TagID = 0x1380 TagItsSessionInfo TagID = 0x1383 )
PDU tags for optional fields.
type Unbind ¶
type Unbind struct{}
Unbind defines unbind PDU.
func (Unbind) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (Unbind) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
type UnbindResp ¶
type UnbindResp struct{}
UnbindResp defines unbind_resp PDU.
func (UnbindResp) CommandID ¶
func (p UnbindResp) CommandID() CommandID
CommandID implements pdu.PDU interface.
func (UnbindResp) MarshalBinary ¶
func (p UnbindResp) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface.
func (UnbindResp) UnmarshalBinary ¶
func (p UnbindResp) UnmarshalBinary(body []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.