Skip to content

Commit

Permalink
Work around JRuby bug in class names
Browse files Browse the repository at this point in the history
  • Loading branch information
bklang committed Aug 19, 2010
1 parent 4ffc27b commit 98fd953
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/adhearsion/voip/asterisk/commands.rb
Expand Up @@ -153,7 +153,7 @@ def hangup
# numbers, Adhearsion assumes you're saying the number, not the digits. For example, play("100")
# is pronounced as "one hundred" instead of "one zero zero".
#
# Note: it's not necessary to supply a sound file extension; Asterisk will try to find a sound
# Note: it is not necessary to supply a sound file extension; Asterisk will try to find a sound
# file encoded using the current channel's codec, if one exists. If not, it will transcode from
# the default codec (GSM). Asterisk stores its sound files in /var/lib/asterisk/sounds.
#
Expand Down Expand Up @@ -442,8 +442,8 @@ def menu(*args, &block)
# causes the timer to reset. This is a much more user-friendly approach than an
# absolute timeout.
#
# Note that when you don't specify a digit limit, the :accept_key becomes "#"
# because there'd be no other way to end the collection of digits. You can
# Note that when the digit limit is not specified the :accept_key becomes "#".
# Otherwise there would be no way to end the collection of digits. You can
# obviously override this by passing in a new key with :accept_key.
def input(*args)
options = args.last.kind_of?(Hash) ? args.pop : {}
Expand Down Expand Up @@ -495,7 +495,12 @@ def input(*args)
# you should assign the important ones to an instance variable first before calling this method.
def jump_to(context, overrides={})
context = lookup_context_with_name(context) if context.kind_of?(Symbol) || (context.kind_of?(String) && context =~ /^[\w_]+$/)
raise Adhearsion::VoIP::DSL::Dialplan::ContextNotFoundException unless context.kind_of?(Adhearsion::DialPlan::DialplanContextProc)

# JRuby has a bug that prevents us from correctly determining the class name.
# See: http://jira.codehaus.org/browse/JRUBY-5026
if !(context.kind_of?(Adhearsion::DialPlan::DialplanContextProc) || context.kind_of?(Proc))
raise Adhearsion::VoIP::DSL::Dialplan::ContextNotFoundException
end

if overrides.any?
overrides = overrides.symbolize_keys
Expand Down

0 comments on commit 98fd953

Please sign in to comment.