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
| 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
| [{"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
| # 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
| # 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
| public class ExampleCallIn extends BaseAgiScript { | |
| public void service(AgiRequest request, AgiChannel channel) throws AgiException { | |
| answer(); | |
| exec("Swift", "Thank you for calling Cloudvox. Enter a 6 digit number."); | |
| exec("Read", "pin||6|2|10"); | |
| String pin = get_variable("pin"); | |
| exec("Swift", "You entered "); | |
| if (pin.length > 0) { | |
| sayDigits(pin); |
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 | |
| $call->answer(); | |
| $call->exec("Swift", "Thank you for calling Cloudvox. Enter a 6 digit number."); | |
| $call->exec("Read", 'pin||6|skip|2|10'); | |
| $pin = $call->get_variable("pin"); | |
| $call->exec("Swift", "You entered "); | |
| if (strlen($pin) > 0) { | |
| $call->exec("SayDigits", $pin); | |
| } else { |
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
| $call->exec("Swift", "Thank you for calling Cloudvox. Enter a 6 digit number."); | |
| $call->exec("Read", 'pin||6|2|10'); | |
| $pin = $call->get_variable("pin"); | |
| $call->exec("Swift", "You entered "); | |
| if (length($pin) > 0) { | |
| $call->exec("SayDigits", $pin); | |
| else { | |
| $call->exec("Playback", "nothing-at-all"); |
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 | |
| # Example handler for "call selected number" phone call bookmarklet. | |
| # Browser hits CGI with 2 phone numbers (action=dial). Triggers outbound call | |
| # via cloudvox.com phone API. When call connects, Cloudvox hits CGI for call | |
| # steps (action=answer). CGI serves JSON to call 2nd number. | |
| # | |
| # Browser bookmarklet example dial params: | |
| # action=dial&local_number=1234567890&remote_number=4567890123 | |
| # Cloudvox example answer params: | |
| # action=answer&phone_number=1234567890&remote_number=4567890123 |
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/php -q | |
| <?php | |
| # Cloudvox - place an outgoing call using PHP | |
| # Place and receive phone calls via open API: http://cloudvox.com/ | |
| # Learn about call scripting, Asterisk/AGI, voice apps: http://help.cloudvox.com/ | |
| require_once('/path/to/phpagi-asmanager.php'); | |
| # Number to call (10 digits, no leading 1 or 9) | |
| $call = "2065554141"; |