在我adhearsion撥號方案,我有以下的代碼,導致從呼叫立即斷開,沒有任何輸出到日誌或控制檯:Adhearsion的撥號規則不能訪問軌道模型
the_flow = CallFlow.where(:dnis => dnis).first
CallFlow是一個模型在我的rails應用程序(gui/app/models/call_flow.rb)中,它位於我的adhearsion應用程序的gui目錄中。在我.ahnrc文件我有:
paths:
# All paths are relative to this file's directory
init: config/startup.rb
dialplan: dialplan.rb
events: events.rb
models: gui/app/models/*.rb
這是call_flow.rb:
class CallFlow < ActiveRecord::Base
belongs_to :routable, :polymorphic => true
def dialplan
puts self.routable.description.squeeze("\n").strip
end
def target_route=(params)
self.routable = params[:kind].constantize.new(params.reject {|k,v| k == "kind"})
end
end
最後,我在配置/ startup.rb以下行:
config.enable_rails :path => 'gui', :env => :development
我知道模型的工作原理,因爲我可以使用rails服務器創建記錄。但我甚至不知道如何獲得關於當撥號計劃到達上面第一行時撥打電話的信息。
如果我知道如何解救ActiveRecord問題,這可能會有所幫助... –