Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskContext::ReservationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, workspace_sid, task_sid, sid) ⇒ ReservationContext

Initialize the ReservationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • workspace_sid (String)

    The SID of the Workspace with the TaskReservation resources to update.

  • task_sid (String)

    The SID of the reserved Task resource with the TaskReservation resources to update.

  • sid (String)

    The SID of the TaskReservation resource to update.



180
181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 180

def initialize(version, workspace_sid, task_sid, sid)
    super(version)
    

    # Path Solution
    @solution = { workspace_sid: workspace_sid, task_sid: task_sid, sid: sid,  }
    @uri = "/Workspaces/#{@solution[:workspace_sid]}/Tasks/#{@solution[:task_sid]}/Reservations/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchReservationInstance

Fetch the ReservationInstance

Returns:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 193

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    ReservationInstance.new(
        @version,
        payload,
        workspace_sid: @solution[:workspace_sid],
        task_sid: @solution[:task_sid],
        sid: @solution[:sid],
    )
end

#fetch_with_metadataReservationInstance

Fetch the ReservationInstanceMetadata

Returns:



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 214

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    reservation_instance = ReservationInstance.new(
        @version,
        response.body,
        workspace_sid: @solution[:workspace_sid],
        task_sid: @solution[:task_sid],
        sid: @solution[:sid],
    )
    .new(
        @version,
        reservation_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



632
633
634
635
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 632

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Taskrouter.V1.ReservationContext #{context}>"
end

#to_sObject

Provide a user friendly representation



625
626
627
628
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 625

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Taskrouter.V1.ReservationContext #{context}>"
end

#update(reservation_status: :unset, worker_activity_sid: :unset, instruction: :unset, dequeue_post_work_activity_sid: :unset, dequeue_from: :unset, dequeue_record: :unset, dequeue_timeout: :unset, dequeue_to: :unset, dequeue_status_callback_url: :unset, call_from: :unset, call_record: :unset, call_timeout: :unset, call_to: :unset, call_url: :unset, call_status_callback_url: :unset, call_accept: :unset, redirect_call_sid: :unset, redirect_accept: :unset, redirect_url: :unset, to: :unset, from: :unset, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, conference_record: :unset, conference_trim: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, region: :unset, sip_auth_username: :unset, sip_auth_password: :unset, dequeue_status_callback_event: :unset, post_work_activity_sid: :unset, supervisor_mode: :unset, supervisor: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, jitter_buffer_size: :unset, if_match: :unset) ⇒ ReservationInstance

Update the ReservationInstance

Parameters:

  • reservation_status (Status) (defaults to: :unset)
  • worker_activity_sid (String) (defaults to: :unset)

    The new worker activity SID if rejecting a reservation.

  • instruction (String) (defaults to: :unset)

    The assignment instruction for reservation.

  • dequeue_post_work_activity_sid (String) (defaults to: :unset)

    The SID of the Activity resource to start after executing a Dequeue instruction.

  • dequeue_from (String) (defaults to: :unset)

    The Caller ID of the call to the worker when executing a Dequeue instruction.

  • dequeue_record (String) (defaults to: :unset)

    Whether to record both legs of a call when executing a Dequeue instruction or which leg to record.

  • dequeue_timeout (String) (defaults to: :unset)

    Timeout for call when executing a Dequeue instruction.

  • dequeue_to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • dequeue_status_callback_url (String) (defaults to: :unset)

    The Callback URL for completed call event when executing a Dequeue instruction.

  • call_from (String) (defaults to: :unset)

    The Caller ID of the outbound call when executing a Call instruction.

  • call_record (String) (defaults to: :unset)

    Whether to record both legs of a call when executing a Call instruction or which leg to record.

  • call_timeout (String) (defaults to: :unset)

    Timeout for call when executing a Call instruction.

  • call_to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • call_url (String) (defaults to: :unset)

    TwiML URI executed on answering the worker’s leg as a result of the Call instruction.

  • call_status_callback_url (String) (defaults to: :unset)

    The URL to call for the completed call event when executing a Call instruction.

  • call_accept (Boolean) (defaults to: :unset)

    Whether to accept a reservation when executing a Call instruction.

  • redirect_call_sid (String) (defaults to: :unset)

    The Call SID of the call parked in the queue when executing a Redirect instruction.

  • redirect_accept (Boolean) (defaults to: :unset)

    Whether the reservation should be accepted when executing a Redirect instruction.

  • redirect_url (String) (defaults to: :unset)

    TwiML URI to redirect the call to when executing the Redirect instruction.

  • to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • from (String) (defaults to: :unset)

    The Caller ID of the call to the worker when executing a Conference instruction.

  • status_callback (String) (defaults to: :unset)

    The URL we should call using the status_callback_method to send status information to your application.

  • status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call status_callback. Can be: POST or GET and the default is POST.

  • status_callback_event (Array[CallStatus]) (defaults to: :unset)

    The call progress events that we will send to status_callback. Can be: initiated, ringing, answered, or completed.

  • timeout (String) (defaults to: :unset)

    Timeout for call when executing a Conference instruction.

  • record (Boolean) (defaults to: :unset)

    Whether to record the participant and their conferences, including the time between conferences. The default is false.

  • muted (Boolean) (defaults to: :unset)

    Whether the agent is muted in the conference. The default is false.

  • beep (String) (defaults to: :unset)

    Whether to play a notification beep when the participant joins or when to play a beep. Can be: true, false, onEnter, or onExit. The default value is true.

  • start_conference_on_enter (Boolean) (defaults to: :unset)

    Whether to start the conference when the participant joins, if it has not already started. The default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

  • end_conference_on_exit (Boolean) (defaults to: :unset)

    Whether to end the conference when the agent leaves.

  • wait_url (String) (defaults to: :unset)

    The URL we should call using the wait_method for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](www.twilio.com/labs/twimlets/holdmusic).

  • wait_method (String) (defaults to: :unset)

    The HTTP method we should use to call wait_url. Can be GET or POST and the default is POST. When using a static audio file, this should be GET so that we can cache the file.

  • early_media (Boolean) (defaults to: :unset)

    Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is true.

  • max_participants (String) (defaults to: :unset)

    The maximum number of participants in the conference. Can be a positive integer from 2 to 250. The default value is 250.

  • conference_status_callback (String) (defaults to: :unset)

    The URL we should call using the conference_status_callback_method when the conference events in conference_status_callback_event occur. Only the value set by the first participant to join the conference is used. Subsequent conference_status_callback values are ignored.

  • conference_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call conference_status_callback. Can be: GET or POST and defaults to POST.

  • conference_status_callback_event (Array[ConferenceEvent]) (defaults to: :unset)

    The conference status events that we will send to conference_status_callback. Can be: start, end, join, leave, mute, hold, speaker.

  • conference_record (String) (defaults to: :unset)

    Whether to record the conference the participant is joining or when to record the conference. Can be: true, false, record-from-start, and do-not-record. The default value is false.

  • conference_trim (String) (defaults to: :unset)

    How to trim the leading and trailing silence from your recorded conference audio files. Can be: trim-silence or do-not-trim and defaults to trim-silence.

  • recording_channels (String) (defaults to: :unset)

    The recording channels for the final recording. Can be: mono or dual and the default is mono.

  • recording_status_callback (String) (defaults to: :unset)

    The URL that we should call using the recording_status_callback_method when the recording status changes.

  • recording_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use when we call recording_status_callback. Can be: GET or POST and defaults to POST.

  • conference_recording_status_callback (String) (defaults to: :unset)

    The URL we should call using the conference_recording_status_callback_method when the conference recording is available.

  • conference_recording_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call conference_recording_status_callback. Can be: GET or POST and defaults to POST.

  • region (String) (defaults to: :unset)

    The [region](support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:us1, us2, ie1, de1, sg1, br1, au1, or jp1.

  • sip_auth_username (String) (defaults to: :unset)

    The SIP username used for authentication.

  • sip_auth_password (String) (defaults to: :unset)

    The SIP password for authentication.

  • dequeue_status_callback_event (Array[String]) (defaults to: :unset)

    The Call progress events sent via webhooks as a result of a Dequeue instruction.

  • post_work_activity_sid (String) (defaults to: :unset)

    The new worker activity SID after executing a Conference instruction.

  • supervisor_mode (SupervisorMode) (defaults to: :unset)
  • supervisor (String) (defaults to: :unset)

    The Supervisor SID/URI when executing the Supervise instruction.

  • end_conference_on_customer_exit (Boolean) (defaults to: :unset)

    Whether to end the conference when the customer leaves.

  • beep_on_customer_entrance (Boolean) (defaults to: :unset)

    Whether to play a notification beep when the customer joins.

  • jitter_buffer_size (String) (defaults to: :unset)

    The jitter buffer size for conference. Can be: small, medium, large, off.

  • if_match (String) (defaults to: :unset)

    The If-Match HTTP request header

Returns:



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 296

def update(
    reservation_status: :unset, 
    worker_activity_sid: :unset, 
    instruction: :unset, 
    dequeue_post_work_activity_sid: :unset, 
    dequeue_from: :unset, 
    dequeue_record: :unset, 
    dequeue_timeout: :unset, 
    dequeue_to: :unset, 
    dequeue_status_callback_url: :unset, 
    call_from: :unset, 
    call_record: :unset, 
    call_timeout: :unset, 
    call_to: :unset, 
    call_url: :unset, 
    call_status_callback_url: :unset, 
    call_accept: :unset, 
    redirect_call_sid: :unset, 
    redirect_accept: :unset, 
    redirect_url: :unset, 
    to: :unset, 
    from: :unset, 
    status_callback: :unset, 
    status_callback_method: :unset, 
    status_callback_event: :unset, 
    timeout: :unset, 
    record: :unset, 
    muted: :unset, 
    beep: :unset, 
    start_conference_on_enter: :unset, 
    end_conference_on_exit: :unset, 
    wait_url: :unset, 
    wait_method: :unset, 
    early_media: :unset, 
    max_participants: :unset, 
    conference_status_callback: :unset, 
    conference_status_callback_method: :unset, 
    conference_status_callback_event: :unset, 
    conference_record: :unset, 
    conference_trim: :unset, 
    recording_channels: :unset, 
    recording_status_callback: :unset, 
    recording_status_callback_method: :unset, 
    conference_recording_status_callback: :unset, 
    conference_recording_status_callback_method: :unset, 
    region: :unset, 
    sip_auth_username: :unset, 
    sip_auth_password: :unset, 
    dequeue_status_callback_event: :unset, 
    post_work_activity_sid: :unset, 
    supervisor_mode: :unset, 
    supervisor: :unset, 
    end_conference_on_customer_exit: :unset, 
    beep_on_customer_entrance: :unset, 
    jitter_buffer_size: :unset, 
    if_match: :unset
)

    data = Twilio::Values.of({
        'ReservationStatus' => reservation_status,
        'WorkerActivitySid' => worker_activity_sid,
        'Instruction' => instruction,
        'DequeuePostWorkActivitySid' => dequeue_post_work_activity_sid,
        'DequeueFrom' => dequeue_from,
        'DequeueRecord' => dequeue_record,
        'DequeueTimeout' => dequeue_timeout,
        'DequeueTo' => dequeue_to,
        'DequeueStatusCallbackUrl' => dequeue_status_callback_url,
        'CallFrom' => call_from,
        'CallRecord' => call_record,
        'CallTimeout' => call_timeout,
        'CallTo' => call_to,
        'CallUrl' => call_url,
        'CallStatusCallbackUrl' => call_status_callback_url,
        'CallAccept' => call_accept,
        'RedirectCallSid' => redirect_call_sid,
        'RedirectAccept' => redirect_accept,
        'RedirectUrl' => redirect_url,
        'To' => to,
        'From' => from,
        'StatusCallback' => status_callback,
        'StatusCallbackMethod' => status_callback_method,
        'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
        'Timeout' => timeout,
        'Record' => record,
        'Muted' => muted,
        'Beep' => beep,
        'StartConferenceOnEnter' => start_conference_on_enter,
        'EndConferenceOnExit' => end_conference_on_exit,
        'WaitUrl' => wait_url,
        'WaitMethod' => wait_method,
        'EarlyMedia' => early_media,
        'MaxParticipants' => max_participants,
        'ConferenceStatusCallback' => conference_status_callback,
        'ConferenceStatusCallbackMethod' => conference_status_callback_method,
        'ConferenceStatusCallbackEvent' => Twilio.serialize_list(conference_status_callback_event) { |e| e },
        'ConferenceRecord' => conference_record,
        'ConferenceTrim' => conference_trim,
        'RecordingChannels' => recording_channels,
        'RecordingStatusCallback' => recording_status_callback,
        'RecordingStatusCallbackMethod' => recording_status_callback_method,
        'ConferenceRecordingStatusCallback' => conference_recording_status_callback,
        'ConferenceRecordingStatusCallbackMethod' => conference_recording_status_callback_method,
        'Region' => region,
        'SipAuthUsername' => sip_auth_username,
        'SipAuthPassword' => sip_auth_password,
        'DequeueStatusCallbackEvent' => Twilio.serialize_list(dequeue_status_callback_event) { |e| e },
        'PostWorkActivitySid' => post_work_activity_sid,
        'SupervisorMode' => supervisor_mode,
        'Supervisor' => supervisor,
        'EndConferenceOnCustomerExit' => end_conference_on_customer_exit,
        'BeepOnCustomerEntrance' => beep_on_customer_entrance,
        'JitterBufferSize' => jitter_buffer_size,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    ReservationInstance.new(
        @version,
        payload,
        workspace_sid: @solution[:workspace_sid],
        task_sid: @solution[:task_sid],
        sid: @solution[:sid],
    )
end

#update_with_metadata(reservation_status: :unset, worker_activity_sid: :unset, instruction: :unset, dequeue_post_work_activity_sid: :unset, dequeue_from: :unset, dequeue_record: :unset, dequeue_timeout: :unset, dequeue_to: :unset, dequeue_status_callback_url: :unset, call_from: :unset, call_record: :unset, call_timeout: :unset, call_to: :unset, call_url: :unset, call_status_callback_url: :unset, call_accept: :unset, redirect_call_sid: :unset, redirect_accept: :unset, redirect_url: :unset, to: :unset, from: :unset, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, conference_record: :unset, conference_trim: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, region: :unset, sip_auth_username: :unset, sip_auth_password: :unset, dequeue_status_callback_event: :unset, post_work_activity_sid: :unset, supervisor_mode: :unset, supervisor: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, jitter_buffer_size: :unset, if_match: :unset) ⇒ ReservationInstance

Update the ReservationInstanceMetadata

Parameters:

  • reservation_status (Status) (defaults to: :unset)
  • worker_activity_sid (String) (defaults to: :unset)

    The new worker activity SID if rejecting a reservation.

  • instruction (String) (defaults to: :unset)

    The assignment instruction for reservation.

  • dequeue_post_work_activity_sid (String) (defaults to: :unset)

    The SID of the Activity resource to start after executing a Dequeue instruction.

  • dequeue_from (String) (defaults to: :unset)

    The Caller ID of the call to the worker when executing a Dequeue instruction.

  • dequeue_record (String) (defaults to: :unset)

    Whether to record both legs of a call when executing a Dequeue instruction or which leg to record.

  • dequeue_timeout (String) (defaults to: :unset)

    Timeout for call when executing a Dequeue instruction.

  • dequeue_to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • dequeue_status_callback_url (String) (defaults to: :unset)

    The Callback URL for completed call event when executing a Dequeue instruction.

  • call_from (String) (defaults to: :unset)

    The Caller ID of the outbound call when executing a Call instruction.

  • call_record (String) (defaults to: :unset)

    Whether to record both legs of a call when executing a Call instruction or which leg to record.

  • call_timeout (String) (defaults to: :unset)

    Timeout for call when executing a Call instruction.

  • call_to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • call_url (String) (defaults to: :unset)

    TwiML URI executed on answering the worker’s leg as a result of the Call instruction.

  • call_status_callback_url (String) (defaults to: :unset)

    The URL to call for the completed call event when executing a Call instruction.

  • call_accept (Boolean) (defaults to: :unset)

    Whether to accept a reservation when executing a Call instruction.

  • redirect_call_sid (String) (defaults to: :unset)

    The Call SID of the call parked in the queue when executing a Redirect instruction.

  • redirect_accept (Boolean) (defaults to: :unset)

    Whether the reservation should be accepted when executing a Redirect instruction.

  • redirect_url (String) (defaults to: :unset)

    TwiML URI to redirect the call to when executing the Redirect instruction.

  • to (String) (defaults to: :unset)

    The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination.

  • from (String) (defaults to: :unset)

    The Caller ID of the call to the worker when executing a Conference instruction.

  • status_callback (String) (defaults to: :unset)

    The URL we should call using the status_callback_method to send status information to your application.

  • status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call status_callback. Can be: POST or GET and the default is POST.

  • status_callback_event (Array[CallStatus]) (defaults to: :unset)

    The call progress events that we will send to status_callback. Can be: initiated, ringing, answered, or completed.

  • timeout (String) (defaults to: :unset)

    Timeout for call when executing a Conference instruction.

  • record (Boolean) (defaults to: :unset)

    Whether to record the participant and their conferences, including the time between conferences. The default is false.

  • muted (Boolean) (defaults to: :unset)

    Whether the agent is muted in the conference. The default is false.

  • beep (String) (defaults to: :unset)

    Whether to play a notification beep when the participant joins or when to play a beep. Can be: true, false, onEnter, or onExit. The default value is true.

  • start_conference_on_enter (Boolean) (defaults to: :unset)

    Whether to start the conference when the participant joins, if it has not already started. The default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

  • end_conference_on_exit (Boolean) (defaults to: :unset)

    Whether to end the conference when the agent leaves.

  • wait_url (String) (defaults to: :unset)

    The URL we should call using the wait_method for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](www.twilio.com/labs/twimlets/holdmusic).

  • wait_method (String) (defaults to: :unset)

    The HTTP method we should use to call wait_url. Can be GET or POST and the default is POST. When using a static audio file, this should be GET so that we can cache the file.

  • early_media (Boolean) (defaults to: :unset)

    Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is true.

  • max_participants (String) (defaults to: :unset)

    The maximum number of participants in the conference. Can be a positive integer from 2 to 250. The default value is 250.

  • conference_status_callback (String) (defaults to: :unset)

    The URL we should call using the conference_status_callback_method when the conference events in conference_status_callback_event occur. Only the value set by the first participant to join the conference is used. Subsequent conference_status_callback values are ignored.

  • conference_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call conference_status_callback. Can be: GET or POST and defaults to POST.

  • conference_status_callback_event (Array[ConferenceEvent]) (defaults to: :unset)

    The conference status events that we will send to conference_status_callback. Can be: start, end, join, leave, mute, hold, speaker.

  • conference_record (String) (defaults to: :unset)

    Whether to record the conference the participant is joining or when to record the conference. Can be: true, false, record-from-start, and do-not-record. The default value is false.

  • conference_trim (String) (defaults to: :unset)

    How to trim the leading and trailing silence from your recorded conference audio files. Can be: trim-silence or do-not-trim and defaults to trim-silence.

  • recording_channels (String) (defaults to: :unset)

    The recording channels for the final recording. Can be: mono or dual and the default is mono.

  • recording_status_callback (String) (defaults to: :unset)

    The URL that we should call using the recording_status_callback_method when the recording status changes.

  • recording_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use when we call recording_status_callback. Can be: GET or POST and defaults to POST.

  • conference_recording_status_callback (String) (defaults to: :unset)

    The URL we should call using the conference_recording_status_callback_method when the conference recording is available.

  • conference_recording_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call conference_recording_status_callback. Can be: GET or POST and defaults to POST.

  • region (String) (defaults to: :unset)

    The [region](support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:us1, us2, ie1, de1, sg1, br1, au1, or jp1.

  • sip_auth_username (String) (defaults to: :unset)

    The SIP username used for authentication.

  • sip_auth_password (String) (defaults to: :unset)

    The SIP password for authentication.

  • dequeue_status_callback_event (Array[String]) (defaults to: :unset)

    The Call progress events sent via webhooks as a result of a Dequeue instruction.

  • post_work_activity_sid (String) (defaults to: :unset)

    The new worker activity SID after executing a Conference instruction.

  • supervisor_mode (SupervisorMode) (defaults to: :unset)
  • supervisor (String) (defaults to: :unset)

    The Supervisor SID/URI when executing the Supervise instruction.

  • end_conference_on_customer_exit (Boolean) (defaults to: :unset)

    Whether to end the conference when the customer leaves.

  • beep_on_customer_entrance (Boolean) (defaults to: :unset)

    Whether to play a notification beep when the customer joins.

  • jitter_buffer_size (String) (defaults to: :unset)

    The jitter buffer size for conference. Can be: small, medium, large, off.

  • if_match (String) (defaults to: :unset)

    The If-Match HTTP request header

Returns:



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb', line 485

def (
  reservation_status: :unset, 
  worker_activity_sid: :unset, 
  instruction: :unset, 
  dequeue_post_work_activity_sid: :unset, 
  dequeue_from: :unset, 
  dequeue_record: :unset, 
  dequeue_timeout: :unset, 
  dequeue_to: :unset, 
  dequeue_status_callback_url: :unset, 
  call_from: :unset, 
  call_record: :unset, 
  call_timeout: :unset, 
  call_to: :unset, 
  call_url: :unset, 
  call_status_callback_url: :unset, 
  call_accept: :unset, 
  redirect_call_sid: :unset, 
  redirect_accept: :unset, 
  redirect_url: :unset, 
  to: :unset, 
  from: :unset, 
  status_callback: :unset, 
  status_callback_method: :unset, 
  status_callback_event: :unset, 
  timeout: :unset, 
  record: :unset, 
  muted: :unset, 
  beep: :unset, 
  start_conference_on_enter: :unset, 
  end_conference_on_exit: :unset, 
  wait_url: :unset, 
  wait_method: :unset, 
  early_media: :unset, 
  max_participants: :unset, 
  conference_status_callback: :unset, 
  conference_status_callback_method: :unset, 
  conference_status_callback_event: :unset, 
  conference_record: :unset, 
  conference_trim: :unset, 
  recording_channels: :unset, 
  recording_status_callback: :unset, 
  recording_status_callback_method: :unset, 
  conference_recording_status_callback: :unset, 
  conference_recording_status_callback_method: :unset, 
  region: :unset, 
  sip_auth_username: :unset, 
  sip_auth_password: :unset, 
  dequeue_status_callback_event: :unset, 
  post_work_activity_sid: :unset, 
  supervisor_mode: :unset, 
  supervisor: :unset, 
  end_conference_on_customer_exit: :unset, 
  beep_on_customer_entrance: :unset, 
  jitter_buffer_size: :unset, 
  if_match: :unset
)

    data = Twilio::Values.of({
        'ReservationStatus' => reservation_status,
        'WorkerActivitySid' => worker_activity_sid,
        'Instruction' => instruction,
        'DequeuePostWorkActivitySid' => dequeue_post_work_activity_sid,
        'DequeueFrom' => dequeue_from,
        'DequeueRecord' => dequeue_record,
        'DequeueTimeout' => dequeue_timeout,
        'DequeueTo' => dequeue_to,
        'DequeueStatusCallbackUrl' => dequeue_status_callback_url,
        'CallFrom' => call_from,
        'CallRecord' => call_record,
        'CallTimeout' => call_timeout,
        'CallTo' => call_to,
        'CallUrl' => call_url,
        'CallStatusCallbackUrl' => call_status_callback_url,
        'CallAccept' => call_accept,
        'RedirectCallSid' => redirect_call_sid,
        'RedirectAccept' => redirect_accept,
        'RedirectUrl' => redirect_url,
        'To' => to,
        'From' => from,
        'StatusCallback' => status_callback,
        'StatusCallbackMethod' => status_callback_method,
        'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },
        'Timeout' => timeout,
        'Record' => record,
        'Muted' => muted,
        'Beep' => beep,
        'StartConferenceOnEnter' => start_conference_on_enter,
        'EndConferenceOnExit' => end_conference_on_exit,
        'WaitUrl' => wait_url,
        'WaitMethod' => wait_method,
        'EarlyMedia' => early_media,
        'MaxParticipants' => max_participants,
        'ConferenceStatusCallback' => conference_status_callback,
        'ConferenceStatusCallbackMethod' => conference_status_callback_method,
        'ConferenceStatusCallbackEvent' => Twilio.serialize_list(conference_status_callback_event) { |e| e },
        'ConferenceRecord' => conference_record,
        'ConferenceTrim' => conference_trim,
        'RecordingChannels' => recording_channels,
        'RecordingStatusCallback' => recording_status_callback,
        'RecordingStatusCallbackMethod' => recording_status_callback_method,
        'ConferenceRecordingStatusCallback' => conference_recording_status_callback,
        'ConferenceRecordingStatusCallbackMethod' => conference_recording_status_callback_method,
        'Region' => region,
        'SipAuthUsername' => sip_auth_username,
        'SipAuthPassword' => sip_auth_password,
        'DequeueStatusCallbackEvent' => Twilio.serialize_list(dequeue_status_callback_event) { |e| e },
        'PostWorkActivitySid' => post_work_activity_sid,
        'SupervisorMode' => supervisor_mode,
        'Supervisor' => supervisor,
        'EndConferenceOnCustomerExit' => end_conference_on_customer_exit,
        'BeepOnCustomerEntrance' => beep_on_customer_entrance,
        'JitterBufferSize' => jitter_buffer_size,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    reservation_instance = ReservationInstance.new(
        @version,
        response.body,
        workspace_sid: @solution[:workspace_sid],
        task_sid: @solution[:task_sid],
        sid: @solution[:sid],
    )
    .new(
        @version,
        reservation_instance,
        response.headers,
        response.status_code
    )
end