Documentation
¶
Index ¶
- Constants
- type EndPoint
- func (e *EndPoint) AckInviteRequest(request sip.Request, response sip.Response)
- func (e *EndPoint) CancelRequest(request sip.Request, response sip.Response)
- func (e EndPoint) GetNetworkInfo(protocol string) *transport.Target
- func (e *EndPoint) Listen(protocol string, listenAddr string) error
- func (e *EndPoint) Log() log.Logger
- func (e *EndPoint) OnRequest(method sip.RequestMethod, handler RequestHandler) error
- func (e *EndPoint) RememberInviteRequest(request sip.Request)
- func (e *EndPoint) Request(req sip.Request) (sip.ClientTransaction, error)
- func (e *EndPoint) RequestWithContext(ctx context.Context, request sip.Request, authorizer sip.Authorizer) (sip.Response, error)
- func (e *EndPoint) Respond(res sip.Response) (sip.ServerTransaction, error)
- func (e *EndPoint) RespondOnRequest(request sip.Request, status sip.StatusCode, reason, body string, ...) (sip.ServerTransaction, error)
- func (e *EndPoint) Send(msg sip.Message) error
- func (e *EndPoint) Shutdown()
- type EndPointConfig
- type RequestHandler
- type RequiresChallengeHandler
- type ServerAuthManager
Constants ¶
View Source
const (
// DefaultUserAgent .
DefaultUserAgent = "Go SipStack/1.0.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndPoint ¶
type EndPoint struct {
// contains filtered or unexported fields
}
EndPoint is a SIP Client/Server
func NewEndPoint ¶
func NewEndPoint(config *EndPointConfig, logger log.Logger) *EndPoint
NewEndPoint creates new instance of SIP server.
func (*EndPoint) AckInviteRequest ¶
func (*EndPoint) CancelRequest ¶
func (EndPoint) GetNetworkInfo ¶
func (*EndPoint) OnRequest ¶
func (e *EndPoint) OnRequest(method sip.RequestMethod, handler RequestHandler) error
OnRequest registers new request callback
func (*EndPoint) RememberInviteRequest ¶
func (*EndPoint) RequestWithContext ¶
func (e *EndPoint) RequestWithContext(ctx context.Context, request sip.Request, authorizer sip.Authorizer) (sip.Response, error)
RequestWithContext .
func (*EndPoint) RespondOnRequest ¶
func (e *EndPoint) RespondOnRequest( request sip.Request, status sip.StatusCode, reason, body string, headers []sip.Header, ) (sip.ServerTransaction, error)
RespondOnRequest .
type EndPointConfig ¶
type EndPointConfig struct { // Public IP address or domain name, if empty auto resolved IP will be used. Host string // Dns is an address of the public DNS server to use in SRV lookup. Dns string Extensions []string MsgMapper sip.MessageMapper ServerAuthManager ServerAuthManager }
EndPointConfig describes available options
type RequestHandler ¶
type RequestHandler func(req sip.Request, tx sip.ServerTransaction)
RequestHandler is a callback that will be called on the incoming request of the certain method tx argument can be nil for 2xx ACK request
type RequiresChallengeHandler ¶
RequiresChallengeHandler will check if each request requires 401/407 authentication.
type ServerAuthManager ¶
type ServerAuthManager struct { Authenticator *auth.ServerAuthorizer RequiresChallenge RequiresChallengeHandler }
ServerAuthManager .
Click to show internal directories.
Click to hide internal directories.