freeclimb 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +64 -41
  4. data/docs/AccountRequest.md +4 -4
  5. data/docs/AccountResult.md +12 -12
  6. data/docs/AccountResultAllOf.md +8 -8
  7. data/docs/AddToConference.md +35 -0
  8. data/docs/AddToConferenceAllOf.md +35 -0
  9. data/docs/ApplicationList.md +9 -9
  10. data/docs/ApplicationListAllOf.md +2 -2
  11. data/docs/ApplicationRequest.md +9 -9
  12. data/docs/ApplicationResult.md +14 -14
  13. data/docs/ApplicationResultAllOf.md +10 -10
  14. data/docs/AvailableNumber.md +7 -7
  15. data/docs/AvailableNumberList.md +9 -9
  16. data/docs/AvailableNumberListAllOf.md +2 -2
  17. data/docs/BuyIncomingNumberRequest.md +5 -5
  18. data/docs/CallList.md +9 -9
  19. data/docs/CallListAllOf.md +2 -2
  20. data/docs/CallResult.md +20 -20
  21. data/docs/CallResultAllOf.md +16 -16
  22. data/docs/ConferenceList.md +9 -9
  23. data/docs/ConferenceListAllOf.md +2 -2
  24. data/docs/ConferenceParticipantList.md +9 -9
  25. data/docs/ConferenceParticipantListAllOf.md +2 -2
  26. data/docs/ConferenceParticipantResult.md +11 -11
  27. data/docs/ConferenceParticipantResultAllOf.md +7 -7
  28. data/docs/ConferenceResult.md +15 -15
  29. data/docs/ConferenceResultAllOf.md +11 -11
  30. data/docs/CreateConference.md +27 -0
  31. data/docs/CreateConferenceAllOf.md +27 -0
  32. data/docs/CreateConferenceRequest.md +7 -7
  33. data/docs/Dequeue.md +16 -0
  34. data/docs/DequeueMemberRequest.md +2 -2
  35. data/docs/Enqueue.md +23 -0
  36. data/docs/EnqueueAllOf.md +23 -0
  37. data/docs/FilterLogsRequest.md +3 -3
  38. data/docs/GetDigits.md +31 -0
  39. data/docs/GetDigitsAllOf.md +31 -0
  40. data/docs/GetSpeech.md +41 -0
  41. data/docs/GetSpeechAllOf.md +41 -0
  42. data/docs/IncomingNumberList.md +9 -9
  43. data/docs/IncomingNumberListAllOf.md +2 -2
  44. data/docs/IncomingNumberRequest.md +4 -4
  45. data/docs/IncomingNumberResult.md +14 -14
  46. data/docs/IncomingNumberResultAllOf.md +10 -10
  47. data/docs/LogList.md +9 -9
  48. data/docs/LogListAllOf.md +2 -2
  49. data/docs/LogResult.md +8 -8
  50. data/docs/MakeCallRequest.md +10 -10
  51. data/docs/MessageRequest.md +11 -11
  52. data/docs/MessageRequestAllOf.md +7 -7
  53. data/docs/MessageResult.md +13 -13
  54. data/docs/MessageResultAllOf.md +9 -9
  55. data/docs/MessagesList.md +9 -9
  56. data/docs/MessagesListAllOf.md +2 -2
  57. data/docs/MutableResourceModel.md +5 -5
  58. data/docs/OutDial.md +33 -0
  59. data/docs/OutDialAllOf.md +33 -0
  60. data/docs/PaginationModel.md +8 -8
  61. data/docs/Pause.md +17 -0
  62. data/docs/PauseAllOf.md +17 -0
  63. data/docs/PerclCommand.md +17 -0
  64. data/docs/PerclScript.md +17 -0
  65. data/docs/Play.md +21 -0
  66. data/docs/PlayAllOf.md +21 -0
  67. data/docs/PlayEarlyMedia.md +17 -0
  68. data/docs/PlayEarlyMediaAllOf.md +17 -0
  69. data/docs/QueueList.md +9 -9
  70. data/docs/QueueListAllOf.md +2 -2
  71. data/docs/QueueMember.md +6 -6
  72. data/docs/QueueMemberList.md +9 -9
  73. data/docs/QueueMemberListAllOf.md +2 -2
  74. data/docs/QueueRequest.md +4 -4
  75. data/docs/QueueResult.md +12 -12
  76. data/docs/QueueResultAllOf.md +8 -8
  77. data/docs/RecordUtterance.md +27 -0
  78. data/docs/RecordUtteranceAllOf.md +27 -0
  79. data/docs/RecordingList.md +9 -9
  80. data/docs/RecordingListAllOf.md +2 -2
  81. data/docs/RecordingResult.md +10 -10
  82. data/docs/RecordingResultAllOf.md +6 -6
  83. data/docs/Redirect.md +17 -0
  84. data/docs/RedirectAllOf.md +17 -0
  85. data/docs/RemoveFromConference.md +17 -0
  86. data/docs/RemoveFromConferenceAllOf.md +17 -0
  87. data/docs/Say.md +25 -0
  88. data/docs/SayAllOf.md +25 -0
  89. data/docs/SendDigits.md +19 -0
  90. data/docs/SendDigitsAllOf.md +19 -0
  91. data/docs/SetListen.md +19 -0
  92. data/docs/SetListenAllOf.md +19 -0
  93. data/docs/SetTalk.md +19 -0
  94. data/docs/SetTalkAllOf.md +19 -0
  95. data/docs/Sms.md +23 -0
  96. data/docs/SmsAllOf.md +23 -0
  97. data/docs/StartRecordCall.md +16 -0
  98. data/docs/TerminateConference.md +17 -0
  99. data/docs/TerminateConferenceAllOf.md +17 -0
  100. data/docs/UpdateCallRequest.md +3 -3
  101. data/docs/UpdateConferenceParticipantRequest.md +4 -4
  102. data/docs/UpdateConferenceRequest.md +5 -5
  103. data/lib/freeclimb/api_client.rb +1 -1
  104. data/lib/freeclimb/models/add_to_conference.rb +320 -0
  105. data/lib/freeclimb/models/add_to_conference_all_of.rb +307 -0
  106. data/lib/freeclimb/models/create_conference.rb +275 -0
  107. data/lib/freeclimb/models/create_conference_all_of.rb +262 -0
  108. data/lib/freeclimb/models/dequeue.rb +209 -0
  109. data/lib/freeclimb/models/enqueue.rb +265 -0
  110. data/lib/freeclimb/models/enqueue_all_of.rb +252 -0
  111. data/lib/freeclimb/models/get_digits.rb +297 -0
  112. data/lib/freeclimb/models/get_digits_all_of.rb +284 -0
  113. data/lib/freeclimb/models/get_speech.rb +352 -0
  114. data/lib/freeclimb/models/get_speech_all_of.rb +339 -0
  115. data/lib/freeclimb/models/out_dial.rb +320 -0
  116. data/lib/freeclimb/models/out_dial_all_of.rb +307 -0
  117. data/lib/freeclimb/models/pause.rb +225 -0
  118. data/lib/freeclimb/models/pause_all_of.rb +212 -0
  119. data/lib/freeclimb/models/percl_command.rb +211 -0
  120. data/lib/freeclimb/models/percl_script.rb +210 -0
  121. data/lib/freeclimb/models/play.rb +245 -0
  122. data/lib/freeclimb/models/play_all_of.rb +232 -0
  123. data/lib/freeclimb/models/play_early_media.rb +225 -0
  124. data/lib/freeclimb/models/play_early_media_all_of.rb +212 -0
  125. data/lib/freeclimb/models/record_utterance.rb +275 -0
  126. data/lib/freeclimb/models/record_utterance_all_of.rb +262 -0
  127. data/lib/freeclimb/models/redirect.rb +220 -0
  128. data/lib/freeclimb/models/redirect_all_of.rb +207 -0
  129. data/lib/freeclimb/models/remove_from_conference.rb +225 -0
  130. data/lib/freeclimb/models/remove_from_conference_all_of.rb +212 -0
  131. data/lib/freeclimb/models/say.rb +265 -0
  132. data/lib/freeclimb/models/say_all_of.rb +252 -0
  133. data/lib/freeclimb/models/send_digits.rb +235 -0
  134. data/lib/freeclimb/models/send_digits_all_of.rb +222 -0
  135. data/lib/freeclimb/models/set_listen.rb +235 -0
  136. data/lib/freeclimb/models/set_listen_all_of.rb +222 -0
  137. data/lib/freeclimb/models/set_talk.rb +235 -0
  138. data/lib/freeclimb/models/set_talk_all_of.rb +222 -0
  139. data/lib/freeclimb/models/sms.rb +265 -0
  140. data/lib/freeclimb/models/sms_all_of.rb +252 -0
  141. data/lib/freeclimb/models/start_record_call.rb +209 -0
  142. data/lib/freeclimb/models/terminate_conference.rb +225 -0
  143. data/lib/freeclimb/models/terminate_conference_all_of.rb +212 -0
  144. data/lib/freeclimb/version.rb +1 -1
  145. data/lib/freeclimb.rb +69 -1
  146. data/spec/models/add_to_conference_spec.rb +95 -0
  147. data/spec/models/create_conference_spec.rb +71 -0
  148. data/spec/models/dequeue_spec.rb +35 -0
  149. data/spec/models/enqueue_spec.rb +59 -0
  150. data/spec/models/get_digits_spec.rb +83 -0
  151. data/spec/models/get_speech_spec.rb +113 -0
  152. data/spec/models/out_dial_spec.rb +89 -0
  153. data/spec/models/pause_spec.rb +41 -0
  154. data/spec/models/percl_command_spec.rb +41 -0
  155. data/spec/models/percl_script_spec.rb +41 -0
  156. data/spec/models/play_early_media_spec.rb +41 -0
  157. data/spec/models/play_spec.rb +53 -0
  158. data/spec/models/record_utterance_spec.rb +71 -0
  159. data/spec/models/redirect_spec.rb +41 -0
  160. data/spec/models/remove_from_conference_spec.rb +41 -0
  161. data/spec/models/say_spec.rb +65 -0
  162. data/spec/models/send_digits_spec.rb +47 -0
  163. data/spec/models/set_listen_spec.rb +47 -0
  164. data/spec/models/set_talk_spec.rb +47 -0
  165. data/spec/models/sms_spec.rb +59 -0
  166. data/spec/models/start_record_call_spec.rb +35 -0
  167. data/spec/models/terminate_conference_spec.rb +41 -0
  168. metadata +126 -30
  169. data/docs/Percl.md +0 -697
  170. data/lib/percl/calls.rb +0 -43
  171. data/lib/percl/conference_participants.rb +0 -40
  172. data/lib/percl/conferences.rb +0 -21
  173. data/lib/percl/ivr.rb +0 -63
  174. data/lib/percl/jsonable.rb +0 -23
  175. data/lib/percl/percl.rb +0 -29
  176. data/lib/percl/queue_members.rb +0 -15
  177. data/lib/percl/recordings.rb +0 -15
  178. data/lib/percl/sms.rb +0 -11
  179. data/spec/percl/calls_spec.rb +0 -111
  180. data/spec/percl/conference_participant_spec.rb +0 -96
  181. data/spec/percl/conference_spec.rb +0 -46
  182. data/spec/percl/ivr_spec.rb +0 -155
  183. data/spec/percl/jsonable_spec.rb +0 -28
  184. data/spec/percl/percl_spec.rb +0 -31
  185. data/spec/percl/queue_members_spec.rb +0 -35
  186. data/spec/percl/recordings_spec.rb +0 -32
  187. data/spec/percl/sms_spec.rb +0 -29
