cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
398
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: deniz caglar on 12-09-2008 01:13:38 PM
Hi,

Is it possible to make two parallel flows in Call Studio. For example in start of the call, i want to make some operations using java coded custom element, and want to play an audio at the same time. Because; in my custom element the operation can take few seconds, so i want to use that time for playing an audio. I heard that a vxml property provides this feature, but i am not sure. Has anyone try this or have information about?

Thanks.

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 12-09-2008 01:40:04 PM
One way to accomplish this is the following:

Put the java code into an action element, instead of 'start of call' class.

In the Studio call flow, use an Audio element right before your action
element. In this audio element, you can have an audio prompt.

At runtime, the Voice Gateway will get your audio prompt and start to
play it. But because it's not waiting for caller input, the VG will
submit an http request to the VXML Server while the caller is still
listening to the audio prompt. This allows the Studio app to move along
(to your action element) and start executing it while the caller is
still hearing the previous prompt.

Done this way, the caller has to listen to the entire audio prompt (even
if the action element completes and sends a new audio prompt to the VG
to speak).

If what you want is for the caller to start hearing some hold music that
gets interrupted as soon as the action is done, then in that same Audio
element JUST before the action element, go into the 'Settings' tab and
at the bottom, under 'VXML Property' enter the property name
'fetchaudio' and the full URL where to find your hold music
'http://10.1.78.10/en-us/myholdmusic.wav' (do NOT use the quotes and
it's all case sensitive).

The difference between this and the regular audio prompt, is that this
will not play to completion. It will stop playing as soon as the next
Studio voice element (Audio, or collecting caller info) executes.

Note, if you want this hold music to always play when caller is
'waiting' for something to happen, then you can modify the Studio app's
Project Properties > Root Document Settings. Put the same information
into the root document, and it becomes global to this application for
each phone call.

Hope this helps - if not please clarify and there may be other ways to
accomplish what you are trying to do.

Janine

www.TrainingTheExperts.com

Subject: Re: Is asynchronous flow possible
Replied by: deniz caglar on 15-09-2008 08:19:01 AM
Hi Janine,

Thank you very much for your answer.
The scenerio you wrote is exactly what i want. But i couldn't set my custom class instead of "start of call" class. I wrote an ActionElementBase class called JavaClass. I put the .class file into my call studio application's java/application/classes folder. In the properties of the application, i chose endpoint settings and click add button in the "On application start" and wrote "JavaClass" as class. In the studio, the flow is like this:

Start of Call
Audio_01
My action element
Hang up

When i deployed my application i got this error:
09/15/2008 10:59:29.195, SERVER ERROR: There was an error attempting to deploy the application. The error was: com.audium.server.AudiumException: Could not find the on start application class JavaClass.class. This error has canceled the deploy or update of the application.

I think On Application Start the class name is wrong, should i write there a path or another thing ? I couldn't find any example about this On Application Start or End.

Thanks.

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 15-09-2008 01:26:04 PM
If you write the java class for Start of Call, then in the Project
Properties/Endpoint Settings window, you DON'T want to list it in the
top box (AppStart).

You need to list the CallStart class at the BOTTOM of that window, where
it says "Start of Call" (or "Call Start"). Then Save, Deploy from Studio
and run the updateApp.bat script.

The names are somewhat misleading. Start of Call executes each time a
caller visits the application (whether it's a new call, app transfer, etc).
App Start only executes once when the app is loaded by the classLoader
(restart Tomcat or run the updateApp.bat script) - not upon each visit
to the app. And this is written using the AppStart class.

Regards,
Janine

www.TrainingTheExperts.com

Subject: Re: Is asynchronous flow possible
Replied by: deniz caglar on 22-09-2008 07:29:43 AM
Thank you Janine,

As you said I put my class name "Start" on call start at the bottom and checked "Run in Background" choice. I deployed my app, run updateApp.bat successfully but, when ı ran the app, i got this error. Have you get any idea of this error ?

10.231.16.145.1222068171926.378.AsyncFlow,09/22/2008 10:22:51.942,Could not create an instance of on start call class Start. The error was: java.lang.ClassCastException: Start
java.lang.ClassCastException: Start
at com.audium.server.controller.Controller.onStartCall(Controller.java:2811)
at com.audium.server.controller.Controller.enterVoiceApplication(Controller.java:981)
at com.audium.server.controller.Controller.newCall(Controller.java:929)
at com.audium.server.controller.Controller.doPost(Controller.java:463)
at com.audium.server.controller.Controller.doGet(Controller.java:394)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1196)
at java.lang.Thread.run(Thread.java:595)

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 22-09-2008 11:57:11 AM
Why don't you submit the java source and I can look for an error.

Also for now deselect the option run in background to see if it makes a difference.

Sent from my Verizon Wireless BlackBerry

Subject: Re: Is asynchronous flow possible
Replied by: deniz caglar on 23-09-2008 06:29:40 AM
I also deselect run in background option but the result is the same.
This is my java class, it's very basic class that i only try to see the flow.

import com.audium.server.AudiumException;
import com.audium.server.session.ActionElementData;
import com.audium.server.voiceElement.ActionElementBase;
import com.audium.server.voiceElement.ElementInterface;
import com.audium.server.voiceElement.Setting;
import com.audium.server.voiceElement.ElementException;
import com.audium.server.voiceElement.ElementData;
import com.audium.server.xml.ActionElementConfig;

public class Start extends ActionElementBase implements ElementInterface {
/**
  • This is the name of the sample Action element, which appears in the
  • Audium Builder.
*/
public final String getElementName() {
return "Start";
}

/**
  • This is the name of the folder in the Audium Builder in which this sample
  • Action element appears.
*/
public final String getDisplayFolderName() {
return "Audium Support";
}

/**
  • This is the description of what this Action element does.
*/
public final String getDescription() {
return "This sample Action element performs basic arithmetic functions.";
}

/**
  • This returns the settings used by this sample Action element.
*/
public final Setting[] getSettings() throws ElementException {


return null;
}

/**
  • This method returns an array of ElementData objects representing the
  • Element Data that this Action element creates.
*/
public final ElementData[] getElementData() throws ElementException {

return null;
}

/**
  • This method performs the action. It gets the configuration settings, and
  • then performs the appropriate operation depending on the settings. The
  • result is stored in element data and in the activity log.
*/
public final void doAction(String name, ActionElementData actionData)
throws ElementException {

// Get a reference to the configuration
ActionElementConfig config = actionData.getActionElementConfig();


try {
actionData.setSessionData("SessionData", "5");
} catch (AudiumException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

// A utility method that logs an error message, and sets the element
// data named "value" to 0

}

Thanks.

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 23-09-2008 11:26:41 AM
the code you've included here creates an action element and can't be
used as a start of call class. Each different type of component (start
call, end call, action element, decision element, etc) has a different
class that it implements or extends and implements. Audium used to have
all the templates available online to download. I can send you them if
you include your email address.

Use this as your basic template for a Start of Call class.

// These classes are used by on call start classes.
import com.audium.server.AudiumException;
import com.audium.server.proxy.StartCallInterface;
import com.audium.server.session.CallStartAPI;
/**
* The On Start Call Class is called when a call is first received
before the
* call flow begins.
*/
public class MyCallStart implements StartCallInterface
{
/**
* All On Start Call classes must implement this method. This
method will
* be called at the beginning of the call. You can set session data here
* that can be used throughout the call.
*/
public void onStartCall(CallStartAPI callStartAPI) throws
AudiumException
{
// PUT YOUR CODE HERE.
}
}

Subject: Re: Is asynchronous flow possible
Replied by: deniz caglar on 25-09-2008 06:34:17 AM
Hi Janine,
Thank you very much for your help, I can run application with on call start class now.

Subject: Re: Is asynchronous flow possible
Replied by: GEOFFREY THOMPSON on 07-10-2008 04:26:14 PM
Why not use the VXML properties of fetchaudio and fetchtimeout? These are created for exactly this purpose.

Regards,
Geoff

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 07-10-2008 05:00:11 PM
Geoff

Have you gotten fetchaudio to work. One of my students has trouble with it.

Janine

Subject: Re: Is asynchronous flow possible
Replied by: GEOFFREY THOMPSON on 07-10-2008 06:10:33 PM
Janine,

fetchtimeout works, no problems.

The last time I tried fetchaudio, which was with CVP 3.0 SR1, it gave me a nasty problem in that CVP VXML would not close the session if the caller hung up. I had to wait 30 mins for the session to time out to get the port back.

Haven't tried it since then - but I would like to assume that bug has been fixed.

Regards,
Geoff

Subject: Re: Is asynchronous flow possible
Replied by: Janine Graves on 07-10-2008 09:55:41 PM
Geoff,
I just tested the fetchaudio using CVP 7 Studio and it works. And if I
hang up while the fetchaudio is playing, the license is indeed freed up.
Looks like that one's been fixed!

Subject: Re: Is asynchronous flow possible
Replied by: GEOFFREY THOMPSON on 08-10-2008 01:30:35 PM
Janine,

Thanks a lot for that testing. Much appreciated.

Regards,
Geoff
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links