rcscript

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandPlay     string = "Play"
	StatusCompleted string = "Completed"
)
View Source
const (
	DefaultParamValue                     string = "~"
	URLTelephonySessionFormat             string = "/restapi/v1.0/account/%s/telephony/sessions/%s"
	URLTelephonySessionsPartiesPlayFormat string = `/restapi/v1.0/account/%s/telephony/sessions/%s/parties/%s/play`
)

Variables

This section is empty.

Functions

func Bind

func Bind(evt interface{}, r *http.Request) error

Types

type CallEnterEvent

type CallEnterEvent struct {
	AccountID   string  `json:"accountId"`
	ExtensionID string  `json:"extensionId"`
	InParty     InParty `json:"inParty"`
	PartyID     string  `json:"partyId"`
	SessionID   string  `json:"sessionId"`
}

type CallExitEvent

type CallExitEvent struct {
	AccountID   string `json:"accountId"`
	ExtensionID string `json:"extensionId"`
	PartyID     string `json:"partyId"`
	SessionID   string `json:"sessionId"`
}

type CommandUpdateEvent

type CommandUpdateEvent struct {
	AccountID   string `json:"accountId"`
	Command     string `json:"command"`
	CommandID   string `json:"commandId"`
	ExtensionID string `json:"extensionId"`
	PartyID     string `json:"partyId"`
	SessionID   string `json:"sessionId"`
	Status      string `json:"status"`
}
{
  "accountId": "400131801008",
  "extensionId": "400137552008",
  "inParty": {
    "from": {
      "phoneNumber": "+12127150355"
    },
    "id": "p-467aa7237b524387b053c5d5f06787f5",
    "to": {
      "phoneNumber": "+12014320001"
    }
  },
  "partyId": "p-ec4202d7dd35401f9e6230d428493701",
  "sessionId": "s-82eecd460b564de1a42b395eb845d912"
}

type Extension

type Extension struct {
	PhoneNumber string `json:"phoneNumber"`
}

type InParty

type InParty struct {
	ID   string    `json:"id"`
	From Extension `json:"from"`
	To   Extension `json:"to"`
}

type PlayRequest

type PlayRequest struct {
	Resources       []Resource `json:"resources"`
	InterruptByDtmf bool       `json:"interruptByDtmf"`
	RepeatCount     int        `json:"repeatCount"`
}

type RcScriptSdk

type RcScriptSdk struct {
	ServerURL string
	Token     string
}

RcScriptSdk is a simple SDK for making Call Scripting Commands

func (*RcScriptSdk) Hangup

func (sdk *RcScriptSdk) Hangup(sessionID string) (*http.Response, error)

Hangsup a call

func (*RcScriptSdk) Play

func (sdk *RcScriptSdk) Play(sessionID, partyID string, body PlayRequest) (*http.Response, error)

Play plays a media file

type Resource

type Resource struct {
	URI string `json:"uri"`
}

Jump to

Keyboard shortcuts

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