data/docs/Percl.md DELETED
@@ -1,697 +0,0 @@
1
- # Percl
2
-
3
- The Performance Command Language (PerCL) defines a set of instructions, written in JSON format, that express telephony actions to be performed in response to an event on the FreeClimb platform. FreeClimb communicates with the application server when events associated with the application occur, so the webserver can instruct FreeClimb how to handle such events using PerCL scripts.
4
-
5
- When creating a Percl object, required parameters must be used in the constructer while optional parameters must be set direclty on the given Percl object. Example:
6
- ```ruby
7
- digits = '630'
8
- send_digits = Percl::SendDigits.new(digits)
9
- send_digits.pauseMs = '500'
10
- ```
11
-
12
- ## Documentation for PerCL Responses
13
- Class | Description
14
- ------------ | -------------
15
- [*Percl::OutDial*](percl.md#percl::outdial) | The `OutDial` command is used to call a phone number
16
- [*Percl::Hangup*](percl.md#percl::hangup) | The `Hangup` command terminates a Call
17
- [*Percl::Pause*](percl.md#percl::pause) | The `Pause` command halts execution of the current PerCL script for a specified number of millisecond
18
- [*Percl::Redirect*](percl.md#percl::redirect) | The `Redirect` command transfers control of a Call to the PerCL at a different URL
19
- [*Percl::SendDigits*](percl.md#percl::senddigits) | The `SendDigits` command plays DTMF tones on a live Call. This is useful for navigating through IVR menus or dialing extensions
20
- [*Percl::Reject*](percl.md#percl::reject) | The `Reject` command blocks an incoming Call.
21
- [*Percl::CreateConference*](percl.md#percl::createConference) | The `CreateConference` command does exactly what its name implies — it creates an unpopulated Conference (one without any Participants).
22
- [*Percl::TerminateConference*](percl.md#percl::terminateConference) | The `TerminateConference` command terminates an existing Conference.
23
- [*Percl::AddToConference*](percl.md#percl::addToConference) | The `AddToConference` command adds a Participant to a Conference.
24
- [*Percl::RemoveFromConference*](percl.md#percl::removeFromConference) | The `RemoveFromConference` command removes a Participant from a Conference but does not hang up.
25
- [*Percl::SetListen*](percl.md#percl::setListen) | The `SetListen` command enables or disables the listen privilege for a Conference Participant provided both calls are in the same conference.
26
- [*Percl::SetTalk*](percl.md#percl::setTalk) | The `SetTalk` command enables or disables the talk privilege for a Participant in a Conference provided both calls are in the same conference.
27
- [*Percl::Enqueue*](percl.md#percl::enqueue) | The `Enqueue` command adds the current Call to a call Queue.
28
- [*Percl::Dequeue*](percl.md#percl::dequeue) | The `Dequeue` command transfers control of a Call that is in a Queue so that the waiting caller exits the Queue.
29
- [*Percl::RecordUtterance*](percl.md#percl::recordUtterance) | The `RecordUtterance` command records the caller's voice and returns the URL of a file containing the audio recording.
30
- [*Percl::StartRecordCall*](percl.md#percl::startRecordCall) | The `StartRecordCall` command records the current call and returns the URL of a file containing the audio recording when recording completes.
31
- [*Percl::PlayEarlyMedia*](percl.md#percl::playEarlyMedia) | The `PlayEarlyMedia` command plays A media file before attempting to connect a call
32
- [*Percl::Play*](percl.md#percl::play) | the `Play` command plays an audio file back to the caller.
33
- [*Percl::Say*](percl.md#percl::say) | The `Say` command provides Text-To-Speech (TTS) support. It converts text to speech and then renders it in a female voice back to the caller.
34
- [*Percl::GetDigits*](percl.md#percl::getDigits) | The `GetDigits` command collects DTMF inputs from the caller.
35
- [*Percl::GetSpeech*](percl.md#percl::getSpeech) | The `GetSpeech` command enables the Caller to respond to the application using a supported language.
36
- [*Percl::Sms*](percl.md#percl::Sms) | The `Sms` command can be used to send an SMS message to a phone number during a phone call.
37
-
38
-
39
-
40
- ## Percl::OutDial
41
-
42
- The OutDial command is used to call a phone number
43
-
44
- ### Example
45
-
46
- ```ruby
47
- # load the gems
48
- require 'sinatra'
49
- require 'freeclimb'
50
- require 'json'
51
-
52
- post '/voice' do
53
- out_dial = Percl::OutDial.new('MOCK_ACTION_URL', 'MOCK_CALL_CONNECT_URL', 'MOCK_CALLING_NUMBER', 'MOCK_DESTINATION')
54
- script = Percl::Script.new
55
- script.add(out_dial)
56
- script.to_json
57
- end
58
- ```
59
-
60
- ### Parameters
61
- Name | Type | Description | Notes
62
- ------------- | ------------- | ------------- | -------------
63
- **actionUrl** | **String**| URL to which FreeClimb sends an HTTP POST request.
64
- **callConnectUrl** | **String**| URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.
65
- **callingNumber** | **String** | The caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb.
66
- **destination** | **String** | E.164 representation of the phone number to Call.
67
- **ifMachine** | **String** | Specifies how FreeClimb should handle this OutDial if an answering machine answers the Call. Valid values: `redirect` invokes the ifMachineUrl for instructions. `hangup` hangs up the Call. The ifMachineUrl will not be invoked. | [optional]
68
- **ifMachineUrl** | **String** | When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included. | [required if `ifMachine` is set to `redirect`]
69
- **sendDigits** | **String** | DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension. | [optional]
70
- **statusCallBackUrl** | **String** | When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored. | [optional]
71
- **timeout** | **String** | Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`. | [optional]
72
-
73
-
74
- ## Percl::Hangup
75
-
76
- The Hangup command terminates a Call
77
-
78
- ### Example
79
-
80
- ```ruby
81
- # load the gems
82
- require 'sinatra'
83
- require 'freeclimb'
84
- require 'json'
85
-
86
- post '/voice' do
87
- hangup = Percl::Hangup.new
88
- script = Percl::Script.new
89
- script.add(out_dial)
90
- script.to_json
91
- end
92
- ```
93
-
94
- ### Parameters
95
- Name | Type | Description | Notes
96
- ------------- | ------------- | ------------- | -------------
97
- **callId** | **String** | The ID of the Call leg to hang up. If not specified, the Call leg corresponding to the current PerCL execution context hangs up. | [optional]
98
- **reason** | **String** | The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application. | [optional]
99
-
100
- ## Percl::Pause
101
-
102
- The `Pause` command halts execution of the current PerCL script for a specified number of milliseconds. If `Pause` is the first command in a PerCL document, FreeClimb will wait for the specified time to elapse before picking up the call.
103
-
104
- ### Example
105
-
106
- ```ruby
107
- # load the gems
108
- require 'sinatra'
109
- require 'freeclimb'
110
- require 'json'
111
-
112
- post '/voice' do
113
- pause = Percl::Pause.new(2000)
114
- script = Percl::Script.new
115
- script.add(out_dial)
116
- script.to_json
117
- end
118
- ```
119
-
120
- ### Parameters
121
- Name | Type | Description | Notes
122
- ------------- | ------------- | ------------- | -------------
123
- **length** | **Integer** | Length in milliseconds. FreeClimb will wait silently before continuing on.
124
-
125
-
126
- ## Percl::Redirect
127
-
128
- The `Redirect` command transfers control of a Call to the PerCL at a different URL. `Redirect` is a terminal command, so any actions following it are never executed.
129
-
130
- ### Example
131
-
132
- ```ruby
133
- # load the gems
134
- require 'sinatra'
135
- require 'freeclimb'
136
- require 'json'
137
-
138
- post '/voice' do
139
- redirect = Percl::Redirect.new('MOCK_REDIRECT_URL')
140
- script = Percl::Script.new
141
- script.add(redirect)
142
- script.to_json
143
- end
144
- ```
145
-
146
- ### Parameters
147
- Name | Type | Description | Notes
148
- ------------- | ------------- | ------------- | -------------
149
- **actionUrl** | **String** | URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent.
150
-
151
-
152
- ## Percl::SendDigits
153
-
154
- The `SendDigits` command plays DTMF tones on a live Call. This is useful for navigating through IVR menus or dialing extensions.
155
-
156
- ### Example
157
-
158
- ```ruby
159
- # load the gems
160
- require 'sinatra'
161
- require 'freeclimb'
162
- require 'json'
163
-
164
- post '/voice' do
165
- send = Percl::SendDigits.new('12367#')
166
- script = Percl::Script.new
167
- script.add(send)
168
- script.to_json
169
- end
170
- ```
171
-
172
- ### Parameters
173
-
174
- Name | Type | Description | Notes
175
- ------------- | ------------- | ------------- | -------------
176
- **digits** | **String** | String containing the digits to be played. The string cannot be empty and can include any digit, plus `#`, or `*`, and allows embedding specification for delay or pause between the output of individual digits.
177
- **pauseMs** | **Integer** | Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint. | [optional]
178
-
179
-
180
- ## Percl::Reject
181
-
182
- The `Reject` command blocks an incoming Call. Using `Reject` is the only way to prevent FreeClimb from answering a Call. Any other response will result in an answered Call and your account will be billed.
183
-
184
- ### Example
185
-
186
- ```ruby
187
- # load the gems
188
- require 'sinatra'
189
- require 'freeclimb'
190
- require 'json'
191
-
192
- post '/voice' do
193
- reject = Percl::Reject.new
194
- script = Percl::Script.new
195
- script.add(reject)
196
- script.to_json
197
- end
198
- ```
199
-
200
- ### Parameters
201
-
202
- Name | Type | Description | Notes
203
- ------------- | ------------- | ------------- | -------------
204
- **reason** | **String** | Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application. | [optional]
205
-
206
-
207
- ## Percl::CreateConference
208
-
209
- The `CreateConference` command does exactly what its name implies — it creates an unpopulated Conference (one without any Participants). Once created, a Conference remains in FreeClimb until explicitly terminated by a customer. Once a Conference has been terminated, it can no longer be used.
210
-
211
- ### Example
212
-
213
- ```ruby
214
- # load the gems
215
- require 'sinatra'
216
- require 'freeclimb'
217
- require 'json'
218
-
219
- post '/voice' do
220
- create_conference = Percl::CreateConference.new('MOCK_ACTION_URL')
221
- script = Percl::Script.new
222
- script.add(create_conference)
223
- script.to_json
224
- end
225
- ```
226
-
227
- ### Parameters
228
-
229
- Name | Type | Description | Notes
230
- ------------- | ------------- | ------------- | -------------
231
- **actionUrl** | **String** | This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response.
232
- **alias** | **String** | Descriptive name for the Conference. | [optional]
233
- **playBeep** | **String** | Indicates whether to play a beep when a Participant enters or leaves the Conference. either `always`, `never`, `entryOnly`, or `exitOnly`. Leaving this unset will make conference default to `always` | [optional]
234
- **record** | **String** | When set to `true`, the entire Conference is recorded. The `statusCallbackUrl` of the Conference will receive a `conferenceRecordingEnded` Webhook when the Conference transitions from the `inProgress` to empty state. | [optional]
235
- **waitUrl** | **String** | If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. | [optional]
236
- **statusCallbackUrl** | **String** | This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available. | [optional]
237
-
238
-
239
- ## Percl::TerminateConference
240
-
241
- The `TerminateConference` command terminates an existing Conference. Any active participants are hung up on by FreeClimb. If this is not the desired behavior, use the `RemoveFromConference` command to unbridge Calls that should not be hung up.
242
-
243
- Note: The Call requesting TerminateConference must be on the same Conference for this command to execute.
244
-
245
- ### Example
246
-
247
- ```ruby
248
- # load the gems
249
- require 'sinatra'
250
- require 'freeclimb'
251
- require 'json'
252
-
253
- post '/voice' do
254
- terminate = Percl::TerminateConference.new('MOCK_CONFERENCE_ID')
255
- script = Percl::Script.new
256
- script.add(terminate)
257
- script.to_json
258
- end
259
- ```
260
-
261
- ### Parameters
262
-
263
- Name | Type | Description | Notes
264
- ------------- | ------------- | ------------- | -------------
265
- **conferenceId** | **String** | ID of the conference to terminate.
266
-
267
-
268
- ## Percl::AddToConference
269
-
270
- The `AddToConference` command adds a Participant to a Conference. If this Participant currently is in another Conference, the Participant is first removed from that Conference. Two Call legs can be bridged together by creating a Conference and adding both Call legs to it via `AddToConference`.
271
-
272
- ### Example
273
-
274
- ```ruby
275
- # load the gems
276
- require 'sinatra'
277
- require 'freeclimb'
278
- require 'json'
279
-
280
- post '/voice' do
281
- # Assuming Conference is already created
282
- add = Percl::AddToConference.new('MOCK_CONF_ID', 'MOCK_CALL_ID')
283
- script = Percl::Script.new
284
- script.add(add)
285
- script.to_json
286
- end
287
- ```
288
-
289
- ### Parameters
290
-
291
- Name | Type | Description | Notes
292
- ------------- | ------------- | ------------- | -------------
293
- **conferenceId** | **String** | ID of the Conference to which to add the Participant (Call leg). Conference must exist or an error will result.
294
- **callId** | **String** | ID of the Call that will be added to the specified Conference. The Call must be in progress or an error will result. If the Call is part of an existing Conference, it is first removed from that Conference and is then moved to the new one.
295
- **startConfOnEnter** | **Boolean** | Flag that indicates whether a Conference starts upon entry of this particular Participant. This is usually set to `true` for moderators and `false` for all other Participants. | [optional]
296
- **talk** | **Boolean** | If `true`, the Participant joins the Conference with talk privileges. This may be modified later via the REST API or `SetTalk` PerCL command. | [optional]
297
- **listen** | **Boolean** | If `true`, the Participant joins the Conference with listen privileges. This may be modified later via the REST API or `SetListen` PerCL command. | [optional]
298
- **allowCallControl** | **Boolean** | If `true`, Call control will be enabled for this Participant's Call leg. | [optional]
299
- **callControlSequence** | **String** | Defines a sequence of digits that, when entered by this caller, invokes the `callControlUrl`. Only digits plus '*', and '#' may be used. | [`required` if allowCallControl is `true`]
300
- **callControlUrl** | **String** | URL to be invoked when this Participant enters the digit sequence defined in the `callControlSequence` attribute. | [`required` if allowCallControl is `true`]
301
- **leaveConferenceUrl** | **String** | URL to be invoked when the Participant leaves the Conference. | [optional]
302
- **notificationUrl** | **String** | When the Participant enters the Conference, this URL will be invoked using an HTTP POST request with the standard request parameters. | [optional]
303
-
304
-
305
- ## Percl::RemoveFromConference
306
-
307
- The `RemoveFromConference` command removes a Participant from a Conference but does not hang up. Instead, the Call is simply unbridged and what happens next with the Call is determined by the PerCL returned in response to the `leaveConferenceUrl` attribute.
308
-
309
- ### Example
310
-
311
- ```ruby
312
- # load the gems
313
- require 'sinatra'
314
- require 'freeclimb'
315
- require 'json'
316
-
317
- post '/voice' do
318
- # Assuming Conference is already created and participant is in conference
319
- remove = Percl::RemoveFromConference.new('MOCK_CALL_ID')
320
- script = Percl::Script.new
321
- script.add(remove)
322
- script.to_json
323
- end
324
- ```
325
-
326
- ### Parameters
327
- Name | Type | Description | Notes
328
- ------------- | ------------- | ------------- | -------------
329
- **callId** | **String** | ID of the Call leg to be removed from the Conference. The Call must be in a Conference or an error will be triggered.
330
-
331
-
332
-
333
- ## Percl::SetListen
334
-
335
- The `SetListen` command enables or disables the listen privilege for a Conference Participant provided both calls are in the same conference. The Participant can hear what the other participants are saying only if this privilege is enabled.
336
-
337
- ### Example
338
-
339
-
340
- ```ruby
341
- # load the gems
342
- require 'sinatra'
343
- require 'freeclimb'
344
- require 'json'
345
-
346
- post '/voice' do
347
- # Assuming Conference is already created and participant is in conference
348
- listen = Percl::SetListen.new('MOCK_CALL_ID')
349
- script = Percl::Script.new
350
- script.add(listen)
351
- script.to_json
352
- end
353
- ```
354
-
355
- ### Parameters
356
- Name | Type | Description | Notes
357
- ------------- | ------------- | ------------- | -------------
358
- **callId** | **String** | ID of the call leg that is to be assigned the listen privilege. The Call must be in a Conference or an error will be triggered.
359
- **listen** | **Boolean** | Specifying `false` will silence the Conference for this Participant. | [optional]
360
-
361
-
362
- ## Percl::SetTalk
363
-
364
- The `SetTalk` command enables or disables the talk privilege for a Participant in a Conference provided both calls are in the same conference. If 'true', no audio from that Participant is shared with the other Participants of the Conference.
365
-
366
- ### Example
367
-
368
- ```ruby
369
- # load the gems
370
- require 'sinatra'
371
- require 'freeclimb'
372
- require 'json'
373
-
374
- post '/voice' do
375
- # Assuming Conference is already created and participant is in conference
376
- talk = Percl::SetTalk.new('MOCK_CALL_ID')
377
- script = Percl::Script.new
378
- script.add(talk)
379
- script.to_json
380
- end
381
- ```
382
-
383
- ### Parameters
384
- Name | Type | Description | Notes
385
- ------------- | ------------- | ------------- | -------------
386
- **callId** | **String** | ID of the call leg that is to be muted or unmuted. The Call must be in a Conference or an error will be triggered.
387
- **talk** | **Boolean** | Specifying `false` mutes the Participant. | [optional]
388
-
389
- ## Percl::Enqueue
390
-
391
- The `Enqueue` command adds the current Call to a call Queue. If the specified Queue does not exist, it is created and then the Call is added to it. The default maximum length of the queue is 100. This can be modified using the REST API.
392
-
393
- ### Example
394
-
395
- ```ruby
396
- # load the gems
397
- require 'sinatra'
398
- require 'freeclimb'
399
- require 'json'
400
-
401
- post '/voice' do
402
- # Assuming Queue is already created
403
- enqueue = Percl::Enqueue.new('MOCK_QUEUE_ID', 'MOCK_WAIT_URL', 'MOCK_ACTION_URL')
404
- script = Percl::Script.new
405
- script.add(enqueue)
406
- script.to_json
407
- end
408
- ```
409
-
410
- ### Parameters
411
-
412
- Name | Type | Description | Notes
413
- ------------- | ------------- | ------------- | -------------
414
- **queueId** | **String** | ID of the Queue to which to add the Call. If the Queue does not exist, it will be created. The ID must start with QU followed by 40 hex characters.
415
- **waitUrl** | **String** | Specifies a URL pointing to a PerCL script containing actions to be executed while the caller is waiting in the Queue. Once the script returned by the `waitUrl` runs out of commands to execute, FreeClimb will re-request the `waitUrl` and start over, essentially looping the script indefinitely.
416
- **actionUrl** | **String** | A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up.
417
- **notificationUrl** | **String** | URL to be invoked when the call enters the queue. The request to the URL contains the standard request parameters.This is a notification only; any PerCL returned will be ignored. | [optional]
418
-
419
-
420
- ## Percl::Dequeue
421
-
422
- The `Dequeue` command transfers control of a Call that is in a Queue so that the waiting caller exits the Queue. Execution continues with the first command in the PerCL script returned by the `actionUrl` specified in the `Enqueue` command.
423
-
424
-
425
- ### Example
426
-
427
- ```ruby
428
- # load the gems
429
- require 'sinatra'
430
- require 'freeclimb'
431
- require 'json'
432
-
433
- post '/voice' do
434
- # Assuming call is in queue
435
- dequeue = Percl::Dequeue.new
436
- script = Percl::Script.new
437
- script.add(dequeue)
438
- script.to_json
439
- end
440
- ```
441
-
442
- ### Parameters
443
- none
444
-
445
-
446
- ## Percl::RecordUtterance
447
-
448
- The `RecordUtterance` command records the caller's voice and returns the URL of a file containing the audio recording.
449
-
450
- `RecordUtterance` is blocking and is a terminal command. As such, the `actionUrl` property is required, and control of the Call picks up using the PerCL returned in response to the `actionUrl`. Recording information is returned in the `actionUrl` request.
451
-
452
- ### Example
453
-
454
- ```ruby
455
- # load the gems
456
- require 'sinatra'
457
- require 'freeclimb'
458
- require 'json'
459
-
460
- post '/voice' do
461
- record = Percl::RecordUtterance.new('MOCK_ACTION_URL')
462
- script = Percl::Script.new
463
- script.add(record)
464
- script.to_json
465
- end
466
- ```
467
-
468
- ### Parameters
469
-
470
- Name | Type | Description | Notes
471
- ------------- | ------------- | ------------- | -------------
472
- **actionUrl** | **String** | URL to which information on the completed recording is submitted. The PerCL received in response is then used to continue with Call processing.
473
- **silenceTimeoutMs** | **Integer** | Interval of silence that should elapse before ending the recording. | [optional]
474
- **finishOnKey** | **String** | Key that triggers the end of the recording. any digit, '#', or '*' | [optional]
475
- **maxLengthSec** | **Integer** | Maximum length for the command execution in seconds. | [optional]
476
- **playBeep** | **Boolean** | Indicates whether to play a beep sound before the start of the recording. If set to `false`, no beep is played. | [optional]
477
- **autoStart** | **Boolean** | If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated. | [optional]
478
-
479
-
480
- ## Percl::StartRecordCall
481
-
482
- The `StartRecordCall` command records the current call and returns the URL of a file containing the audio recording when recording completes.
483
-
484
- `StartRecordCall` is non-blocking. After recording of the current call begins, control of the call moves to the PerCL command that follows `StartRecordCall` in the current PerCL script.
485
-
486
- ### Example
487
-
488
- ```ruby
489
- # load the gems
490
- require 'sinatra'
491
- require 'freeclimb'
492
- require 'json'
493
-
494
- post '/voice' do
495
- record = Percl::StartRecordCall.new
496
- script = Percl::Script.new
497
- script.add(record)
498
- script.to_json
499
- end
500
- ```
501
-
502
- ### Parameters
503
- none
504
-
505
-
506
- ## Percl::PlayEarlyMedia
507
-
508
- `PlayEarlyMedia` is relevant only when present as the very first command in the PerCL script returned for an incoming Call. In such cases, the command is executed before FreeClimb attempts to connect the call. The audio file it uses can be stored in any location that is accessible via URL.
509
-
510
- ### Example
511
-
512
- ```ruby
513
- # load the gems
514
- require 'sinatra'
515
- require 'freeclimb'
516
- require 'json'
517
-
518
- post '/voice' do
519
- media = Percl::PlayEarlyMedia.new('MOCK_FILE_URL')
520
- script = Percl::Script.new
521
- script.add(media)
522
- script.to_json
523
- end
524
- ```
525
-
526
- ### Parameters
527
- Name | Type | Description | Notes
528
- ------------- | ------------- | ------------- | -------------
529
- **file** | **String** | URL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands or any accessible URL. FreeClimb will respect Cache-Control headers for this file. Use these to limit repeated requests for unchanged audio. If no Cache-Control header is provided, the file will be cached for seven days by default.
530
-
531
-
532
- ## Percl::Play
533
-
534
- The `Play` command plays an audio file back to the caller. The audio file may be located at any location accessible via a URL. `Play` can exist as a stand-alone command or as a nested command. It does not allow barge-in unless nested within a `GetSpeech` command. The file will always be played to completion unless nested.
535
-
536
-
537
- ### Example
538
-
539
- ```ruby
540
- # load the gems
541
- require 'sinatra'
542
- require 'freeclimb'
543
- require 'json'
544
-
545
- post '/voice' do
546
- play = Percl::Play.new('MOCK_FILE_URL')
547
- script = Percl::Script.new
548
- script.add(play)
549
- script.to_json
550
- end
551
- ```
552
-
553
- ### Parameters
554
- Name | Type | Description | Notes
555
- ------------- | ------------- | ------------- | -------------
556
- **file** | **String** | URL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands.
557
- **loop** | **Integer** | Number of times the audio file is played. Specifying '0' causes the Play action to loop until the Call is hung up. | [optional]
558
- **conferenceId** | **String** | ID of the Conference the audio should be rendered to. If this is not specified, the audio is by default rendered to the caller associated with the call leg that corresponds to the current PerCL execution context. The call leg associated with this command must be in the specified Conference or the command will return an error. | [optional]
559
-
560
-
561
- ## Percl::Say
562
-
563
- The `Say` command provides Text-To-Speech (TTS) support. It converts text to speech and then renders it in a female voice back to the caller. `Say` is useful in cases where it's difficult to pre-record a prompt for any reason. `Say` does not allow barge-in unless nested within a `GetSpeech` command. The file will always be played to completion unless nested.
564
-
565
- When translating text to speech, the `Say` action will make assumptions about how to pronounce numbers, dates, times, amounts of money and other abbreviations.
566
-
567
- ### Example
568
-
569
- ```ruby
570
- # load the gems
571
- require 'sinatra'
572
- require 'freeclimb'
573
- require 'json'
574
-
575
- post '/voice' do
576
- say = Percl::Say.new('Hello, World!')
577
- script = Percl::Script.new
578
- script.add(say)
579
- script.to_json
580
- end
581
- ```
582
-
583
- ### Parameters
584
- Name | Type | Description | Notes
585
- ------------- | ------------- | ------------- | -------------
586
- **text** | **String** | The message to be played to the caller using TTS. The size of the string is limited to 4 KB (or 4,096 bytes). An empty string will cause the command to be skipped.
587
- **loop** | **Integer** | Number of times the text is said. Specifying '0' causes the `Say` action to loop until the Call is hung up. | [optional]
588
- **language** | **String** | Language and (by implication) the locale to use. This implies the accent and pronunciations to be usde for the TTS. The complete list of valid values for the language attribute is shown below. | [optional]
589
- **conferenceId** | **String** | ID of the Conference the speech should be rendered to. If this is not specified, the speech is by default rendered to the Caller associated with the call leg that corresponds to the current PerCL execution context. The call leg associated with this command must be in the specified Conference or the command will return an error. | [optional]
590
- **enforcePCI** | **Boolean** | Parameter `enforcePCI` will not log the 'text' as required by PCI compliance.
591
-
592
-
593
- ## Percl::GetDigits
594
-
595
- The `GetDigits` command collects DTMF inputs from the caller. It is only supported only when there is a single party on the Call.
596
-
597
- `GetDigits` is a Terminal Command — any actions following it are never executed. When the Caller is done entering the digits, FreeClimb submits that data to the provided `actionUrl` using an HTTP POST request. Your server will be required to respond to the FreeClimb Webhook with PerCL to continue handling the call.
598
-
599
- ### Example
600
-
601
- ```ruby
602
- # load the gems
603
- require 'sinatra'
604
- require 'freeclimb'
605
- require 'json'
606
-
607
- post '/voice' do
608
- digits = Percl::GetDigits.new('MOCK_ACTION_URL')
609
- script = Percl::Script.new
610
- script.add(digits)
611
- script.to_json
612
- end
613
- ```
614
-
615
- ### Parameters
616
- Name | Type | Description | Notes
617
- ------------- | ------------- | ------------- | -------------
618
- **actionUrl** | **String** | When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL.
619
- **initialTimeoutMs** | **Integer** | Maximum time in milliseconds that FreeClimb will wait for the Caller to press the first digit before making a determination that a `timeout` has occurred and moving on to make the request to the `actionUrl` to submit the results of the `GetDigits` command. This timeout interval begins when all nested commands have been fully executed. | [optional]
620
- **digitTimeoutMs** | **Integer** | Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered. | [optional]
621
- **finishOnKey** | **String** | Digit that causes the input sequence to be deemed complete. This attribute defers to the `timeout` attribute – so, if a `timeout` occurs, then the command terminates regardless of the value of `finishOnKey`. | [optional]
622
- **minDigits** | **Integer** | Minimum number of digits expected in the input. If specified, FreeClimb will return the collected digits only if the Caller has entered at least that many digits. | [optional]
623
- **maxDigits** | **Integer** | Maximum number of digits expected in the input. If the terminating digit is not entered and the caller has entered the maximum number of digits allowed, the `GetDigits` command terminates regardless of the value of `finishOnKey`. | [optional]
624
- **prompts** | **String** | JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller. | [optional]
625
- **enforcePCI** | **Boolean** | Parameter `enforcePCI` obscures the result as required by PCI compliance.
626
-
627
-
628
- ## Percl::GetSpeech
629
-
630
- The `GetSpeech` command enables the Caller to respond to the application using a supported language. Unlike DTMF entry, which implicitly restricts the user to using the available buttons on the phone key pad, speech input allows for flexible audio inputs based on grammar. FreeClimb supports grammars written using GRXML compatible with the Microsoft Speech Platform.
631
-
632
- `GetSpeech` is only supported on a single call leg. It is not supported when there are two or more call legs connected (as in within a Conference).
633
-
634
- ### Example
635
-
636
- ```ruby
637
- # load the gems
638
- require 'sinatra'
639
- require 'freeclimb'
640
- require 'json'
641
-
642
- post '/voice' do
643
- speech = Percl::GetSpeech.new('MOCK_ACTION_URL', 'MOCK_GRAMMAR_FILE')
644
- script = Percl::Script.new
645
- script.add(speech)
646
- script.to_json
647
- end
648
- ```
649
-
650
- ### Parameters
651
- Name | Type | Description | Notes
652
- ------------- | ------------- | ------------- | -------------
653
- **actionUrl** | **String** | When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call.
654
- **grammarFile** | **String** | The grammar file to use for speech recognition. If grammarType is set to URL, this attribute is specified as a download URL.
655
- **grammarType** | **String** | The grammar file type to use for speech recognition. A value of 'URL' indicates the grammarFile attribute specifies a URL that points to the grammar file. A value of 'BUILTIN' indicates the grammarFile attribute specifies the name of one of the platform built-in grammar files. | [optional]
656
- **grammarRule** | **String** | The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` is `URL` and ignored if `grammarType` is `BUILTIN`. | [optional if `grammarType` is `URL`]
657
- **playBeep** | **Boolean** | Indicates whether a beep should be played just before speech recognition is initiated so that the speaker can start to speak. | [optional]
658
- **prompts** | **Percl Commands Array** | The JSON array of PerCL commands to nest within the `GetSpeech` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the caller. This allows for playing menu options to the caller and to prompt for the expected input. These commands stop executing when the caller begins to input speech. | [optional]
659
- **noInputTimeoutMs** | **Integer** | When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. | [optional]
660
- **recognitionTimeoutMs** | **Integer** | When playback of prompts ends and there is no match for `recognitionTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. | [optional]
661
- **confidenceThreshold** | **Float** | When a recognition resource recognizes a spoken phrase, it associates a confidence level with that match. Parameter `confidenceThreshold` specifies what confidence level is considered a successful match. Values are between 0.0 and 1.0. | [optional]
662
- **sensitivityLevel** | **Float** | The speech recognizer supports a variable level of sound sensitivity. The sensitivityLevel attribute allows for filtering out background noise, so it is not mistaken for speech. Values are between 0.0 and 1.0 | [optional]
663
- **speechCompleteTimeoutMs** | **Integer** | Parameter `speechCompleteTimeoutMs` specifies the length of silence required following user speech before the speech recognizer finalizes a result. This timeout applies when the recognizer currently has a complete match against an active grammar. Reasonable speech complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds. | [optional]
664
- **speechIncompleteTimeoutMs** | **Integer** | Parameter `speechIncompleteTimeoutMs` specifies the length of silence following user speech after which a recognizer finalizes a result. This timeout applies when the speech prior to the silence is an incomplete match of all active grammars. Timeout `speechIncompleteTimeoutMs` is usually longer than `speechCompleteTimeoutMs` to allow users to pause mid-utterance. | [optional]
665
- **enforcePCI** | **Boolean** | Parameter enforcePCI will not log the 'text' as required by PCI compliance. | [optional]
666
-
667
-
668
- ## Percl::Sms
669
-
670
- The `Sms` command can be used to send an SMS message to a phone number during a phone call.
671
-
672
- International SMS is disabled by default.
673
-
674
- ### Example
675
-
676
- ```ruby
677
- # load the gems
678
- require 'sinatra'
679
- require 'freeclimb'
680
- require 'json'
681
-
682
- post '/voice' do
683
- sms = Percl::Sms.new('MOCK_TO_NUMBER', 'MOCK_FROM_NUMBER', 'MOCK_TEXT')
684
- script = Percl::Script.new
685
- script.add(sms)
686
- script.to_json
687
- end
688
- ```
689
-
690
- ### Parameters
691
-
692
- Name | Type | Description | Notes
693
- ------------- | ------------- | ------------- | -------------
694
- **to** | **String** | E.164 representation of the phone number to which the message will be sent. Must be within FreeClimb's service area and E.164 formatting (e.g., +18003608245).
695
- **from** | **String** | E.164 representation of the phone number to use as the sender. This must be an incoming phone number you have purchased from FreeClimb.
696
- **text** | **String** | Text contained in the message (maximum 160 characters).
697
- **notificationUrl** | **String** | When the message changes status, this URL will be invoked using HTTP POST with the messageStatus parameters. This is a notification only; any PerCL returned will be ignored.