Class: Bandwidth::CreateCallRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/bandwidth/voice_lib/voice/models/create_call_request.rb

Overview

CreateCallRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(from = nil, to = nil, answer_url = nil, application_id = nil, uui = nil, call_timeout = nil, callback_timeout = nil, answer_fallback_url = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, answer_method = nil, answer_fallback_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil) ⇒ CreateCallRequest

Returns a new instance of CreateCallRequest.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 145

def initialize(from = nil,
               to = nil,
               answer_url = nil,
               application_id = nil,
               uui = nil,
               call_timeout = nil,
               callback_timeout = nil,
               answer_fallback_url = nil,
               username = nil,
               password = nil,
               fallback_username = nil,
               fallback_password = nil,
               answer_method = nil,
               answer_fallback_method = nil,
               disconnect_url = nil,
               disconnect_method = nil,
               tag = nil)
  @from = from
  @to = to
  @uui = uui
  @call_timeout = call_timeout
  @callback_timeout = callback_timeout
  @answer_url = answer_url
  @answer_fallback_url = answer_fallback_url
  @username = username
  @password = password
  @fallback_username = fallback_username
  @fallback_password = fallback_password
  @answer_method = answer_method
  @answer_fallback_method = answer_fallback_method
  @disconnect_url = disconnect_url
  @disconnect_method = disconnect_method
  @tag = tag
  @application_id = application_id
end

Instance Attribute Details

#answer_fallback_methodAnswerFallbackMethodEnum

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.



92
93
94
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 92

def answer_fallback_method
  @answer_fallback_method
end

#answer_fallback_urlString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


50
51
52
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 50

def answer_fallback_url
  @answer_fallback_url
end

#answer_methodAnswerMethodEnum

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:



85
86
87
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 85

def answer_method
  @answer_method
end

#answer_urlString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


43
44
45
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 43

def answer_url
  @answer_url
end

#application_idString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


120
121
122
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 120

def application_id
  @application_id
end

#call_timeoutFloat

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (Float)


29
30
31
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 29

def call_timeout
  @call_timeout
end

#callback_timeoutFloat

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (Float)


36
37
38
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 36

def callback_timeout
  @callback_timeout
end

#disconnect_methodDisconnectMethodEnum

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.



106
107
108
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 106

def disconnect_method
  @disconnect_method
end

#disconnect_urlString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


99
100
101
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 99

def disconnect_url
  @disconnect_url
end

#fallback_passwordString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


78
79
80
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 78

def fallback_password
  @fallback_password
end

#fallback_usernameString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


71
72
73
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 71

def fallback_username
  @fallback_username
end

#fromString

Format is E164

Returns:

  • (String)


11
12
13
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 11

def from
  @from
end

#passwordString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


64
65
66
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 64

def password
  @password
end

#tagString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


113
114
115
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 113

def tag
  @tag
end

#toString

Format is E164 or SIP URI

Returns:

  • (String)


15
16
17
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 15

def to
  @to
end

#usernameString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


57
58
59
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 57

def username
  @username
end

#uuiString

When calling a SIP URI, this will be sent as the ‘User-To-User’ header within the initial INVITE. It must end with an ‘encoding’ parameter as described in tools.ietf.org/html/rfc7433. This header cannot exceed 256 characters, including the encoding parameter.

Returns:

  • (String)


22
23
24
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 22

def uui
  @uui
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 182

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  from = hash['from']
  to = hash['to']
  answer_url = hash['answerUrl']
  application_id = hash['applicationId']
  uui = hash['uui']
  call_timeout = hash['callTimeout']
  callback_timeout = hash['callbackTimeout']
  answer_fallback_url = hash['answerFallbackUrl']
  username = hash['username']
  password = hash['password']
  fallback_username = hash['fallbackUsername']
  fallback_password = hash['fallbackPassword']
  answer_method = hash['answerMethod']
  answer_fallback_method = hash['answerFallbackMethod']
  disconnect_url = hash['disconnectUrl']
  disconnect_method = hash['disconnectMethod']
  tag = hash['tag']

  # Create object from extracted values.
  CreateCallRequest.new(from,
                        to,
                        answer_url,
                        application_id,
                        uui,
                        call_timeout,
                        callback_timeout,
                        answer_fallback_url,
                        username,
                        password,
                        fallback_username,
                        fallback_password,
                        answer_method,
                        answer_fallback_method,
                        disconnect_url,
                        disconnect_method,
                        tag)
end

.namesObject

A mapping from model property names to API property names.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/bandwidth/voice_lib/voice/models/create_call_request.rb', line 123

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['from'] = 'from'
  @_hash['to'] = 'to'
  @_hash['uui'] = 'uui'
  @_hash['call_timeout'] = 'callTimeout'
  @_hash['callback_timeout'] = 'callbackTimeout'
  @_hash['answer_url'] = 'answerUrl'
  @_hash['answer_fallback_url'] = 'answerFallbackUrl'
  @_hash['username'] = 'username'
  @_hash['password'] = 'password'
  @_hash['fallback_username'] = 'fallbackUsername'
  @_hash['fallback_password'] = 'fallbackPassword'
  @_hash['answer_method'] = 'answerMethod'
  @_hash['answer_fallback_method'] = 'answerFallbackMethod'
  @_hash['disconnect_url'] = 'disconnectUrl'
  @_hash['disconnect_method'] = 'disconnectMethod'
  @_hash['tag'] = 'tag'
  @_hash['application_id'] = 'applicationId'
  @_hash
end