To receive an incoming call:
public class MyVoiceApp extends WVRApplication {
public void voiceMain() throws WVRException {
.
.
.
// Create the application properties object
ApplicationProperties appProperties = new ApplicationProperties();
appProperties.setApplicationName("app1");
applicationProperties.setLocale(Locale.US);
// Create the WVR object. The this keyword registers the application
// as the owner of the WVR object
WVR wvr = new WVR(this, appProperties);
// Set the value of the WVR.waitTime property to the time in seconds that
// you want the application to wait for a call
wvr.setWaitTime(10);
try {
// Wait for a call
Call call = wvr.waitForCall("Call: " + callNumber);
// Handle the call
.
.
.
}
catch (WVRException e) {
// Error handling
.
.
.
}
}
}
To make an outgoing call:
public class MyVoiceApp extends WVRApplication {
public void voiceMain() throws WVRException {
// Create the application properties object
ApplicationProperties appProperties = new ApplicationProperties();
appProperties.setApplicationName("app1");
applicationProperties.setLocale(Locale.US);
// Create the WVR object. The this keyword registers the application
// as the owner of the WVR object
WVR wvr = new WVR(this, appProperties);
// Set the value of the WVR.ringTime property to the time in seconds that
// you want the application to wait for a call to be answered
wvr.setRingTime(20);
try {
// Make a call
Call call = wvr.makeCall();
// Handle the call
.
.
.
catch (WVRException e) {
// Error handling
}
}
}