This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cloudvox works with standard Asterisk (AGI) libraries, like Adhearsion | |
| default { | |
| play 'sounds/matrix' | |
| execute 'swift', '"Press 1 to hear the date."' | |
| case input(1) | |
| when '1' | |
| execute 'swift', '"Today is %s"' % Time.now.strftime("%A, %B %e") | |
| else | |
| play 'unavailable' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # use any language, or static JSON: | |
| [{"name":"speak", "phrase":"Hello! Enter a 6-digit number."}, | |
| {"name":"getdigits", "max":6, "url":"http://a.web.server/step-2"}] | |
| # input is passed to you. Act on it: | |
| [{"name":"speak", "phrase":"You entered $_GET['result']"}, | |
| {"name":"playback", "filename":"thanks-for-calling"}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [{"name":"speak","phrase":"Thanks for calling!"}, | |
| {"name":"playback","filename":"monkeys"}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Cloudvox Phone API Platform Launches: "Telephony in the Cloud" | |
| New Cloudvox service lets Web developers manipulate phone calls like Web | |
| pages -- from their own software, over the Internet, in minutes. | |
| Cloudvox launched today, bringing unprecedented phone call flexibility to | |
| entrepreneurs and technologists. Any Web developer can place, receive, and | |
| control phone calls from their own application or Web site, with no new | |
| infrastructure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // more: http://help.cloudvox.com/ | |
| $r= new HttpRequest('http://your.cloudvox.com/applications/42/dial', HttpRequest::METH_POST); | |
| $r->addPostFields ( | |
| array ( | |
| 'destination' => '2061112222', | |
| 'caller_id' => '2065559999', | |
| 'remote_number' => $_GET['remote_number']; | |
| ) | |
| ); | |
| $r->send () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -w | |
| require 'net/http' | |
| require 'net/https' | |
| begin | |
| require 'net/http/post/multipart' | |
| rescue LoadError | |
| puts "This requires multipart-post." | |
| puts " $ sudo gem install multipart-post" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'rubygems' | |
| require 'httparty' | |
| # basic Cloudvox call history to CSV example | |
| # see http://help.cloudvox.com/faqs/provisioning/call-history | |
| class CallDetailRecords | |
| include HTTParty | |
| format :json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cell phone simulator with Adhearsion & Cloudvox (http://bit.ly/cvruby) | |
| default { | |
| until caller_finally_given_up? | |
| case (rand*5).to_i | |
| when 0 then play 'intermittent-static' | |
| when 1 then execute 'swift', '"All circuits are busy. Please try your call again later."' | |
| when 2 then hangup | |
| when 3 then execute 'echo' | |
| when 4 | |
| sleep until phone_location_changed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [{"name":"playback","filename":"thanks-for-calling"}, | |
| {"name":"speak","phrase":"Record your update now."}, | |
| {"name":"record","filename":"update-from-afar.wav","url":"http://your.server/send-as-email"}, | |
| {"name":"speak","phrase":"Submitted. Goodbye."}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| # connect to Asterisk AMI port, authenticate, and print all AMI event messages | |
| # as they're received. | |
| # more or for Asterisk hosting: http://help.cloudvox.com/ | |
| # version: 2010-05-04 | |
| require 'socket' | |
| unless ARGV.length == 4 | |
| puts 'usage: ruby ./ami_listener.rb hostname port username password' |