This file contains 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/perl | |
use Cloudvox; | |
# start Asterisk Gateway Interface (AGI) server on port 4573 | |
Cloudvox->run(port => 4573); |
This file contains 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/perl | |
# Cloudvox - place an outgoing call using Perl | |
# Place and receive phone calls via open API: http://cloudvox.com/ | |
# Learn about call scripting, Asterisk/AGI, voice apps: http://help.cloudvox.com/ | |
use Asterisk::Manager; | |
# Number to call (10 digits, no leading 1 or 9) | |
my $call = '12065551234'; | |
# Cloudvox outgoing settings. If you don't have these, create a free account |
This file contains 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 - answer and control a phone call with Java | |
Place and receive phone calls via open API: http://cloudvox.com/ | |
Learn about call scripting, Asterisk/AGI, voice apps: http://help.cloudvox.com/ */ | |
import org.asteriskjava.fastagi.AgiChannel; | |
import org.asteriskjava.fastagi.AgiException; | |
import org.asteriskjava.fastagi.AgiRequest; | |
import org.asteriskjava.fastagi.BaseAgiScript; | |
/* Example incoming call handler |
This file contains 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 - place an outgoing call with Java | |
Place and receive phone calls via open API: http://cloudvox.com/ | |
Learn about call scripting, Asterisk/AGI, voice apps: http://help.cloudvox.com/ */ | |
import java.io.IOException; | |
import org.asteriskjava.manager.AuthenticationFailedException; | |
import org.asteriskjava.manager.ManagerConnection; | |
import org.asteriskjava.manager.ManagerConnectionFactory; | |
import org.asteriskjava.manager.TimeoutException; | |
import org.asteriskjava.manager.action.OriginateAction; |
This file contains 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 - answer and control a phone 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('phpagi.php'); | |
set_time_limit(30); | |
$AGI = new AGI(); |
This file contains 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"; |
This file contains 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 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 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 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); |
OlderNewer