Class: Plivo::Resources::MultiPartyCallInterface
- Inherits:
-
Base::ResourceInterface
- Object
- Base::ResourceInterface
- Plivo::Resources::MultiPartyCallInterface
- Defined in:
- lib/plivo/resources/multipartycalls.rb
Constant Summary
Constants included from Utils
Instance Method Summary collapse
- #add_participant(options = {}) ⇒ Object
- #get(options = {}) ⇒ Object
- #get_participant(options = {}) ⇒ Object
-
#initialize(client, resource_list_json = nil) ⇒ MultiPartyCallInterface
constructor
A new instance of MultiPartyCallInterface.
- #kick_participant(options = {}) ⇒ Object
- #list(options = {}) ⇒ Object
- #list_participants(options = {}) ⇒ Object
- #make_mpc_id(uuid = nil, friendly_name = nil) ⇒ Object
- #pause_participant_recording(options = {}) ⇒ Object
- #pause_recording(options = {}) ⇒ Object
- #resume_participant_recording(options = {}) ⇒ Object
- #resume_recording(options = {}) ⇒ Object
- #start(options = {}) ⇒ Object
- #start_participant_recording(options = {}) ⇒ Object
- #start_play_audio(options = {}) ⇒ Object
- #start_recording(options = {}) ⇒ Object
- #stop(options = {}) ⇒ Object
- #stop_participant_recording(options = {}) ⇒ Object
- #stop_play_audio(options = {}) ⇒ Object
- #stop_recording(options = {}) ⇒ Object
- #update_participant(options = {}) ⇒ Object
Methods included from Utils
GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, is_one_among_string_url?, multi_valid_param?, raise_invalid_request, valid_account?, valid_date_format?, valid_mainaccount?, valid_multiple_destination_integers?, valid_multiple_destination_nos?, valid_param?, valid_range?, valid_signature?, valid_signatureV3?, valid_subaccount?, valid_url?
Constructor Details
#initialize(client, resource_list_json = nil) ⇒ MultiPartyCallInterface
Returns a new instance of MultiPartyCallInterface.
370 371 372 373 374 375 376 |
# File 'lib/plivo/resources/multipartycalls.rb', line 370 def initialize(client, resource_list_json = nil) @_name = 'MultiPartyCall' @_resource_type = MultiPartyCall @_identifier_string = 'mpc_uuid' super @_is_voice_request = true end |
Instance Method Details
#add_participant(options = {}) ⇒ Object
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/plivo/resources/multipartycalls.rb', line 420 def add_participant( = {}) valid_param?(:options, , Hash, false) if not [:role ] raise_invalid_request("Role is mandatory") end [:call_status_callback_method] = 'POST' unless .key?(:call_status_callback_method) [:confirm_key_sound_method] = 'GET' unless .key?(:confirm_key_sound_method) [:dial_music] = 'Real' unless .key?(:dial_music) [:ring_timeout] = 45 unless .key?(:ring_timeout) [:delay_dial] = 0 unless .key?(:delay_dial) [:max_duration] = 14400 unless .key?(:max_duration) [:max_participants] = 10 unless .key?(:max_participants) [:record_min_member_count] = 1 unless .key?(:record_min_member_count) [:wait_music_method] = 'GET' unless .key?(:wait_music_method) [:agent_hold_music_method] = 'GET' unless .key?(:agent_hold_music_method) [:customer_hold_music_method] = 'GET' unless .key?(:customer_hold_music_method) [:recording_callback_method] ='GET' unless .key?(:recording_callback_method) [:status_callback_method] = 'GET' unless .key?(:status_callback_method) [:on_exit_action_method] = 'POST' unless .key?(:on_exit_action_method) [:record] = false unless .key?(:record) [:record_file_format] = 'mp3' unless .key?(:record_file_format) [:status_callback_events] = 'mpc-state-changes,participant-state-changes' unless .key?(:status_callback_events) [:stay_alone] = false unless .key?(:stay_alone) [:coach_mode] = true unless .key?(:coach_mode) [:mute] = false unless .key?(:mute) [:hold] = false unless .key?(:hold) [:start_mpc_on_enter] = true unless .key?(:start_mpc_on_enter) [:end_mpc_on_exit] = false unless .key?(:end_mpc_on_exit) [:relay_dtmf_inputs] = false unless .key?(:relay_dtmf_inputs) [:enter_sound] = 'beep:1' unless .key?(:enter_sound) [:enter_sound_method] = 'GET' unless .key?(:enter_sound_method) [:exit_sound] = 'beep:2' unless .key?(:exit_sound) [:exit_sound_method] = 'GET' unless .key?(:exit_sound_method) [:start_recording_audio_method] = 'GET' unless .key?(:start_recording_audio_method) [:stop_recording_audio_method] = 'GET' unless .key?(:stop_recording_audio_method) valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).add_participant([:role],[:from],[:to],[:call_uuid],[:caller_name],[:call_status_callback_url],[:call_status_callback_method],[:sip_headers],[:confirm_key], [:confirm_key_sound_url],[:confirm_key_sound_method],[:dial_music],[:ring_timeout],[:delay_dial],[:max_duration], [:max_participants],[:record_min_member_count],[:wait_music_url], [:wait_music_method],[:agent_hold_music_url],[:agent_hold_music_method],[:customer_hold_music_url],[:customer_hold_music_method], [:recording_callback_url],[:recording_callback_method],[:status_callback_url],[:status_callback_method],[:on_exit_action_url], [:on_exit_action_method], [:record],[:record_file_format],[:status_callback_events],[:stay_alone], [:coach_mode],[:mute],[:hold],[:start_mpc_on_enter],[:end_mpc_on_exit], [:relay_dtmf_inputs],[:enter_sound],[:enter_sound_method],[:exit_sound],[:exit_sound_method], [:start_recording_audio], [:start_recording_audio_method], [:stop_recording_audio], [:stop_recording_audio_method]) end |
#get(options = {}) ⇒ Object
412 413 414 415 416 417 418 |
# File 'lib/plivo/resources/multipartycalls.rb', line 412 def get( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).get end |
#get_participant(options = {}) ⇒ Object
600 601 602 603 604 605 606 607 608 609 610 |
# File 'lib/plivo/resources/multipartycalls.rb', line 600 def get_participant( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).get_participant end |
#kick_participant(options = {}) ⇒ Object
588 589 590 591 592 593 594 595 596 597 598 |
# File 'lib/plivo/resources/multipartycalls.rb', line 588 def kick_participant( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).kick_participant end |
#list(options = {}) ⇒ Object
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/plivo/resources/multipartycalls.rb', line 393 def list(={}) valid_param?(:options, , Hash, false) valid_subaccount?([:sub_account], true) unless [:sub_account].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? valid_param?(:status, [:status].downcase, String, false, %w[initialized active ended]) unless [:status].nil? valid_param?(:termination_cause_code, [:termination_cause_code], Integer, false) unless [:termination_cause_code].nil? valid_date_format?(:end_time__gt, [:end_time__gt], false ) unless [:end_time__gt].nil? valid_date_format?(:end_time__gte, [:end_time__gte], false ) unless [:end_time__gte].nil? valid_date_format?(:end_time__lt, [:end_time__lt], String) unless [:end_time__lt].nil? valid_date_format?(:end_time__lte, [:end_time__lte], false) unless [:end_time__lte].nil? valid_date_format?(:creation_time__gt, [:creation_time__gt], false) unless [:creation_time__gt].nil? valid_date_format?(:creation_time__gte, [:creation_time__gte], false) unless [:creation_time__gte].nil? valid_date_format?(:creation_time__lt, [:creation_time__lt], false) unless [:creation_time__lt].nil? valid_date_format?(:creation_time__lte, [:creation_time__lte], false) unless [:creation_time__lte].nil? valid_range?(:limit, [:limit], false, 1, 20) valid_range?(:offset, [:offset], false, 0) perform_action(nil ,'GET', ,true ) end |
#list_participants(options = {}) ⇒ Object
568 569 570 571 572 573 574 |
# File 'lib/plivo/resources/multipartycalls.rb', line 568 def list_participants( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).list_participants([:call_uuid]) end |
#make_mpc_id(uuid = nil, friendly_name = nil) ⇒ Object
378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/plivo/resources/multipartycalls.rb', line 378 def make_mpc_id(uuid=nil, friendly_name=nil) if not uuid and not friendly_name raise_invalid_request('specify either multi party call friendly name or uuid') end if uuid and friendly_name raise_invalid_request('cannot specify both multi party call friendly name or uuid') end if uuid identifier = ['uuid', uuid] else identifier = ['name', friendly_name] end return identifier end |
#pause_participant_recording(options = {}) ⇒ Object
544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/plivo/resources/multipartycalls.rb', line 544 def pause_participant_recording( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).pause_participant_recording end |
#pause_recording(options = {}) ⇒ Object
502 503 504 505 506 507 508 |
# File 'lib/plivo/resources/multipartycalls.rb', line 502 def pause_recording( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).pause_recording end |
#resume_participant_recording(options = {}) ⇒ Object
556 557 558 559 560 561 562 563 564 565 566 |
# File 'lib/plivo/resources/multipartycalls.rb', line 556 def resume_participant_recording( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).resume_participant_recording end |
#resume_recording(options = {}) ⇒ Object
510 511 512 513 514 515 516 |
# File 'lib/plivo/resources/multipartycalls.rb', line 510 def resume_recording( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).resume_recording end |
#start(options = {}) ⇒ Object
468 469 470 471 472 473 474 |
# File 'lib/plivo/resources/multipartycalls.rb', line 468 def start( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) valid_param?(:friendly_name, [:friendly_name], String, false) mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client,resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).start end |
#start_participant_recording(options = {}) ⇒ Object
518 519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/plivo/resources/multipartycalls.rb', line 518 def start_participant_recording( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end [:file_format] = 'mp3' unless .key?(:file_format) [:recording_callback_method] = 'POST' unless .key?(:recording_callback_method) valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).start_participant_recording([:file_format], [:recording_callback_url], [:recording_callback_method]) end |
#start_play_audio(options = {}) ⇒ Object
612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/plivo/resources/multipartycalls.rb', line 612 def start_play_audio( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallMember.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).start_play_audio([:url]) end |
#start_recording(options = {}) ⇒ Object
484 485 486 487 488 489 490 491 492 |
# File 'lib/plivo/resources/multipartycalls.rb', line 484 def start_recording( = {}) valid_param?(:options, , Hash, false) [:file_format] = 'mp3' unless .key?(:file_format) [:recording_callback_method] = 'POST' unless .key?(:recording_callback_method) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).start_recording([:file_format], [:recording_callback_url], [:recording_callback_method]) end |
#stop(options = {}) ⇒ Object
476 477 478 479 480 481 482 |
# File 'lib/plivo/resources/multipartycalls.rb', line 476 def stop( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).stop end |
#stop_participant_recording(options = {}) ⇒ Object
532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/plivo/resources/multipartycalls.rb', line 532 def stop_participant_recording( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).stop_participant_recording end |
#stop_play_audio(options = {}) ⇒ Object
624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/plivo/resources/multipartycalls.rb', line 624 def stop_play_audio( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallMember.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).stop_play_audio end |
#stop_recording(options = {}) ⇒ Object
494 495 496 497 498 499 500 |
# File 'lib/plivo/resources/multipartycalls.rb', line 494 def stop_recording( = {}) valid_param?(:options, , Hash, false) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = make_mpc_id([:uuid], [:friendly_name]) MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).stop_recording end |
#update_participant(options = {}) ⇒ Object
576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/plivo/resources/multipartycalls.rb', line 576 def update_participant( = {}) valid_param?(:options, , Hash, false) if not [:member_id] raise_invalid_request("Member Id is mandatory") end valid_param?(:member_id, [:member_id], [String, Integer], true) valid_param?(:uuid, [:uuid], String, false) unless [:uuid].nil? valid_param?(:friendly_name, [:friendly_name], String, false) unless [:friendly_name].nil? mpc_id = self.make_mpc_id([:uuid], [:friendly_name]) MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: [:member_id]).update_participant([:coach_mode], [:mute], [:hold]) end |