Skip to content

Instantly share code, notes, and snippets.

@wwalker
Created August 4, 2009 13:53
Show Gist options
  • Save wwalker/161235 to your computer and use it in GitHub Desktop.
Save wwalker/161235 to your computer and use it in GitHub Desktop.
ahn_quick_start
1. in extensions.conf create a context that dumps into agi:
[my_ahn_app]
exten => s,1,AGI(agi://127.0.0.1)
2. ahn create my_proj
cd my_proj
ahn create my_component
vim components/my_component/my_component.rb
methods_for :dialplan do
def my_app
MyApp.new.start
end
end
class MyApp
def init(dialplan)
@dialplan = dialplan
end
def start
# do AGI stuff here
x = input 2, :play => 'my_prompt_sound'
dial('SIP/15555555555/outbound-peer')
end
end
3. ahn - # starts up the daemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment