Module: Adhearsion::Translator::Asterisk::Component::MRCPRecogPrompt

Included in:
MRCPNativePrompt, MRCPPrompt
Defined in:
lib/adhearsion/translator/asterisk/component/mrcp_recog_prompt.rb

Constant Summary collapse

UniMRCPError =
Class.new Error
MRCP_ERRORS =
{
  '004' => 'RECOGNIZE failed due to grammar load failure.',
  '005' => 'RECOGNIZE failed due to grammar compilation failure.',
  '006' => 'RECOGNIZE request terminated prematurely due to a recognizer error.',
  '007' => 'RECOGNIZE request terminated because speech was too early.',
  '009' => 'Failure accessing a URI.',
  '010' => 'Language not supported.',
  '016' => 'Any DEFINE-GRAMMAR error other than grammar-load-failure and grammar-compilation-failure.',
}

Instance Method Summary collapse

Instance Method Details

#executeObject


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/adhearsion/translator/asterisk/component/mrcp_recog_prompt.rb', line 23

def execute
  setup_defaults
  validate
  send_ref
  execute_unimrcp_app
  complete
rescue ChannelGoneError
  call_ended
rescue UniMRCPError => e
  complete_with_error e.message
rescue RubyAMI::Error => e
  complete_with_error "Terminated due to AMI error '#{e.message}'"
rescue OptionError => e
  with_error 'option error', e.message
end