lib/sippy_cup/media.rb in sippy_cup-0.3.0 vs lib/sippy_cup/media.rb in sippy_cup-0.4.0
- old
+ new
@@ -6,25 +6,27 @@
class Media
VALID_STEPS = %w{silence dtmf}.freeze
USEC = 1_000_000
MSEC = 1_000
attr_accessor :sequence
- attr_reader :packets
def initialize(from_addr, from_port, to_addr, to_port, generator = PCMUPayload)
@from_addr, @to_addr = IPAddr.new(from_addr), IPAddr.new(to_addr)
@from_port, @to_port, @generator = from_port, to_port, generator
reset!
end
def reset!
@sequence = []
- @packets = []
end
def <<(input)
get_step input # validation
@sequence << input
+ end
+
+ def empty?
+ @sequence.empty?
end
def compile!
sequence_number = 0
start_time = Time.now