Skip to content

Instantly share code, notes, and snippets.

@bklang
Created October 14, 2011 15:46
Show Gist options
  • Save bklang/1287464 to your computer and use it in GitHub Desktop.
Save bklang/1287464 to your computer and use it in GitHub Desktop.
Example call origination handling
robocall {
answer
# Join conference room based on dialed extension, in this case 8621
dial("WOOMERA/conf:#{variables[:exten]}")
hangup
}
noisemaker {
answer
play 'tt-monkeys'
sleep 5
play 'tt-weasels'
hangup
}
[robocall]
exten => _.,1,AGI(agi://127.0.0.1/robocall)
manager = Adhearsion::VoIP::Asterisk.manager_interface
manager.originate channel: "SIP/1234", context: "robocall", priority: "1", exten: "8621", async: "true"
manager.call_and_exec "WOOMERA/conf:8621", "AGI", :data => "agi://127.0.0.1/noisemaker"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment