Documentation
¶
Index ¶
- Constants
- Variables
- type AAREapduTCAP
- type AARQapduTCAP
- type ABRTapduTCAP
- type AbortTCAP
- type AssociateSourceDiagnostic
- type BeginOption
- type BeginTCAP
- type ComponentTCAP
- type ContinueOption
- func WithContinueDialogueObject(dialogue *DialogueTCAP) ContinueOption
- func WithContinueDialogueRequest(acn, acnVersion int) ContinueOption
- func WithContinueDialogueResponse(acn, acnVersion int) ContinueOption
- func WithContinueInvoke(invID int, opCode uint8, payload []byte) ContinueOption
- func WithContinueReturnResultLast(invID int, opCode *uint8, payload []byte) ContinueOption
- type ContinueTCAP
- type DialogueTCAP
- type EndOption
- type EndTCAP
- type InvokeTCAP
- type MessageType
- type ParseError
- type RejectTCAP
- type ReturnErrorTCAP
- type ReturnResultTCAP
- type TCAP
- type TransactionID
- type UnidirectionalTCAP
- type ValidationError
Constants ¶
const ( // ASN.1 field omission indicator // Used throughout the codebase to indicate optional fields should be omitted FieldOmissionValue = 255 // Transaction ID constraints per ITU-T Q.773 MinTransactionIDLength = 1 MaxTransactionIDLength = 4 // Invoke ID constraints (signed 8-bit integer range) MinInvokeID = -128 MaxInvokeID = 127 // ASN.1 tag values ExternalConstructorTag = 0x28 // EXTERNAL with constructor SequenceConstructorTag = 0x30 // SEQUENCE with constructor // Protocol version for TCAP dialogue DefaultProtocolVersion = 0x80 // 128 decimal )
const (
IndefiniteLengthErrorString = "indefinite length found (not DER)"
)
ASN1 standard package error string
Variables ¶
var ( // DefaultDialogueAsId represents the standard TCAP dialogue object identifier DefaultDialogueAsId = []int{0, 0, 17, 773, 1, 1, 1} // DefaultAcnPrefix represents the prefix for the Application Context Name (ACN) in TCAP dialogue identifiers. DefaultAcnPrefix = []int{0, 4, 0, 0, 1, 0} )
Dialogue ASN.1 Object Identifier constants
var ( // ErrInvalidInput indicates invalid input data ErrInvalidInput = errors.New("invalid input data") // ErrEmptyData indicates empty or nil data ErrEmptyData = errors.New("empty data provided") // ErrUnmarshalFailed indicates ASN.1 unmarshal failure ErrUnmarshalFailed = errors.New("failed to unmarshal ASN.1 data") // ErrMarshalFailed indicates ASN.1 marshal failure ErrMarshalFailed = errors.New("failed to marshal ASN.1 data") // ErrInvalidTransactionID indicates invalid transaction ID ErrInvalidTransactionID = errors.New("invalid transaction ID") // ErrInvalidInvokeID indicates invalid invoke ID ErrInvalidInvokeID = errors.New("invalid invoke ID") )
Error types for better error handling and debugging
Functions ¶
This section is empty.
Types ¶
type AAREapduTCAP ¶
type AAREapduTCAP struct {
ProtocolVersionPadded *uint8
AcnVersion []int
Result uint8
ResultSourceDiagnostic AssociateSourceDiagnostic
UserInformation []byte
}
type AARQapduTCAP ¶
type ABRTapduTCAP ¶
type AbortTCAP ¶
type AbortTCAP struct {
Dtid TransactionID
PAbortCause *uint8
UAbortCause *DialogueTCAP
}
func (*AbortTCAP) MessageType ¶ added in v1.1.0
func (tcAbort *AbortTCAP) MessageType() MessageType
type BeginOption ¶ added in v1.0.0
BeginOption represents a functional option for configuring Begin TCAP messages
func WithBeginDialogueObject ¶ added in v1.0.0
func WithBeginDialogueObject(dialogue *DialogueTCAP) BeginOption
WithBeginDialogueObject adds a dialogue object to a Begin TCAP message
func WithBeginDialogueRequest ¶ added in v1.1.0
func WithBeginDialogueRequest(acn, acnVersion int) BeginOption
WithBeginDialogueRequest adds a dialogue to a Begin TCAP message
func WithBeginInvoke ¶ added in v1.0.0
func WithBeginInvoke(invID int, opCode uint8, payload []byte) BeginOption
WithBeginInvoke adds an Invoke component to a Begin TCAP message
type BeginTCAP ¶
type BeginTCAP struct {
Otid TransactionID
Dialogue *DialogueTCAP
Components *ComponentTCAP
}
func (*BeginTCAP) MessageType ¶ added in v1.1.0
func (tcBegin *BeginTCAP) MessageType() MessageType
type ComponentTCAP ¶
type ComponentTCAP struct {
Invoke *InvokeTCAP
ReturnResultLast *ReturnResultTCAP
ReturnError *ReturnErrorTCAP
Reject *RejectTCAP
ReturnResultNotLast *ReturnResultTCAP
// Linked list here to include presence of more than one component
MoreComponents *ComponentTCAP
}
ComponentTCAP will have only one field fulfilled and the others will be nil, except MoreComponents may exist additionally to any other field
func (*ComponentTCAP) TreatRecursiveMoreComponents ¶
func (components *ComponentTCAP) TreatRecursiveMoreComponents(cmpnt *asn1tcapmodel.ComponentPortion)
type ContinueOption ¶ added in v1.0.0
type ContinueOption func(*ContinueTCAP) error
ContinueOption represents a functional option for configuring Continue TCAP messages
func WithContinueDialogueObject ¶ added in v1.0.0
func WithContinueDialogueObject(dialogue *DialogueTCAP) ContinueOption
WithContinueDialogueObject adds a dialogue object to a Continue TCAP message
func WithContinueDialogueRequest ¶ added in v1.1.0
func WithContinueDialogueRequest(acn, acnVersion int) ContinueOption
WithContinueDialogueRequest adds a dialogue to a Continue TCAP message
func WithContinueDialogueResponse ¶ added in v1.1.0
func WithContinueDialogueResponse(acn, acnVersion int) ContinueOption
WithContinueDialogueResponse adds a dialogue to a Continue TCAP message
func WithContinueInvoke ¶ added in v1.0.0
func WithContinueInvoke(invID int, opCode uint8, payload []byte) ContinueOption
WithContinueInvoke adds an Invoke component to a Continue TCAP message
func WithContinueReturnResultLast ¶ added in v1.0.0
func WithContinueReturnResultLast(invID int, opCode *uint8, payload []byte) ContinueOption
WithContinueReturnResultLast adds a ReturnResultLast component to a Continue TCAP message
type ContinueTCAP ¶
type ContinueTCAP struct {
Otid TransactionID
Dtid TransactionID
Dialogue *DialogueTCAP
Components *ComponentTCAP
}
func (*ContinueTCAP) Marshal ¶ added in v1.1.0
func (tcContinue *ContinueTCAP) Marshal() ([]byte, error)
func (*ContinueTCAP) MessageType ¶ added in v1.1.0
func (tcContinue *ContinueTCAP) MessageType() MessageType
type DialogueTCAP ¶
type DialogueTCAP struct {
DialogAsId []int
DialogueRequest *AARQapduTCAP
DialogueResponse *AAREapduTCAP
DialogueAbort *ABRTapduTCAP
}
func NewDialogueResponseFromDialogueRequest ¶ added in v1.1.0
func NewDialogueResponseFromDialogueRequest(dialogueRQ *DialogueTCAP) (dialogueRE *DialogueTCAP, err error)
type EndOption ¶ added in v1.0.0
EndOption represents a functional option for configuring End TCAP messages
func WithEndDialogueObject ¶ added in v1.0.0
func WithEndDialogueObject(dialogue *DialogueTCAP) EndOption
WithEndDialogueObject adds a dialogue object to an End TCAP message
func WithEndDialogueResponse ¶ added in v1.1.0
WithEndDialogueResponse adds a dialogue to an End TCAP message
func WithEndReturnError ¶ added in v1.2.2
WithEndReturnError adds a ReturnError component to an End TCAP message
type EndTCAP ¶
type EndTCAP struct {
Dtid TransactionID
Dialogue *DialogueTCAP
Components *ComponentTCAP
}
func (*EndTCAP) MessageType ¶ added in v1.1.0
func (tcEnd *EndTCAP) MessageType() MessageType
type InvokeTCAP ¶
type MessageType ¶ added in v1.1.0
type MessageType string
const ( MessageTypeUnidirectional MessageType = "Unidirectional" MessageTypeBegin MessageType = "Begin" MessageTypeEnd MessageType = "End" MessageTypeContinue MessageType = "Continue" MessageTypeAbort MessageType = "Abort" )
type ParseError ¶ added in v0.4.0
type ParseError struct {
Op string // operation that failed
Field string // field that caused the error
Err error // underlying error
}
ParseError represents a parsing error with additional context
func (*ParseError) Error ¶ added in v0.4.0
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶ added in v0.4.0
func (e *ParseError) Unwrap() error
type RejectTCAP ¶
type ReturnErrorTCAP ¶
type ReturnResultTCAP ¶
type TCAP ¶
type TCAP interface {
Marshal() ([]byte, error)
MessageType() MessageType
}
TCAP represents a CHOICE of TCAP message types such as Unidirectional, Begin, End, Continue, or Abort.
func NewBegin ¶
func NewBegin(otid []byte, options ...BeginOption) (TCAP, error)
NewBegin creates a Begin TCAP message using the options pattern Parameters:
- otid: Originating Transaction ID, size from 1 to 4 bytes in BigEndian format.
func NewContinue ¶
func NewContinue(otid []byte, dtid []byte, options ...ContinueOption) (TCAP, error)
NewContinue creates a Continue TCAP message using the options pattern Parameters:
- otid: Originating Transaction ID, size from 1 to 4 bytes in BigEndian format.
- dtid: Destination Transaction ID, size from 1 to 4 bytes in BigEndian format.
func ParseDER ¶
ParseDER takes a slice of byte, without a tag and length. A tag byte and length byte are added at the beginning internally to satisfy asn1 Unmarshal behavior for completeness It parses on DER encoded asn1 structs, the encoding/asn1 package parses on DER (indefinite length is not supported)
type TransactionID ¶
type TransactionID []byte
TransactionID size from 1 up to 4 bytes in BigEndian format
type UnidirectionalTCAP ¶
type UnidirectionalTCAP struct {
Dialogue *DialogueTCAP
Components ComponentTCAP
}
func (*UnidirectionalTCAP) Marshal ¶ added in v1.1.0
func (tcUnidirectional *UnidirectionalTCAP) Marshal() ([]byte, error)
func (*UnidirectionalTCAP) MessageType ¶ added in v1.1.0
func (tcUnidirectional *UnidirectionalTCAP) MessageType() MessageType
type ValidationError ¶ added in v0.4.0
ValidationError represents a validation error with context
func (*ValidationError) Error ¶ added in v0.4.0
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶ added in v0.4.0
func (e *ValidationError) Unwrap() error