lib/matrioska/dial_with_apps.rb in matrioska-0.2.1 vs lib/matrioska/dial_with_apps.rb in matrioska-0.3.0

- old
+ new

@@ -36,18 +36,22 @@ def dial_with_apps(to, options = {}, &block) dial = Adhearsion::CallController::Dial::ParallelConfirmationDial.new to, options, call yield dial - local_runner = Matrioska::AppRunner.new call - @local_runner_block.call local_runner - local_runner.start + if @local_runner_block + local_runner = Matrioska::AppRunner.new call + @local_runner_block.call local_runner + local_runner.start + end dial.prep_calls do |new_call| new_call.on_joined call do - remote_runner = Matrioska::AppRunner.new new_call - @remote_runner_block.call remote_runner - remote_runner.start + if @remote_runner_block + remote_runner = Matrioska::AppRunner.new new_call + @remote_runner_block.call remote_runner + remote_runner.start + end end end dial.track_originating_call dial.place_calls