lib/adhearsion/translator/asterisk.rb in adhearsion-3.0.0.beta1 vs lib/adhearsion/translator/asterisk.rb in adhearsion-3.0.0.beta2
- old
+ new
@@ -68,10 +68,14 @@
def register_component(component)
@components[component.id] ||= component
end
+ def deregister_component(id)
+ @components.delete id
+ end
+
def component_with_id(component_id)
@components[component_id]
end
def handle_ami_event(event)
@@ -143,11 +147,11 @@
component.execute
when Adhearsion::Rayo::Command::Dial
if call = call_with_id(command.uri)
command.response = Adhearsion::ProtocolError.new.setup(:conflict, 'Call ID already in use')
else
- call = Call.new command.to, current_actor, ami_client, connection, nil, command.uri
+ call = Call.new command.to, self, ami_client, connection, nil, command.uri
register_call call
call.dial command
end
else
command.response = Adhearsion::ProtocolError.new.setup 'command-not-acceptable', "Did not understand command"
@@ -223,10 +227,10 @@
def handle_async_agi_start_event(event)
env = RubyAMI::AsyncAGIEnvironmentParser.new(event['Env']).to_hash
return if env[:agi_extension] == 'h' || env[:agi_type] == 'Kill'
- call = Call.new event['Channel'], current_actor, ami_client, connection, env
+ call = Call.new event['Channel'], self, ami_client, connection, env
register_call call
call.send_offer
end
end
end