Hello!
I have created a custom voice element, actually extended element with the input details from the SQL Database query.
The element receives Result Set from the database element, which has two coulmns: sequence and path to the wav file.
The element then creates AudioGroup and adds the files to it.
The element works fine unless the file is actually missing on the media server.
By some reason, in that case I do not see any exceptions like badfetch or something, the session is just timing out.
What I am missing? I would like to handle such cases and keep the call.
PlayInfo,03/15/2017 12:57:14.251,DB_PlayInfo,enter,
PlayInfo,03/15/2017 12:57:14.282,DB_PlayInfo,exit,done
PlayInfo,03/15/2017 12:57:14.282,Audio_01,enter,
PlayInfo,03/15/2017 12:57:14.282,Audio_01,interaction,audio_group,initial_audio_group
PlayInfo,03/15/2017 12:57:14.282,Audio_01,exit,done
PlayInfo,03/15/2017 12:57:14.282,SD_Return,enter,
PlayInfo,03/15/2017 12:59:30.424,SD_Return,element,warning,A session has timed out after 2 minutes. This is most likely caused by a start of call class or action element at the top of the callflow not completing before the voice browser's fetch timeout occurred. To resolve it ensure this class executes in a timely manner or run it in the background. Session timeouts may also occur under high load or if there are issues with a load balancer or voice browser.
PlayInfo,03/15/2017 12:59:30.424,,end,how,app_session_complete
PlayInfo,03/15/2017 12:59:30.424,,end,result,timeout
PlayInfo,03/15/2017 12:59:30.424,,end,duration,136
The element:
import com.audium.server.AudiumException;
import com.audium.server.proxy.VoiceElementInterface;
import com.audium.server.session.ElementAPI;
import com.audium.server.xml.VoiceElementConfig;
import com.audium.server.action.database.ResultSetList;
public class PlayPrompt implements VoiceElementInterface{
public VoiceElementConfig getConfig(String name, ElementAPI elementAPI, VoiceElementConfig defaults) throws AudiumException
{
try{
String fileName = "";
String sequence = "";
ResultSetList rs = (ResultSetList) elementAPI.getSessionData("Files");
VoiceElementConfig.AudioGroup initialAudioGroup;
if(defaults.getAudioGroup("initial_audio_group",1) == null){
initialAudioGroup = defaults.new AudioGroup("initial_audio_group", false);
} else {
initialAudioGroup = defaults.getAudioGroup("initial_audio_group",1);
}
int count = rs.getNumRows();
int index = 0;
while(index < count){
fileName = rs.getValue("FileName",index );
sequence = rs.getValue("Sequence",index );
VoiceElementConfig.StaticAudio prompt = defaults.new StaticAudio(sequence,fileName);
prompt.setUseDefaultAudioPath(false);
initialAudioGroup.addAudioItem(prompt);
index++;
}
defaults.setAudioGroup(initialAudioGroup);
}
catch(Exception e){
elementAPI.addToLog("PlayPrompt Class - Exception Occurred" , e.getMessage());
}
return defaults;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What is the purpose of 'sequence' variable there. It is a TTS phrase parameter, but I am not sure if that is why you have it there. If the wav file is not there, then it should technically play the TTS unless you don't any tts resource.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks, Rahul!
That was it, currently we do not have the TTS server. I removed the sequence variable and it is working correctly now.
Regards, Denis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.