lib/punchblock/translator/freeswitch.rb in punchblock-2.0.0.beta1 vs lib/punchblock/translator/freeswitch.rb in punchblock-2.0.0.beta2

- old
+ new

@@ -16,18 +16,18 @@ extend ActiveSupport::Autoload autoload :Call autoload :Component - attr_reader :connection, :media_engine, :default_voice, :calls + attr_reader :connection, :calls trap_exit :actor_died finalizer :finalize - def initialize(connection, media_engine = nil, default_voice = nil) - @connection, @media_engine, @default_voice = connection, media_engine, default_voice + def initialize(connection) + @connection = connection @calls, @components = {}, {} setup_handlers end def register_call(call) @@ -60,11 +60,11 @@ throw :halt end register_handler :es, :event_name => 'CHANNEL_PARK' do |event| throw :pass if es_event_known_call? event - call = Call.new event[:unique_id], current_actor, event.content.select { |k,v| k.to_s =~ /variable/ }, stream, @media_engine, @default_voice + call = Call.new event[:unique_id], current_actor, event.content.select { |k,v| k.to_s =~ /variable/ }, stream link call register_call call call.async.send_offer end @@ -133,10 +133,10 @@ end def execute_global_command(command) case command when Punchblock::Command::Dial - call = Call.new_link Punchblock.new_uuid, current_actor, nil, stream, @media_engine, @default_voice + call = Call.new_link Punchblock.new_uuid, current_actor, nil, stream register_call call call.async.dial command else command.response = ProtocolError.new.setup 'command-not-acceptable', "Did not understand command" end