Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/bandwidth-sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@
require 'bandwidth-sdk/models/bxml/nestable_verb'
require 'bandwidth-sdk/models/bxml/verbs/bridge'
require 'bandwidth-sdk/models/bxml/verbs/conference'
require 'bandwidth-sdk/models/bxml/verbs/connect'
require 'bandwidth-sdk/models/bxml/verbs/custom_param'
require 'bandwidth-sdk/models/bxml/verbs/endpoint'
require 'bandwidth-sdk/models/bxml/verbs/forward'
require 'bandwidth-sdk/models/bxml/verbs/gather'
require 'bandwidth-sdk/models/bxml/verbs/hangup'
Expand Down
23 changes: 23 additions & 0 deletions lib/bandwidth-sdk/models/bxml/verbs/connect.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Bandwidth
module Bxml
class Connect < Bandwidth::Bxml::NestableVerb
# Initializer
# @param endpoints [Verb] or [Array<Verb>] XML element children. Defaults to an empty array. Valid nested connect verbs are: Endpoint.
# @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
def initialize(endpoints = [], attributes = {})
super('Connect', nil, endpoints, attributes)

@attribute_map = {
event_callback_url: 'eventCallbackUrl', # Optional [String]: URL to send events to during the connection lifecycle. May be a relative URL. Defaults to None.
event_fallback_url: 'eventFallbackUrl', # Optional [String]: Fallback URL used by Bandwidth when delivery to event_callback_url fails. May be a relative URL.
}
end

