Documentation
¶
Overview ¶
Originally forked from https://github.com/ghettovoice/gosip by @ghetovoice
transaction package implements SIP Transaction Layer
Index ¶
- Constants
- Variables
- func MakeClientTxKey(msg sip.Message) (string, error)
- func MakeServerTxKey(msg sip.Message) (string, error)
- type ClientTx
- func (tx *ClientTx) Cancel() error
- func (tx *ClientTx) Done() <-chan struct{}
- func (tx *ClientTx) Err() error
- func (tx *ClientTx) Init() error
- func (tx *ClientTx) Key() string
- func (tx *ClientTx) OnTerminate(f FnTxTerminate)
- func (tx *ClientTx) Origin() *sip.Request
- func (tx *ClientTx) Receive(res *sip.Response) error
- func (tx *ClientTx) Responses() <-chan *sip.Response
- func (tx *ClientTx) String() string
- func (tx *ClientTx) Terminate()
- type ErrorHandler
- type FSMfunc
- type FnTxTerminate
- type FsmContextState
- type FsmInput
- type FsmState
- type Layer
- func (txl *Layer) Close()
- func (txl *Layer) OnRequest(h RequestHandler)
- func (txl *Layer) Request(ctx context.Context, req *sip.Request) (*ClientTx, error)
- func (txl *Layer) Respond(res *sip.Response) (*ServerTx, error)
- func (txl *Layer) Transport() sip.Transport
- func (txl *Layer) UnhandledResponseHandler(f UnhandledResponseHandler)
- type RequestHandler
- type ServerTx
- func (tx *ServerTx) Acks() <-chan *sip.Request
- func (tx *ServerTx) Cancels() <-chan *sip.Request
- func (tx *ServerTx) Done() <-chan struct{}
- func (tx *ServerTx) Err() error
- func (tx *ServerTx) Init() error
- func (tx *ServerTx) Key() string
- func (tx *ServerTx) OnTerminate(f FnTxTerminate)
- func (tx *ServerTx) Origin() *sip.Request
- func (tx *ServerTx) Receive(req *sip.Request) error
- func (tx *ServerTx) Respond(res *sip.Response) error
- func (tx *ServerTx) String() string
- func (tx *ServerTx) Terminate()
- type UnhandledResponseHandler
Constants ¶
View Source
const ( T1 = 500 * time.Millisecond T2 = 4 * time.Second T4 = 5 * time.Second Timer_A = T1 Timer_B = 64 * T1 Timer_D = 32 * time.Second Timer_E = T1 Timer_F = 64 * T1 Timer_G = T1 Timer_H = 64 * T1 Timer_I = T4 Timer_J = 64 * T1 Timer_K = T4 Timer_1xx = 200 * time.Millisecond Timer_L = 64 * T1 Timer_M = 64 * T1 TxSeperator = "__" )
Variables ¶
View Source
var ( // Transaction Layer Errors can be detected and handled with different response on caller side // https://www.rfc-editor.org/rfc/rfc3261#section-8.1.3.1 ErrTimeout = errors.New("transaction timeout") ErrTransport = errors.New("transaction transport error") )
Functions ¶
func MakeClientTxKey ¶
MakeClientTxKey creates client key for matching responses - RFC 3261 17.1.3.
Types ¶
type ClientTx ¶
type ClientTx struct {
// contains filtered or unexported fields
}
func NewClientTx ¶
func (*ClientTx) OnTerminate ¶
func (tx *ClientTx) OnTerminate(f FnTxTerminate)
type ErrorHandler ¶
type ErrorHandler func(err error)
type FnTxTerminate ¶
type FnTxTerminate func(key string)
type FsmContextState ¶
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
func (*Layer) OnRequest ¶
func (txl *Layer) OnRequest(h RequestHandler)
func (*Layer) UnhandledResponseHandler ¶
func (txl *Layer) UnhandledResponseHandler(f UnhandledResponseHandler)
UnhandledResponseHandler can be used in case missing client transactions for handling response ServerTransaction handle responses by state machine
type RequestHandler ¶
type RequestHandler func(req *sip.Request, tx sip.ServerTransaction)
type ServerTx ¶
type ServerTx struct {
// contains filtered or unexported fields
}
func NewServerTx ¶
func (*ServerTx) OnTerminate ¶
func (tx *ServerTx) OnTerminate(f FnTxTerminate)
Click to show internal directories.
Click to hide internal directories.