Handing a call to another application

The Call.invokeApplication() method allows one application to pass the telephone call to another voice application. The application to be invoked does not need a number-to-application mapping in the configuration database. Before being invoked, the application must be started and must issue a WVR.waitForCall(), so that it is waiting for a call, as shown in Figure 1.

An invoked application can invoke another application: the nesting of applications is not limited by the architecture.

To pass the telephone call to another application use the Call.invokeApplication() method. The parameters of this method are:
applicationName
If you are running the application in a node, the applicationName should match the application name as described in the AppName configuration entry.
applicationData
This is an optional property which may be set to contain a serializable Java object that is to be passed to the invoked application. Note that parameters passed into the invoking application are not automatically passed to the invoked application, and that the Java object must be accessible in the classpath for the voice response node in addition to the application node in which the application is running.
waitForReturn
To make the invoking application wait for the invoked application to return, set waitForReturn to true, as shown in Figure 1. If the invoking application has finished with the phone call, set waitForReturn to false, as shown in Figure 2. The Call object of the invoking application becomes invalid.
For example:
  try {
    // Make a call to another application, transfer data, and wait
    Call call = wvr.waitforcall();
    Object javaObject = new Object();
    call.invokeApplication("OtherApp", javaObject, true);
}

Which locale is used when an application is invoked?

When you use the Call.invokeApplication() method to invoke another application, the locale specified in the ApplicationProperties or the AppName entry for the invoked application is used; if no locale is specified for the invoked application, the current locale of the calling application is used. If the call is passed back to the invoking application, the locale is whatever the invoked application was using when it returned the call.

What text-to-speech and speech recognition definitions are used when an application is invoked?

When you use the Call.invokeApplication() method to invoke another application, any text-to-speech and speech recognition definitions that were configured for the invoking application do not apply to the invoked application. If the invoked application returns to the invoking application, the text-to-speech and speech recognition definitions of the invoking application are reinstated.

Figure 1. Handing a call over to another application and waiting to get it back
This picture shows the handing of a call over to another application and waiting to get it back.
Figure 2. Handing a call over to another application
This picture shows the handing of a call over to another application.