# Add endpoint or endpoints to the nested verbs array
# @param endpoints [Endpoint] or [Array<Endpoint>] Verb or verbs to add to the array.
def add_endpoints(endpoints)
@nested_verbs.push(*endpoints)
end
end
end
end
11 changes: 11 additions & 0 deletions lib/bandwidth-sdk/models/bxml/verbs/endpoint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Bandwidth
module Bxml
class Endpoint < Bandwidth::Bxml::Verb
# Initializer
# @param endpoint_id [String] The ID of the endpoint to connect to.
def initialize(endpoint_id)
super('Endpoint', endpoint_id, {})
end
end
end
end
2 changes: 2 additions & 0 deletions lib/bandwidth-sdk/models/bxml/verbs/forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def initialize(attributes = {})
@attribute_map = {
to: 'to', # [String]: The phone number destination of the call.
from: 'from', # Optional [String]: The phone number that the recipient will receive the call from.
privacy: 'privacy', # Optional [Boolean]: Hide the calling number. The caller_display_name field can be used to customize the displayed name.
caller_display_name: 'callerDisplayName', # Optional [String]: The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If privacy is true, only the following values are valid: Restricted, Anonymous, Private, or Unavailable.
call_timeout: 'callTimeout', # Optional [Number]: The number of seconds to wait before timing out the call.
diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None.
diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None.
Expand Down
36 changes: 22 additions & 14 deletions lib/bandwidth-sdk/models/bxml/verbs/gather.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@ def initialize(audio_verbs = [], attributes = {})
super('Gather', nil, audio_verbs, attributes)

@attribute_map = {
gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL.
gather_method: 'gatherMethod', # Optional [String]: The HTTP method to use for the request to gather_url. GET or POST. Default value is POST.
gather_fallback_url: 'gatherFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Gather event callback delivery in case gather_url fails to respond.
gather_fallback_method: 'gatherFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST.
username: 'username', # Optional [String]: The username to send in the HTTP request to gather_url.
password: 'password', # Optional [String]: The password to send in the HTTP request to gather_url.
fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to gather_fallback_url.
fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to gather_fallback_url.
tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters.
terminating_digits: 'terminatingDigits', # Optional [String]: When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature.
max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested <SpeakSentence> or <PlayAudio> verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
repeat_count: 'repeatCount', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeatCount * number of verbs must not be greater than 20.
gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL.
gather_method: 'gatherMethod', # Optional [String]: The HTTP method to use for the request to gather_url. GET or POST. Default value is POST.
gather_fallback_url: 'gatherFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Gather event callback delivery in case gather_url fails to respond.
gather_fallback_method: 'gatherFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST.
username: 'username', # Optional [String]: The username to send in the HTTP request to gather_url.
password: 'password', # Optional [String]: The password to send in the HTTP request to gather_url.
fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to gather_fallback_url.
fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to gather_fallback_url.
tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters.
terminating_digits: 'terminatingDigits', # Optional [String]: When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature.
max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested <SpeakSentence> or <PlayAudio> verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
repeat_count: 'repeatCount', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeatCount * number of verbs must not be greater than 20.
input: 'input', # Optional [String]: Specifies the input mode for the Gather verb. Accepted values are dtmf, speech, or dtmf_speech. Default value is dtmf.
hints: 'hints', # Optional [String]: Words or phrases that help improve speech recognition, useful for phrases with many words. Possible and effective only if input is speech or dtmf_speech.
language: 'language', # Optional [String]: Language code for speech recognition. See the BXML documentation for the list of supported locales. Possible and effective only if input is speech or dtmf_speech.
partial_result_callback: 'partialResultCallback', # Optional [String]: URL to send Partial Result event to. May be a relative URL. Possible and effective only if input is speech or dtmf_speech.
partial_result_callback_method: 'partialResultCallbackMethod', # Optional [String]: The HTTP method to use for the request to partial_result_callback. GET or POST. Default value is POST.
profanity_filter: 'profanityFilter', # Optional [Boolean]: Enables or disables filtering of profane words. Default value is true. Possible and effective only if input is speech or dtmf_speech.
speech_model: 'speechModel', # Optional [String]: Specifies the speech recognition model to use: default, numbers_and_commands, phone_call, experimental_conversations, experimental_utterances, googlev2_long, googlev2_short, googlev2_telephony, or googlev2_telephony_short.
speech_timeout: 'speechTimeout', # Optional [Number]: Time (in seconds) to wait for speech input before timing out. Accepted values are any positive integer. Default value is 5.
}
end

Expand Down
2 changes: 2 additions & 0 deletions lib/bandwidth-sdk/models/bxml/verbs/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def initialize(attributes = {})
recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. Defaults to None.
transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None.
detect_language: 'detectLanguage', # Optional [Boolean]: A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. Ignored if transcribe is not set to true. Default is false.
transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
username: 'username', # Optional [String]: The username to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
Expand All @@ -25,6 +26,7 @@ def initialize(attributes = {})
max_duration: 'maxDuration', # Optional [Number]: Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None.
silence_timeout: 'silenceTimeout', # Optional [Number]: Length of silence after which to end the recording (in seconds). Max is equivalent to the maximum maxDuration value. Default value is 0, which means no timeout. Defaults to None.
file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None.
recording_name: 'recordingName', # Optional [String]: A name to identify this recording. It will be returned in the Recording Available or Conference Recording Available event if specified.
}
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def initialize(attributes = {})
recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST.
transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None.
detect_language: 'detectLanguage', # Optional [Boolean]: A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. Ignored if transcribe is not set to true. Default is false.
transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
username: 'username', # Optional [String]: The username to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
password: 'password', # Optional [String]: The password to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav.
multi_channel: 'multiChannel', # Optional [Boolean]: A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false.
recording_name: 'recordingName', # Optional [String]: A name to identify this recording. It will be returned in the Recording Available or Conference Recording Available event if specified.
}
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def initialize(stream_params = [], attributes = {})
mode: 'mode', # Optional [String]: The mode to use for the stream. unidirectional or bidirectional. Specifies whether the audio being streamed over the WebSocket is bidirectional (the service can both read and write audio over the WebSocket) or unidirectional (one-way, read-only). Default is unidirectional.
tracks: 'tracks', # Optional [String]: The part of the call to send a stream from. inbound, outbound or both. Default is inbound.
destination: 'destination', # Optional [String]: A websocket URI to send the stream to. The audio from the specified tracks will be sent via websocket to this URL as base64-encoded PCMU/G711 audio.
destination_username: 'destination_username', # Optional [String]: The username to send in the `Authorization` header of the initial websocket connection to the `destination` URL.
destination_password: 'destination_password', # Optional [String]: The password to send in the `Authorization` header of the initial websocket connection to the `destination` URL.
destination_username: 'destinationUsername', # Optional [String]: The username to send in the `Authorization` header of the initial websocket connection to the `destination` URL.
destination_password: 'destinationPassword', # Optional [String]: The password to send in the `Authorization` header of the initial websocket connection to the `destination` URL.
stream_event_url: 'streamEventUrl', # Optional [String]: URL to send the associated Webhook events to during this stream's lifetime. Does not accept BXML. May be a relative URL.
stream_event_method: 'streamEventMethod', # Optional [String]: The HTTP method to use for the request to streamEventUrl. GET or POST. Default value is POST.
username: 'username', # Optional [String]: The username to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
Expand Down
Loading