lib/punchblock/component/tropo/conference.rb in punchblock-0.4.0 vs lib/punchblock/component/tropo/conference.rb in punchblock-0.4.1

- old
+ new

@@ -147,16 +147,18 @@ def inspect_attributes # :nodoc: [:name, :mute, :terminator, :tone_passthrough, :moderator, :announcement, :music] + super end - def transition_state!(event) - super - case event - when OnHold + def register_initial_handlers + register_event_handler OnHold do |event| onhold! - when OffHold + throw :pass + end + + register_event_handler OffHold do |event| offhold! + throw :pass end end state_machine :state do after_transition :new => :requested do |command, transition|