bxml

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAllVerbs

func AddAllVerbs(response *etree.Element, verbs []Element)

func CreateDocument

func CreateDocument() (*etree.Document, *etree.Element)

func ToXML

func ToXML(document *etree.Document) (string, error)

func Voice

func Voice(verbs []Element) (string, error)

Types

type Element

type Element interface {
	GetName() string
	GetText() string
	GetAttr() (map[string]string, map[string]string)
	GetInnerElements() []Element
}

type VoiceGather

type VoiceGather struct {
	// gather_url: Gather URL
	// gather_method: Gather URL method
	// ... see docs above
	// OptionalAttributes: additional attributes
	GatherUrl            string
	GatherMethod         string
	GatherFallbackUrl    string
	GatherFallbackMethod string
	Username             string
	Password             string
	FallbackUsername     string
	FallbackPassword     string
	Tag                  string
	TerminatingDigits    string
	MaxDigits            string
	InterDigitTimeout    string
	FirstDigitTimeout    string
	RepeatCount          string
	InnerElements        []Element
	OptionalAttributes   map[string]string
}

VoiceGather <Gather> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/gather

func (VoiceGather) GetAttr

func (m VoiceGather) GetAttr() (map[string]string, map[string]string)

func (VoiceGather) GetInnerElements

func (m VoiceGather) GetInnerElements() []Element

func (VoiceGather) GetName

func (m VoiceGather) GetName() string

func (VoiceGather) GetText

func (m VoiceGather) GetText() string

type VoiceHangup

