#89 ✓invalid
Daniel Boyles

originate calls via DRb throws exception on answer.

Reported by Daniel Boyles | November 24th, 2009 @ 06:37 AM


The call is 'originated', but exception 'Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceResponse does not refer class/module (TypeError)' is raised.


  • Asterisk 1.4.21 running on IP
  • Outcalling on Asterisk is via H.323 trunk to (this works flawless for everything else)
  • Adhearsion 0.8.3 is running on IP
  • ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
  • rubygems 1.3.5
  • Installed gems
    activesupport (2.3.4)
    adhearsion (0.8.3)
    cgi_multipart_eof_fix (2.5.0)
    daemons (1.0.10)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    jsgoecke-restful_adhearsion (0.1.1)
    json (1.1.9)
    log4r (1.1.2)
    mongrel (1.1.5)
    rack (1.0.1)
    rest-client (1.0.3)
    rubigen (1.5.2)
    sinatra (0.9.4)

Asterisk Configs


secret = adhearsion
read    = system,call,log,verbose,command,agent,user
write   = system,call,log,verbose,command,agent,user


; single Adhearsion extension
exten => 8001,1,AGI(agi://
exten => 8001,n,Hangup

Adhearsion configs


  config.logging :level => :debug
  config.asterisk.enable_ami :host => "", :username => "ahn_ami", :password => "adhearsion", :events => true



default {
  @destination = self.call.variables[:destination] = variable("destination")

  if @destination
    play 'one-moment-please'
    dial @destination


require 'drb'
Adhearsion = DRbObject.new_with_uri 'druby://localhost:9050'

options = { :channel  => "H323/6702@",
              :context  => "default",
              :priority => "1",
              :exten    => "8001",
              :async    => 'true',
              :variable => "destination=H323/6969@"}

Adhearsion.originate options


  • Extension H323/6702 rings
  • H323/6702 hears "One Moment please"
  • Extension H323/6969 rings and is connected to H323/6702

Output from test.rb

ruby test.rb 
/usr/lib/ruby/1.8/drb/drb.rb:585:in `load': Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceResponse does not refer class/module (TypeError)
    from /usr/lib/ruby/1.8/drb/drb.rb:585:in `load'
    from /usr/lib/ruby/1.8/drb/drb.rb:581:in `synchronize'
    from /usr/lib/ruby/1.8/drb/drb.rb:581:in `load'
    from /usr/lib/ruby/1.8/drb/drb.rb:633:in `recv_reply'
    from /usr/lib/ruby/1.8/drb/drb.rb:923:in `recv_reply'
    from /usr/lib/ruby/1.8/drb/drb.rb:1202:in `send_message'
    from /usr/lib/ruby/1.8/drb/drb.rb:1093:in `method_missing'
    from /usr/lib/ruby/1.8/drb/drb.rb:1177:in `open'
    from /usr/lib/ruby/1.8/drb/drb.rb:1092:in `method_missing'
    from /usr/lib/ruby/1.8/drb/drb.rb:1110:in `with_friend'
    from /usr/lib/ruby/1.8/drb/drb.rb:1091:in `method_missing'
    from test.rb:11

Output from ahn start .

 INFO ahn: Adhearsion initialized!
DEBUG ami: Sending AMI action: 
>>> Action: login
>>> ActionID: ncJRdg3j-ZoZ3-53UX-CE2J-XJx5zuhAYU7h
>>> Username: ahn_ami
>>> Secret: adhearsion
>>> Events: Off
 INFO ami: Successful AMI actions-only connection into ahn_ami@
 INFO ami: Successful AMI events-only connection into ahn_ami@
 WARN deprecation: The implementation of the ping, originate, introduce, hangup, call_into_context and call_and_exec methods will soon be moved from this class to SuperManager. At the moment, the SuperManager abstractions are not completed. Don't worry. The migration to SuperManager will be very easy. See http://docs.adhearsion.com/AMI for more information.
DEBUG ami: Sending AMI action: 
>>> Action: originate
>>> ActionID: ei65iJoY-s6NT-HiMT-WD9e-dpLntOqkFUFL
>>> exten: 8001
>>> priority: 1
>>> channel: H323/6702@
>>> context: default
>>> async: true
>>> variable: destination=H323/6969@
 INFO agi: Handling call with variables {:type=>"H323", :language=>"en", :enhanced=>0.0, :uniqueid=>"asterisk-1259059528.412", :dnid=>6702, :request=>#<URI::Generic:0xb7822168 URL:agi://>, :callingpres=>0, :query=>{}, :callerid=>nil, :calleridname=>nil, :callingtns=>0, :rdnis=>nil, :context=>"default", :extension=>8001, :type_of_calling_number=>:unknown, :accountcode=>"", :network=>true, :channel=>"H323/", :callingani2=>0, :priority=>1}
DEBUG agi: <<< 200 result=0

DEBUG agi: >>> GET VARIABLE destination
DEBUG agi: <<< 200 result=1 (H323/6969@

DEBUG agi: >>> EXEC playback one-moment-please
DEBUG agi: <<< 200 result=0

DEBUG agi: >>> EXEC Dial H323/6969@||
DEBUG agi: <<< 200 result=-1

Hopefully that's enough info to fix the error ..

Comments and changes to this ticket

  • Daniel Boyles

    Daniel Boyles November 24th, 2009 @ 08:20 AM

    Updated the ticket with ruby & rubygems version.
    Also corrected the installed adhearsion version to 0.8.3 (not 0.8.4)

  • jreynolds

    jreynolds December 11th, 2009 @ 10:46 AM

    I had this same problem, it is because you are naming the remote drb object "Adhearsion" which conflicts with module called "Ahearsion". Try:

    AdhearsionRemote = DRbObject.new_with_uri 'druby://localhost:9050'
    ... AdhearsionRemote.originate options

    I no longer get that exception, but asterisk hangs up once it's answered.

  • Daniel Boyles

    Daniel Boyles December 16th, 2009 @ 03:44 PM

    Thanks jreynolds.

    It works now & thanks for the explanation.
    I actually got the code for test.rb from jicksta's click-to-call
    Now I can hopefully get that to work for me :-)

    I don't get asterisk hanging up on me, so perhaps you're experiencing another issue ?

  • Ben Klang

    Ben Klang July 28th, 2010 @ 09:55 PM

    • Assigned user changed from “Jay Phillips” to “Ben Klang”
    • Milestone order changed from “0” to “0”

    Just a bit of housekeeping: it looks like this is not a bug (though perhaps a documentation issue). Any reason not to close this out?

  • Ben Klang

    Ben Klang August 19th, 2010 @ 07:52 PM

    • State changed from “new” to “invalid”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins


Referenced by