ua

package
v0.0.0-...-1df5730 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 NewRegister(ua *UserAgent, profile *account.Profile, recipient sip.SipUri, data interface{}) *Register

func (*Register) SendRegister

func (r *Register) SendRegister(expires uint32) error

func (*Register) Stop

func (r *Register) Stop()

type RegisterHandler

type RegisterHandler func(regState account.RegisterState)

RegisterHandler .

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) Invite

func (ua *UserAgent) Invite(profile *account.Profile, target sip.Uri, recipient sip.SipUri, body *string) (*session.Session, error)

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) Log

func (ua *UserAgent) Log() log.Logger

func (*UserAgent) Request

func (ua *UserAgent) Request(req *sip.Request) (sip.ClientTransaction, error)

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

func (ua *UserAgent) SendRegister(profile *account.Profile, recipient sip.SipUri, expires uint32, userdata interface{}) (*Register, error)

func (*UserAgent) Shutdown

func (ua *UserAgent) Shutdown()

关闭ua和sip stck.

type UserAgentConfig

type UserAgentConfig struct {
	SipStack *stack.SipStack
}

UserAgentConfig:协议栈的配置. .

type UserLeg

type UserLeg struct {
	// contains filtered or unexported fields
}

UserLeg : 对应协议栈的一路通话.

type UserLegConfig

type UserLegConfig struct {
	SipStack *stack.SipStack
}

UserAgentConfig .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL