softphone

package
v0.0.0-...-d938a51 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCert

func LoadCert(keyFile, certFile string) webrtc.Certificate

Types

type Options

type Options struct {
	Username  string
	Password  string
	Domain    string
	Transport string
	Host      string
	Path      string
	Port      uint16
	SRTPKey   string
	SRTPCert  string
	Verbose   bool
}

type SipMessage

type SipMessage struct {
	Subject string
	Headers map[string]string
	Body    string
}

SipMessage SIP message

func FromStringToSipMessage

func FromStringToSipMessage(message string) (sipMessage SipMessage)

FromStringToSipMessage from string message to SipMessage

func (*SipMessage) IncreaseSeq

func (sipMessage *SipMessage) IncreaseSeq()

IncreaseSeq increase CSeq

func (SipMessage) ToString

func (sipMessage SipMessage) ToString() (message string)

ToString from SipMessage to string message

type Softphone

type Softphone struct {
	OnInvite func(inviteMessage SipMessage)
	OnTrack  func(remote *webrtc.TrackRemote, local *webrtc.TrackLocalStaticSample)
	// contains filtered or unexported fields
}

Softphone softphone

func New

func New(options Options, cert webrtc.Certificate) *Softphone

func (*Softphone) Answer

func (s *Softphone) Answer(inviteMessage SipMessage)

Answer answer an incoming call

func (*Softphone) Invite

func (s *Softphone) Invite(extension string)

func (*Softphone) Register

func (s *Softphone) Register()

Register register the softphone

func (*Softphone) Send

func (s *Softphone) Send(sipMessage SipMessage, responseHandler func(string) bool)

Send send message via WebSocket

Jump to

Keyboard shortcuts

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