Skip to content

Instantly share code, notes, and snippets.

@cloudvoxcode
Created August 6, 2009 21:45
Show Gist options
  • Save cloudvoxcode/163584 to your computer and use it in GitHub Desktop.
Save cloudvoxcode/163584 to your computer and use it in GitHub Desktop.
Receive phone call with Java
/* 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
Answer call, speak message */
public class ExampleCallIn extends BaseAgiScript {
public void service(AgiRequest request, AgiChannel channel) throws AgiException {
answer();
exec("Swift", "\"You have successfully received a call through Cloudvox. That's a mighty long string.\"");
hangup();
}
}
callin.agi = ExampleCallIn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment