softphone

package
v3.0.0-...-dbc7dd3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package softphone provides abstractions for SIP over Websocket

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bdy

type Bdy struct {
	XMLName   xml.Name `xml:"Bdy"`
	SrvLvl    string   `xml:"SrvLvl,attr"`
	SrvLvlExt string   `xml:"SrvLvlExt,attr"`
	Phn       string   `xml:"Phn,attr"`
	Nm        string   `xml:"Nm,attr"`
	ToPhn     string   `xml:"ToPhn,attr"`
	ToNm      string   `xml:"ToNm,attr"`
	RecURL    string   `xml:"RecUrl,attr"`
}

Bdy ...

type Hdr

type Hdr struct {
	XMLName xml.Name `xml:"Hdr"`
	SID     string   `xml:"SID,attr"`
	Req     string   `xml:"Req,attr"`
	From    string   `xml:"From,attr"`
	To      string   `xml:"To,attr"`
	Cmd     string   `xml:"Cmd,attr"`
}

Hdr ...

type Msg

type Msg struct {
	XMLName xml.Name `xml:"Msg"`
	Hdr     Hdr      `xml:"Hdr"`
	Bdy     Bdy      `xml:"Bdy"`
}

Msg ...

type SIPInfoResponse

type SIPInfoResponse struct {
	Username           string `json:"username"`
	Password           string `json:"password"`
	AuthorizationID    string `json:"authorizationId"`
	Domain             string `json:"domain"`
	OutboundProxy      string `json:"outboundProxy"`
	Transport          string `json:"transport"`
	Certificate        string `json:"certificate"`
	SwitchBackInterval int    `json:"switchBackInterval"`
}

SIPInfoResponse ...

type SIPMessage

type SIPMessage struct {
	Body string
	// contains filtered or unexported fields
}

SIPMessage ...

func (SIPMessage) FromString

func (sm SIPMessage) FromString(s string) SIPMessage

FromString ...

func (SIPMessage) Response

func (sm SIPMessage) Response(softphone Softphone, statusCode int, headers map[string]string, body string) string

Response ...

func (SIPMessage) ToString

func (sm SIPMessage) ToString() string

ToString ...

type Softphone

type Softphone struct {
	OnInvite func(inviteMessage SIPMessage) // sipmessage.go

	FakeEmail string
	// contains filtered or unexported fields
}

Softphone ...

func NewSoftPhone

func NewSoftPhone(sipInfo SIPInfoResponse) *Softphone

NewSoftPhone ...

func (*Softphone) CloseToInvite

func (softphone *Softphone) CloseToInvite()

CloseToInvite removes the previously set invite listener.

func (*Softphone) Invite

func (softphone *Softphone) Invite(extension, offer string)

Invite ...

func (*Softphone) OnOK

func (softphone *Softphone) OnOK(hdlr func(string))

OnOK adds a handler that responds to any incoming ok events.

func (*Softphone) OpenToInvite

func (softphone *Softphone) OpenToInvite()

OpenToInvite adds a handler that responds to any incoming invites.

Jump to

Keyboard shortcuts

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