class Adhearsion::Calls::Supervisor

Public Class Methods

new(collection) click to toggle source
# File lib/adhearsion/calls.rb, line 86
def initialize(collection)
  @collection = collection
end

Public Instance Methods

call_died(call, reason) click to toggle source
# File lib/adhearsion/calls.rb, line 90
def call_died(call, reason)
  catching_standard_errors do
    call_id = @collection.key call
    @collection.remove_inactive_call call
    return unless reason
    Adhearsion::Events.trigger :exception, reason
    logger.error "Call #{call_id} terminated abnormally due to #{reason}. Forcing hangup."
    PunchblockPlugin.client.execute_command Punchblock::Command::Hangup.new, :async => true, :call_id => call_id
  end
end