Documentation ¶
Index ¶
- Constants
- type RequestHandler
- type RequiresChallengeHandler
- type ServerAuthManager
- type SipStack
- func (s *SipStack) AckInviteRequest(request sip.Request, response sip.Response)
- func (s *SipStack) CancelRequest(request sip.Request, response sip.Response)
- func (s *SipStack) GetNetworkInfo(protocol string) *transport.Target
- func (s *SipStack) Listen(protocol string, listenAddr string) error
- func (s *SipStack) ListenTLS(protocol string, listenAddr string, options *transport.TLSConfig) error
- func (s *SipStack) Log() log.Logger
- func (s *SipStack) OnConnectionError(handler func(err *transport.ConnectionError))
- func (s *SipStack) OnRequest(method sip.RequestMethod, handler RequestHandler) error
- func (s *SipStack) RememberInviteRequest(request sip.Request)
- func (s *SipStack) Request(req sip.Request) (sip.ClientTransaction, error)
- func (s *SipStack) Respond(res sip.Response) (sip.ServerTransaction, error)
- func (s *SipStack) RespondOnRequest(request sip.Request, status sip.StatusCode, reason, body string, ...) (sip.ServerTransaction, error)
- func (s *SipStack) Send(msg sip.Message) error
- func (s *SipStack) Shutdown()
- type SipStackConfig
Constants ¶
View Source
const (
// DefaultUserAgent .
DefaultUserAgent = "Go SipStack/1.0.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 .
type SipStack ¶
type SipStack struct {
// contains filtered or unexported fields
}
SipStack a golang SIP Stack
func NewSipStack ¶
func NewSipStack(config *SipStackConfig) *SipStack
NewSipStack creates new instance of SipStack.
func (*SipStack) AckInviteRequest ¶
func (*SipStack) CancelRequest ¶
func (*SipStack) GetNetworkInfo ¶
func (*SipStack) ListenTLS ¶
func (s *SipStack) ListenTLS(protocol string, listenAddr string, options *transport.TLSConfig) error
ListenTLS starts serving listeners on the provided address
func (*SipStack) OnConnectionError ¶
func (s *SipStack) OnConnectionError(handler func(err *transport.ConnectionError))
func (*SipStack) OnRequest ¶
func (s *SipStack) OnRequest(method sip.RequestMethod, handler RequestHandler) error
OnRequest registers new request callback
func (*SipStack) RememberInviteRequest ¶
func (*SipStack) RespondOnRequest ¶
type SipStackConfig ¶
type SipStackConfig 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 UserAgent string }
SipStackConfig describes available options
Click to show internal directories.
Click to hide internal directories.