Skip to content

Instantly share code, notes, and snippets.

@cloudvoxcode
Created October 6, 2009 01:35
Show Gist options
  • Save cloudvoxcode/202685 to your computer and use it in GitHub Desktop.
Save cloudvoxcode/202685 to your computer and use it in GitHub Desktop.
Answer call with Java & Asterisk (more at help.cloudvox.com)
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);
} else {
streamFile("nothing-at-all");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment