Summary
The call is 'originated', but exception
'Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceResponse does
not refer class/module (TypeError)' is raised.
Setup
Asterisk Configs
manager.conf
[ahn_ami]
secret = adhearsion
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
extensions.conf
[default]
; single Adhearsion extension
exten => 8001,1,AGI(agi://10.46.163.107)
exten => 8001,n,Hangup
...
Adhearsion configs
config/startup.rb
...
config.logging :level => :debug
...
config.asterisk.enable_ami :host => "10.46.163.219", :username => "ahn_ami", :password => "adhearsion", :events => true
config.enable_drb
...
dialplan.rb
default {
@destination = self.call.variables[:destination] = variable("destination")
if @destination
play 'one-moment-please'
dial @destination
end
}
test.rb
require 'drb'
Adhearsion = DRbObject.new_with_uri 'druby://localhost:9050'
options = { :channel => "H323/6702@10.46.163.13:1720",
:context => "default",
:priority => "1",
:exten => "8001",
:async => 'true',
:variable => "destination=H323/6969@10.46.163.13:1720"}
Adhearsion.originate options
Results
- 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@10.46.163.219
INFO ami: Successful AMI events-only connection into ahn_ami@10.46.163.219
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@10.46.163.13:1720
>>> context: default
>>> async: true
>>> variable: destination=H323/6969@10.46.163.13:1720
>>>
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://10.46.163.107>, :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/10.46.163.13:1720-73", :callingani2=>0, :priority=>1}
DEBUG agi: >>> ANSWER
DEBUG agi: <<< 200 result=0
DEBUG agi: >>> GET VARIABLE destination
DEBUG agi: <<< 200 result=1 (H323/6969@10.46.163.13:1720)
DEBUG agi: >>> EXEC playback one-moment-please
DEBUG agi: <<< 200 result=0
DEBUG agi: >>> EXEC Dial H323/6969@10.46.163.13:1720||
DEBUG agi: <<< 200 result=-1
Hopefully that's enough info to fix the error ..