Looping round to handle another call

To ensure that your application continues to wait for calls (unless an error prevents the calls being dealt with correctly), simply structure your code so that the WVR.waitForCall() or WVR.makeCall() method is within a loop.

For example, for waitForCall():
public class MyVoiceApp extends WVRApplication {
	
  public void voiceMain() throws WVRException {
		
    // Define a reference variable for a Call object, so we avoid
    // creating multiple instances later on in the loop
    Call call = null;
 		
    // Create the application properties object
    ApplicationProperties appProperties = new ApplicationProperties();
    appProperties.setApplicationName("app1");
    applicationProperties.setLocale(Locale.US);
		
    // Create the WVR object
    WVR wvr = new WVR(this, appProperties);
		
    // Create a boolean to control the loop
    private boolean keepTakingCalls = true;
		
    // Create the loop
    while (keepTakingCalls) {
			
      try {
        // Wait for a call
        Call call = wvr.waitForCall("Call: " + callNumber);
		
        // Handle the call
        .
        .
        .
      }
      catch (WVRException e) {
        // Error handling
        .
        .
        .
      }
    }
  }
}

You may want to add the loop when you have finished development and testing the basic call handling functionality of your application, otherwise you will explicitly have to stop and restart the application every time you make a change to it.