Documentation ¶
Index ¶
- type InviteSessionHandler
- type LegKey
- type Register
- type RegisterHandler
- type SessionHandler
- type SessionKey
- type UserAgent
- func (ua *UserAgent) Invite(profile *account.Profile, target sip.Uri, recipient sip.SipUri, body *string) (*session.Session, error)
- func (ua *UserAgent) InviteWithContext(ctx context.Context, profile *account.Profile, target sip.Uri, ...) (*session.Session, error)
- func (ua *UserAgent) Log() log.Logger
- func (ua *UserAgent) Request(req *sip.Request) (sip.ClientTransaction, error)
- func (ua *UserAgent) RequestWithContext(ctx context.Context, request sip.Request, authorizer sip.Authorizer, ...) (sip.Response, error)
- func (ua *UserAgent) SendRegister(profile *account.Profile, recipient sip.SipUri, expires uint32, ...) (*Register, error)
- func (ua *UserAgent) Shutdown()
- type UserAgentConfig
- type UserLeg
- type UserLegConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InviteSessionHandler ¶
type InviteSessionHandler func(s *session.Session, req *sip.Request, resp *sip.Response, status session.Status)
InviteSessionHandler .
type LegKey ¶
type LegKey struct { CallID sip.CallID FromTag sip.MaybeString ToTag sip.MaybeString }
SessionKey - Session Key for Session Storage
func NewLegKey ¶
func NewLegKey(callID sip.CallID, from sip.MaybeString, to sip.MaybeString) LegKey
NewSessionKey - Build a Session Key quickly
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
func (*Register) SendRegister ¶
type SessionHandler ¶
type SessionHandler func(s *session.Session, req *sip.Request, resp *sip.Response, status session.Status)
SessionHandler:所有基于session的sip消息handler处理.
type SessionKey ¶
type SessionKey struct { CallID sip.CallID BranchID sip.MaybeString }
SessionKey - Session Key for Session Storage
func NewSessionKey ¶
func NewSessionKey(callID sip.CallID, branchID sip.MaybeString) SessionKey
NewSessionKey - Build a Session Key quickly
type UserAgent ¶
type UserAgent struct { InviteStateHandler InviteSessionHandler // state发生改变的回调函数, 默认为空. RegisterStateHandler RegisterHandler // contains filtered or unexported fields }
UserAgent . 支持多个呼叫.
func NewUserAgent ¶
func NewUserAgent(config *UserAgentConfig) *UserAgent
协程池处理所有异步操作. NewUserAgent . ua拦截了sipstack的所有消息.
func (*UserAgent) InviteWithContext ¶
func (ua *UserAgent) InviteWithContext(ctx context.Context, profile *account.Profile, target sip.Uri, recipient sip.SipUri, body *string) (*session.Session, error)
发送invite,并返回invite对应的事务session, body为sdp内容.
func (*UserAgent) RequestWithContext ¶
func (ua *UserAgent) RequestWithContext(ctx context.Context, request sip.Request, authorizer sip.Authorizer, waitForResult bool, attempt int) (sip.Response, error)
RequestWithContext:所有请求发送统一处理,并等待对应的响应 . waitForResult:是否同步等待所有响应.
func (*UserAgent) SendRegister ¶
type UserAgentConfig ¶
UserAgentConfig:协议栈的配置. .
Click to show internal directories.
Click to hide internal directories.