secret
Created

Dial issue - controller and dialplan

  • Download Gist
00_adhearsion.xml
XML
1 2 3 4 5 6 7
<extension name="adhearsion">
<condition>
<action application="set" data="hangup_after_bridge=false"/>
<action application="set" data="park_after_bridge=true"/>
<action application="park" />
</condition>
</extension>
ivr_controller.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# encoding: utf-8
 
class IvrController < Adhearsion::CallController
def run
AudioService.establish_connection(Adhearsion.config.platform.root, Adhearsion.config.platform.environment.to_s)
answer
 
destinations = ["sofia/gateway/re_engine_out/1001"]
status = dial destinations
 
case status.result
when :answer
play *AudioService.urls_for([1])
when :no_answer
play *AudioService.urls_for([2])
when :error, :timeout
play *AudioService.urls_for([3])
end
play *AudioService.urls_for([3])
end
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.