lib/adhearsion/translator/asterisk.rb in adhearsion-3.0.0.beta2 vs lib/adhearsion/translator/asterisk.rb in adhearsion-3.0.0.rc1
- old
+ new
@@ -122,10 +122,12 @@
def execute_call_command(command)
if call = call_with_id(command.target_call_id)
begin
call.execute_command command
rescue => e
+ Adhearsion::Events.trigger :exception, [e, logger]
deregister_call call.id, call.channel
+ command.response = Adhearsion::ProtocolError.new.setup :error, "Unknown error executing command on call #{command.target_call_id}", command.target_call_id
end
else
command.response = Adhearsion::ProtocolError.new.setup :item_not_found, "Could not find a call with ID #{command.target_call_id}", command.target_call_id
end
end