type VoiceHangup struct {
	// OptionalAttributes: additional attributes
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoiceHangup <Hangup> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/hangup/

func (VoiceHangup) GetAttr

func (m VoiceHangup) GetAttr() (map[string]string, map[string]string)

func (VoiceHangup) GetInnerElements

func (m VoiceHangup) GetInnerElements() []Element

func (VoiceHangup) GetName

func (m VoiceHangup) GetName() string

func (VoiceHangup) GetText

func (m VoiceHangup) GetText() string

type VoicePause

type VoicePause struct {
	// duration: Length in seconds to pause
	// OptionalAttributes: additional attributes
	Duration           string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoicePause <Pause> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/pause

func (VoicePause) GetAttr

func (m VoicePause) GetAttr() (map[string]string, map[string]string)

func (VoicePause) GetInnerElements

func (m VoicePause) GetInnerElements() []Element

func (VoicePause) GetName

func (m VoicePause) GetName() string

func (VoicePause) GetText

func (m VoicePause) GetText() string

type VoicePhoneNumber

type VoicePhoneNumber struct {
	// phone_number: Phone Number to dial
	// transfer_answer_url: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL.
	// transfer_answer_method: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST.
	// ... See BW Voice Docs: https://dev.bandwidth.com/docs/voice/bxml/transfer#phonenumber-attributes
	// OptionalAttributes: additional attributes
	PhoneNumber                  string
	TransferAnswerUrl            string
	TransferAnswerMethod         string
	TransferAnswerFallbackUrl    string
	TransferAnswerFallbackMethod string
	TransferDisconnectUrl        string
	TransferDisconnectMethod     string
	Username                     string
	Password                     string
	FallbackUsername             string
	FallbackPassword             string
	Tag                          string
	InnerElements                []Element
	OptionalAttributes           map[string]string
}

VoicePhoneNumber <PhoneNumber> BXML Noun https://dev.bandwidth.com/docs/voice/bxml/transfer/#nested-tags

func (VoicePhoneNumber) GetAttr

func (m VoicePhoneNumber) GetAttr() (map[string]string, map[string]string)

func (VoicePhoneNumber) GetInnerElements

func (m VoicePhoneNumber) GetInnerElements() []Element

func (VoicePhoneNumber) GetName

func (m VoicePhoneNumber) GetName() string

func (VoicePhoneNumber) GetText

func (m VoicePhoneNumber) GetText() string

type VoicePlayAudio

type VoicePlayAudio struct {
	// audio_uri: The URL of the audio file to play. May be a relative URL.
	// username: The username to send in the HTTP request to audioUri.
	// password: The password to send in the HTTP request to audioUri.
	// OptionalAttributes: additional attributes
	AudioUri           string
	Username           string
	Password           string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoicePlayAudio <PlayAudio> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/playAudio/

func (VoicePlayAudio) GetAttr

func (m VoicePlayAudio) GetAttr() (map[string]string, map[string]string)

func (VoicePlayAudio) GetInnerElements

func (m VoicePlayAudio) GetInnerElements() []Element

func (VoicePlayAudio) GetName

func (m VoicePlayAudio) GetName() string

func (VoicePlayAudio) GetText

func (m VoicePlayAudio) GetText() string

type VoiceRecord

type VoiceRecord struct {
	// record_complete_url: URL to send the Record Complete event to once the recording has ended. Accepts BXML, and may be a relative URL. This callback will not be sent if the recording ended due to the call hanging up.
	// record_complete_method: The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default value is POST.
	// ... see docs above
	// OptionalAttributes: additional attributes
	RecordCompleteUrl            string
	RecordCompleteMethod         string
	RecordCompleteFallbackUrl    string
	RecordCompleteFallbackMethod string
	RecordingAvailableUrl        string
	RecordingAvailableMethod     string
	Transcribe                   string
	DetectLanguage               string
	TranscriptionAvailableUrl    string
	TranscriptionAvailableMethod string
	Username                     string
	Password                     string
	FallbackUsername             string
	FallbackPassword             string
	Tag                          string
	TerminatingDigits            string
	MaxDuration                  string
	SilenceTimeout               string
	FileFormat                   string
	InnerElements                []Element
	OptionalAttributes           map[string]string
}

VoiceRecord <Record> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/record

func (VoiceRecord) GetAttr

func (m VoiceRecord) GetAttr() (map[string]string, map[string]string)

func (VoiceRecord) GetInnerElements

func (m VoiceRecord) GetInnerElements() []Element

func (VoiceRecord) GetName

func (m VoiceRecord) GetName() string

func (VoiceRecord) GetText

func (m VoiceRecord) GetText() string

type VoiceSipUri

type VoiceSipUri struct {
	// sip_url: SIP URL
	// uui: The value of the User-To-User header to send within the initial INVITE. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters.
	// transfer_answer_url: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL.
	// transfer_answer_method: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST.
	// ... See BW Voice Docs: https://dev.bandwidth.com/docs/voice/bxml/transfer#sipuri-attributes
	// OptionalAttributes: additional attributes
	SipUrl                       string
	Uui                          string
	TransferAnswerUrl            string
	TransferAnswerMethod         string
	TransferAnswerFallbackUrl    string
	TransferAnswerFallbackMethod string
	TransferDisconnectUrl        string
	TransferDisconnectMethod     string
	Username                     string
	Password                     string
	FallbackUsername             string
	FallbackPassword             string
	Tag                          string
	InnerElements                []Element
	OptionalAttributes           map[string]string
}

VoiceSipUri <SipUri> BXML Noun https://dev.bandwidth.com/docs/voice/bxml/transfer/#nested-tags

func (VoiceSipUri) GetAttr

func (m VoiceSipUri) GetAttr() (map[string]string, map[string]string)

func (VoiceSipUri) GetInnerElements

func (m VoiceSipUri) GetInnerElements() []Element

func (VoiceSipUri) GetName

func (m VoiceSipUri) GetName() string

func (VoiceSipUri) GetText

func (m VoiceSipUri) GetText() string

type VoiceSpeakSentence

type VoiceSpeakSentence struct {
	// text: The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags (see below for list of supported tags).
	// voice: Selects the voice of the speaker. If the voice attribute is present, gender and locale are ignored.
	// gender: Selects the gender of the speaker. Valid values are "male" or "female". Default "female". If the chosen gender does not exist for the region, the opposite gender will be used by default.
	// locale: Selects the locale of the speaker. Default "en_US".
	// OptionalAttributes: additional attributes
	Text               string
	Voice              string
	Gender             string
	Locale             string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoiceSpeakSentence <SpeakSentence> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/speakSentence

func (VoiceSpeakSentence) GetAttr

func (m VoiceSpeakSentence) GetAttr() (map[string]string, map[string]string)

func (VoiceSpeakSentence) GetInnerElements

func (m VoiceSpeakSentence) GetInnerElements() []Element

func (VoiceSpeakSentence) GetName

func (m VoiceSpeakSentence) GetName() string

func (VoiceSpeakSentence) GetText

func (m VoiceSpeakSentence) GetText() string

type VoiceStartStream

type VoiceStartStream struct {
	// name: Friendly name given to the Stream
	// tracks: Track to be streamed to remote service
	// destination: URL of the remote service where the Stream is routed
	// stream_event_url: Stream Event URL
	// stream_event_method: Stream Event URL method
	// username: Stream Event URL username
	// password: Stream Event URL password
	// OptionalAttributes: additional attributes
	Name               string
	Tracks             string
	Destination        string
	StreamEventUrl     string
	StreamEventMethod  string
	Username           string
	Password           string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoiceStartStream <StartStream> BXML Noun https://dev.bandwidth.com/docs/voice/bxml/startStream

func (VoiceStartStream) GetAttr

func (m VoiceStartStream) GetAttr() (map[string]string, map[string]string)

func (VoiceStartStream) GetInnerElements

func (m VoiceStartStream) GetInnerElements() []Element

func (VoiceStartStream) GetName

func (m VoiceStartStream) GetName() string

func (VoiceStartStream) GetText

func (m VoiceStartStream) GetText() string

type VoiceStopStream

type VoiceStopStream struct {
	// name: Friendly name given to the Stream
	// OptionalAttributes: additional attributes
	Name               string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoiceStopStream <StopStream> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/stopStream

func (VoiceStopStream) GetAttr

func (m VoiceStopStream) GetAttr() (map[string]string, map[string]string)

func (VoiceStopStream) GetInnerElements

func (m VoiceStopStream) GetInnerElements() []Element

func (VoiceStopStream) GetName

func (m VoiceStopStream) GetName() string

func (VoiceStopStream) GetText

func (m VoiceStopStream) GetText() string

type VoiceStreamParam

type VoiceStreamParam struct {
	// name: The name of the custom parameter
	// value: The value of the custom parameter
	// OptionalAttributes: additional attributes
	Name               string
	Value              string
	InnerElements      []Element
	OptionalAttributes map[string]string
}

VoiceStreamParam <StreamParam> BXML Noun https://dev.bandwidth.com/docs/voice/bxml/startStream#nested-tags

func (VoiceStreamParam) GetAttr

func (m VoiceStreamParam) GetAttr() (map[string]string, map[string]string)

func (VoiceStreamParam) GetInnerElements

func (m VoiceStreamParam) GetInnerElements() []Element

func (VoiceStreamParam) GetName

func (m VoiceStreamParam) GetName() string

func (VoiceStreamParam) GetText

func (m VoiceStreamParam) GetText() string

type VoiceTransfer

type VoiceTransfer struct {
	// transfer_caller_id: The caller ID to use when the call is transferred, if different. Must be in E.164 format (e.g. +15555555555) or be one of the following strings Restricted, Anonymous, Private, or Unavailable.
	// transfer_caller_display_name: The caller display name to use when the call is transferred. May not exceed 256 characters nor contain control characters such as new lines.
	// call_timeout: The timeout (in seconds) for the callee to answer the call after it starts ringing.
	// transfer_complete_url: URL to send the Transfer Complete event to and request new BXML. Optional but recommended.
	// transfer_complete_method:  The HTTP method to use for the request to transferCompleteUrl. GET or POST. Default value is POST.
	// ... see docs above
	// OptionalAttributes: additional attributes
	TransferCallerId               string
	TransferCallerDisplayName      string
	CallTimeout                    string
	TransferCompleteUrl            string
	TransferCompleteMethod         string
	TransferCompleteFallbackUrl    string
	TransferCompleteFallbackMethod string
	Username                       string
	Password                       string
	FallbackUsername               string
	FallbackPassword               string
	Tag                            string
	DiversionTreatment             string
	DiversionReason                string
	InnerElements                  []Element
	OptionalAttributes             map[string]string
}

VoiceTransfer <Transfer> BXML Verb https://dev.bandwidth.com/docs/voice/bxml/transfer/

func (VoiceTransfer) GetAttr

func (m VoiceTransfer) GetAttr() (map[string]string, map[string]string)

func (VoiceTransfer) GetInnerElements

func (m VoiceTransfer) GetInnerElements() []Element

func (VoiceTransfer) GetName

func (m VoiceTransfer) GetName() string

func (VoiceTransfer) GetText

func (m VoiceTransfer) GetText() string

Jump to

Keyboard shortcuts

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