Class: Adhearsion::CallController::Dial::JoinStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/adhearsion/call_controller/dial.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJoinStatus

Returns a new instance of JoinStatus.



484
485
486
# File 'lib/adhearsion/call_controller/dial.rb', line 484

def initialize
  @result = :no_answer
end

Instance Attribute Details

#end_timeObject

Time at which the join was broken



482
483
484
# File 'lib/adhearsion/call_controller/dial.rb', line 482

def end_time
  @end_time
end

#resultObject (readonly)

The result of the attempt to join calls Can be:

  • :joined - The calls were sucessfully joined

  • :no_answer - The attempt to dial the third-party was cancelled before they answered

  • :unconfirmed - The callee did not complete confirmation

  • :lost_confirmation - The callee completed confirmation, but was beaten by another

  • :error - The call ended with some error



495
496
497
# File 'lib/adhearsion/call_controller/dial.rb', line 495

def result
  @result
end

#start_timeObject

The time at which the calls were joined



479
480
481
# File 'lib/adhearsion/call_controller/dial.rb', line 479

def start_time
  @start_time
end

Instance Method Details

#durationObject

The duration for which the calls were joined. Does not include time spent in confirmation controllers or after being separated.



498
499
500
501
502
503
504
# File 'lib/adhearsion/call_controller/dial.rb', line 498

def duration
  if start_time && end_time
    end_time - start_time
  else
    0.0
  end
end

#endedObject



523
524
525
# File 'lib/adhearsion/call_controller/dial.rb', line 523

def ended
  @end_time = Time.now
end

#errored!Object



506
507
508
# File 'lib/adhearsion/call_controller/dial.rb', line 506

def errored!
  @result = :error
end

#lost_confirmation!Object



514
515
516
# File 'lib/adhearsion/call_controller/dial.rb', line 514

def lost_confirmation!
  @result = :lost_confirmation
end

#startedObject



518
519
520
521
# File 'lib/adhearsion/call_controller/dial.rb', line 518

def started
  @start_time = Time.now
  @result = :joined
end

#unconfirmed!Object



510
511
512
# File 'lib/adhearsion/call_controller/dial.rb', line 510

def unconfirmed!
  @result = :unconfirmed
end