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.



487
488
489
# File 'lib/adhearsion/call_controller/dial.rb', line 487

def initialize
  @result = :no_answer
end

Instance Attribute Details

#end_timeObject

Time at which the join was broken



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

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



498
499
500
# File 'lib/adhearsion/call_controller/dial.rb', line 498

def result
  @result
end

#start_timeObject

The time at which the calls were joined



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

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.



501
502
503
504
505
506
507
# File 'lib/adhearsion/call_controller/dial.rb', line 501

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

#ended(time) ⇒ Object



526
527
528
# File 'lib/adhearsion/call_controller/dial.rb', line 526

def ended(time)
  @end_time = time
end

#errored!Object



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

def errored!
  @result = :error
end

#lost_confirmation!Object



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

def lost_confirmation!
  @result = :lost_confirmation
end

#started(time) ⇒ Object



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

def started(time)
  @start_time = time
  @result = :joined
end

#unconfirmed!Object



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

def unconfirmed!
  @result = :unconfirmed
end