def join(target, options = {})
      logger.debug "Joining to #{target}"

      joined_condition = CountDownLatch.new(1)
      on_joined target do
        joined_condition.countdown!
      end

      unjoined_condition = CountDownLatch.new(1)
      on_unjoined target do
        unjoined_condition.countdown!
      end

      on_end do
        joined_condition.countdown!
        unjoined_condition.countdown!
      end

      command = Adhearsion::Rayo::Command::Join.new options.merge(join_options_with_target(target))
      write_and_await_response command
      {command: command, joined_condition: joined_condition, unjoined_condition: unjoined_condition}
    rescue Adhearsion::ProtocolError => e
      abort e
    end
def join(target, options = {})
      logger.debug "Joining to #{target}"

      joined_condition = CountDownLatch.new(1)
      on_joined target do
        joined_condition.countdown!
      end

      unjoined_condition = CountDownLatch.new(1)
      on_unjoined target do
        unjoined_condition.countdown!
      end

      on_end do
        joined_condition.countdown!
        unjoined_condition.countdown!
      end

      command = Adhearsion::Rayo::Command::Join.new options.merge(join_options_with_target(target))
      write_and_await_response command
      {command: command, joined_condition: joined_condition, unjoined_condition: unjoined_condition}
    rescue Adhearsion::ProtocolError => e
      abort e
    end
Joins this call to another call or a mixer

 @param [Call, String, Hash] target the target to join to. May be a Call object, a call ID (String, Hash) or a mixer name (Hash)
 @option target [String] call_uri The call ID to join to
 @option target [String] mixer_name The mixer to join to
 @param [Hash, Optional] options further options to be joined with

 @return [Hash] where :command is the issued command, :joined_waiter is a #wait responder which is triggered when the join is complete, and :unjoined_waiter is a #wait responder which is triggered when the entities are unjoined