lib/adhearsion/call_controller.rb in adhearsion-2.0.1 vs lib/adhearsion/call_controller.rb in adhearsion-2.1.0
- old
+ new
@@ -137,12 +137,13 @@
#
# @param [Hash] headers
#
def hangup(headers = nil)
block_until_resumed
- hangup_response = call.hangup headers
- after_call unless hangup_response == false
+ call.hangup headers
+ after_call
+ raise Call::Hangup
end
# @private
def write_and_await_response(command)
block_until_resumed
@@ -218,9 +219,11 @@
call.wait_for_joined waiter
else
call.wait_for_unjoined waiter
end
end
+
+ alias :safely :catching_standard_errors
# @private
def block_until_resumed
instance_variable_defined?(:@pause_latch) && @pause_latch.wait
end