lib/larynx/call_handler.rb in larynx-0.1.4 vs lib/larynx/call_handler.rb in larynx-0.1.5
- old
+ new
@@ -105,11 +105,11 @@
when @response.answered?
log 'Answered call'
finalize_command
@state = :ready
Larynx.fire_callback(:answer, self)
- send_next_command
+ send_next_command if @state == :ready
when @response.executing?
log "Executing: #{current_command.name}"
current_command.setup
@state = :executing
when @response.executed? && current_command
@@ -166,9 +166,10 @@
def cleanup
break! if @state == :executing
cancel_all_timers
clear_observers!
+ @session = nil
end
def log(msg)
LARYNX_LOGGER.info msg
end