Documentation
¶
Overview ¶
Package siptx runs SIP transactions over net.Conns, on sipgo's transactions.
Index ¶
- Variables
- func NewCancel(invite *sip.Request) *sip.Request
- type ClientTx
- type Layer
- func (l *Layer) Do(ctx context.Context, req *sip.Request, c net.Conn) (*sip.Response, error)
- func (l *Layer) OnRequest(h RequestHandler)
- func (l *Layer) OnResponse(h ResponseHandler)
- func (l *Layer) Request(req *sip.Request, c net.Conn) (*ClientTx, error)
- func (l *Layer) Serve(c net.Conn, stream bool) error
- func (l *Layer) Write(c net.Conn, msg sip.Message) error
- type RequestHandler
- type ResponseHandler
- type ServerTx
Constants ¶
This section is empty.
Variables ¶
View Source
var CancelTimeout = 5 * time.Second
CancelTimeout bounds the CANCEL a cancelled INVITE sends.
Functions ¶
Types ¶
type ClientTx ¶
ClientTx is a client transaction.
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer runs the client and server transactions of the conns it serves.
func (*Layer) OnRequest ¶
func (l *Layer) OnRequest(h RequestHandler)
OnRequest sets the handler of new requests.
func (*Layer) OnResponse ¶
func (l *Layer) OnResponse(h ResponseHandler)
OnResponse sets the handler of the responses no client transaction takes.
type RequestHandler ¶
RequestHandler handles a new request in its own goroutine; tx is nil for the ACK of a 2xx.
type ResponseHandler ¶
ResponseHandler handles a response no client transaction takes. It must not block.
Click to show internal directories.
Click to hide internal directories.