Documentation ¶
Overview ¶
Package twiml provides Twilio Markup Language support for building web services with instructions for twilio how to handle incoming call or message.
Index ¶
Constants ¶
View Source
const ( TwiMan = "man" TwiWoman = "woman" TwiEnglish = "en" TwiBritish = "en-gb" TwiSpanish = "es" TwiFrench = "fr" TwiGerman = "de" // -------------------------- TwiAlice = "alice" TwiDanishDenmark = "da-DK" TwiGermanGermany = "de-DE" TwiEnglishAustralia = "en-AU" TwiEnglishCanada = "en-CA" TwiEnglishUK = "en-UK" TwiEnglishIndia = "en-IN" TwiEnglishUSA = "en-US" TwiSpanishCatalan = "ca-ES" TwiSpanishSpain = "es-ES" TwiSpanishMexico = "es-MX" TwiFinishFinland = "fi-FI" TwiFrenchCanada = "fr-CA" TwiFrenchFrance = "fr-FR" TwiItalianItaly = "it-IT" TwiJapaneseJapan = "ja-JP" TwiKoreanKorea = "ko-KR" TwiNorwegianNorway = "nb-NO" TwiDutchNetherlands = "nl-NL" TwiPolishPoland = "pl-PL" TwiPortugueseBrazil = "pt-BR" TwiPortuguesePortugal = "pt-PT" TwiRussianRussia = "ru-RU" TwiSwedishSweden = "sv-SE" TwiChineseMandarin = "zh-CH" TwiChineseCantonese = "zh-HK" TwiChineseTaiwanese = "zh-TW" )
View Source
const ( TwiCallSid = "CallSid" TwiAccountSid = "AccountSid" TwiFrom = "From" TwiTo = "To" TwiCallStatus = "CallStatus" TwiApiVersion = "ApiVersion" TwiDirection = "Direction" TwiForwardedFrom = "ForwardedFrom" TwiCallerName = "CallerName" // Geographic data TwiFromCity = "FromCity" TwiFromState = "FromState" TwiFromZip = "FromZip" TwiFromCountry = "FromCountry" TwiToCity = "ToCity" TwiToState = "ToState" TwiToZip = "ToZip" TwiToCountry = "Tocountry" // Status callback TwiCallDuration = "CallDuration" TwiRecordingUrl = "RecordingUrl" TwiRecordingSid = "RecordingSid" TwiRecordingDuration = "RecordingDuration" // Below parameters are included in AddCallerId request response TwiVerificationStatus = "VerificationStatus" TwiOutgoingCallerIdSid = "OutgoingCallerIdSid" )
Twilio callback status parameters for: Call End Callback (StatusCallback), Voice Request
View Source
const ( TwiQueued = "queued" TwiRinging = "ringing" TwiInProgress = "in-progress" TwiCompleted = "completed" TwiBusy = "busy" TwiFailed = "failed" TwiNoAnswer = "no-answer" TwiCanceled = "canceled" )
Call status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conference ¶
type Conference struct { XMLName xml.Name `xml:"Conference"` Muted bool `xml:"muted,attr,omitempty"` Beep string `xml:"beep,attr,omitempty"` StartConferenceOnEnter bool `xml:"startConferenceOnEnter,attr,omitempty"` EndConferenceOnExit bool `xml:"endConferenceOnExit,attr,omitempty"` WaitUrl string `xml:"waitUrl,attr,omitempty"` WaitMethod string `xml:"waitMethod,attr,omitempty"` MaxParticipants int `xml:"maxParticipants,attr,omitempty"` Name string `xml:",chardata"` }
type Dial ¶
type Dial struct { XMLName xml.Name `xml:"Dial"` Action string `xml:"action,attr,omitempty"` Method string `xml:"method,attr,omitempty"` Timeout int `xml:"timeout,attr,omitempty"` HangupOnStar bool `xml:"hangupOnStar,attr,omitempty"` TimeLimit int `xml:"timeLimit,attr,omitempty"` CallerId string `xml:"callerId,attr,omitempty"` Record bool `xml:"record,attr,omitempty"` Number string `xml:",chardata"` Nested []interface{} }
type Gather ¶
type Gather struct { XMLName xml.Name `xml:"Gather"` Action string `xml:"action,attr,omitempty"` Method string `xml:"method,attr,omitempty"` Timeout int `xml:"timeout,attr,omitempty"` FinishOnKey string `xml:"finishOnKey,attr,omitempty"` NumDigits int `xml:"numDigits,attr,omitempty"` Nested []interface{} }
type Message ¶
type Message struct { XMLName xml.Name `xml:"Message"` To string `xml:"to,attr,omitempty"` From string `xml:"from,attr,omitempty"` Action string `xml:"action,attr,omitempty"` Method string `xml:"method,attr,omitempty"` StatusCallback string `xml:"statusCallback,attr,omitempty"` Body string `xml:"Body,omitempty"` Media string `xml:"Media,omitempty"` }
type Record ¶
type Record struct { XMLName xml.Name `xml:"Record"` Action string `xml:"action,attr,omitempty"` Method string `xml:"method,attr,omitempty"` Timeout int `xml:"timeout,attr,omitempty"` FinishOnKey string `xml:"finishOnKey,attr,omitempty"` MaxLength int `xml:"maxLength,attr,omitempty"` Transcribe bool `xml:"transcribe,attr,omitempty"` TranscribeCallback string `xml:"transcribeCallback,attr,omitempty"` PlayBeep bool `xml:"playBeep,attr,omitempty"` }
type Response ¶
func (*Response) Action ¶
Action appends action verb structs to response. Valid verbs: Enqueue, Say, Leave, Message, Pause, Play, Record, Redirect, Reject, Hangup
func (*Response) Dial ¶
Dial appends dial action verb and noun structs to respose Valid verb: Dial. Valid nouns: Client, Conference, Number, Queue, Sip
func (*Response) Gather ¶
Gather collects digits a caller enter by pressing the keypad Valid verb: Gather. Valid nested verbs: Say, Pause, Play
Click to show internal directories.
Click to hide internal directories.