Documentation ¶
Index ¶
- Constants
- func BuildTwilioCallURL(accountSid string) string
- func MakeCall(client *http.Client, apiURL string, opts TwilioCallsOpts) (*http.Response, error)
- func TwimlResponseProcess(w http.ResponseWriter, r *http.Request, res *twiml.Response)
- type GatherEvent
- type Start
- type Stream
- type StreamMessage
- type StreamMessageMark
- type StreamMessageMedia
- type StreamMessageStart
- type StreamMessageStop
- type TwilioCallsOpts
Constants ¶
const ( EventConnected = "connected" EventStart = "start" EventMedia = "media" EventStop = "stop" EventMark = "mark" )
const (
TwilioAPICallsJSONURLFormat = `https://api.twilio.com/2010-04-01/Accounts/%s/Calls.json`
)
Variables ¶
This section is empty.
Functions ¶
func BuildTwilioCallURL ¶
func TwimlResponseProcess ¶
Types ¶
type GatherEvent ¶
type GatherEvent struct { AccountSid string ApiVersion string Called string CalledCity string CalledCountry string Caller string CallerCity string CallerCountry string CallerState string CallerZip string CallStatus string Digits string FinishedOnKey string From string FromCity string FromState string FromZip string ToCity string ToCountry string ToState string ToZip string // contains filtered or unexported fields }
type StreamMessage ¶
type StreamMessage struct { Event string `json:"event"` Mark StreamMessageMark `json:"mark,omitempty"` Media StreamMessageMedia `json:"media,omitempty"` Protocol string `json:"protocol,omitempty"` SequenceNumber string `json:"sequenceNumber"` Start StreamMessageStart `json:"start,omitempty"` StreamSid string `json:"streamSid"` Stop StreamMessageStop `json:"stop,omitempty"` Version string `json:"version,omitempty"` }
StreamMessage is defined in https://www.twilio.com/docs/voice/twiml/stream
type StreamMessageMark ¶
type StreamMessageMark struct {
Name string `json:"name"`
}
StreamMessageMark is the property of a `mark` message. The `mark` event is sent only during bi-directional streaming by using the `<Connect>` verb. It is used to track, or label, when media has completed.
type StreamMessageMedia ¶
type StreamMessageMedia struct { Track string `json:"track"` Chunk string `json:"chunk"` Timestamp string `json:"timestamp"` Payload string `json:"payload"` }
StreamMessageMedia is a property of a media message. This message type encapsulates the raw audio data.
type StreamMessageStart ¶
type StreamMessageStart struct { AccountSid string `json:"accountSid"` CallSid string `json:"callSid"` StreamSid string `json:"streamSid"` Tracks []string `json:"tracks"` CustomParameters map[string]string `json:"customParameters"` }
StreamMessageStart is a property of a start message. This message contains important metadata about the stream and is sent immediately after the Connected message. It is only sent once at the start of the Stream.
type StreamMessageStop ¶
type StreamMessageStop struct { AccountSid string `json:"accountSid"` CallSid string `json:"callSid"` }
StreamMessageStop is a property of a stop message. A stop message will be sent when the Stream is either `<Stop>`ped or the Call has ended.
type TwilioCallsOpts ¶
type TwilioCallsOpts struct { To string `url:"To"` From string `url:"From"` CallbackURL string `url:"Url"` }
func (*TwilioCallsOpts) MustString ¶
func (opts *TwilioCallsOpts) MustString() string
func (*TwilioCallsOpts) StringsReader ¶
func (opts *TwilioCallsOpts) StringsReader() *strings.Reader