Author |
Message |
|
|
Mache
Joined: Feb 13, 2017
Messages: 51
Offline
|
Hi,
Please can you help me know how can i record a customers voice in my OD 7 application and store it at a dedicated location.
I am using OD 7 on my experience portal 7. This is just a normal customers voice to record their experience.
No speech no grammer type application but just a plain recording of the callers voice in a file (.wav or something else).
Regards
|
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
The sample applications on the ISO image have a recordmessage example application.
|
|
|
|
|
Mache
Joined: Feb 13, 2017
Messages: 51
Offline
|
Thanks Ross,
I was able to get the sample app in my workspace and see there is a specific node for Record message. I cannot see the RecordMessage node in Templates or Applications Items.
When i tried to drag prompt and collect node or Announcement node, and double click it, and delete the entire items in them to add the record form item, the entire items inside the prompt and collect or announcement nodes are not getting deleted.
Is there any specific template i am missing in my aaod.
|
|
|
|
|
Mache
Joined: Feb 13, 2017
Messages: 51
Offline
|
Hi Ross,
I simply copied and pasted that node from the sample and used it in my application. CAn you let me know how can i get that node in my application by default.
With copying and pasting i am able to run the application asking to say something which is getting stored in a variable.
Please can you let me know does this recording sit on any specific path. I am not currently saving these files anywhere its just in the variable. Do they get deleted once the call session is completed.?
|
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
See attached
|
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
The recorded data is in the data/temp directory. When the session ends, the files in the temp are deleted. If you wish to save the file then you could move it to a different location (programatically). The URL to the file is in the shadow variable for the record.
|
|
|
|
|
Lerato
Joined: Sep 29, 2016
Messages: 9
Offline
|
Hi,
How can I change the filename to a custom name? This will allow me to refer to it later with a callID for example
|
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
By default all the "temp" recordings are deleted when the applicatoin ends. You can alter this behavior using mySession.setDeleteTempFiles( boolean value ).
You would need to get the value of the recorditem:value and convert to a url then use the "path" and mySession.getAbsoluteProjectFilePath() to build a file name. Then use sourceFile = new File( fileName );
and sourceFile.renameTo(dest); Where dest is the new name.
|
|
|
|
|
JaydeepH
Joined: Feb 24, 2017
Messages: 41
Offline
|
Hi Ross,
Greetings! Hope you are doing good..
Thanks for all your responses. I was searching information on this same topic. However, I am facing few challenges on implementing this solution.
Environment:
AOD 7.1
AAEP 7.0.2
Tomcat: Windows Tomcat 8.0.x Application server
Requirement: Record callers message and save it to a specific folder (Windows Tomcat server folder) with a specific file name.
I saw couple of your responses stating:
If you wish to save the file then you could move it to a different location (programatically). The URL to the file is in the shadow variable for the record.
And your last response to this thread explaining about writing custom code to get this solution implemented.
Could you please share more information about where exactly do we have to write/add such custom code?
What I have tried till now is to open java code for each node - Record or variables; however, unable to find any clue where to set these parameters.
Appreciate your inputs on this regard,
Thanks for your support.
Warm regards,
Jaydeep Hatekar
|
|
|
|
|
WilsonYu
Joined: Nov 6, 2013
Messages: 3947
Offline
|
What you really need to do is to add a Servlet from the palette of the flow editor, open the Java file of the servlet; add this code in the servletImplementation method:
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
//keep record file in the data/temp directory after the session ends
mySession.setDeleteTempFiles(false);
//save the file to a different place.
String audioFilePath = mySession.getVariableField(IProjectVariables.RERECORD_MESSAGE,
IProjectVariables.RECORDED_MESSAGE_FIELD_VALUE).getStringValue();
URL audioUrl = null;
InputStream is = null;
try {
audioUrl = new URL(audioFilePath);
System.out.println("file: " + audioUrl.toString());
ByteArrayOutputStream audioFileBytes = new ByteArrayOutputStream();
is = audioUrl.openStream ();
byte[] byteChunk = new byte[4096]; // Or whatever size you want to read in at a time.
int n;
while ( (n = is.read(byteChunk)) > 0 ) {
audioFileBytes.write(byteChunk, 0, n);
}
FileOutputStream fos = new FileOutputStream("c:/test/abc.wav");
fos.write(audioFileBytes.toByteArray());
}
catch (IOException e) {
System.err.printf ("Failed while reading bytes from %s: %s", audioUrl.toExternalForm(), e.getMessage());
e.printStackTrace ();
}
finally {
try {
if (is != null) { is.close(); }
}catch(IOException e) {}
}
}
|
|
|
|
|
JaydeepH
Joined: Feb 24, 2017
Messages: 41
Offline
|
Hi Wilson,
Thanks a lot for your quick response. This has really helped.
The functions that I am looking for are -
1. Play a prompt (wav) file from a particular folder path
2. Save a new recording file (wav format) in a particular folder
3. Move a wav file from one folder to another
I believe these functionalities cannot be achieved through simple OD code. This needs custom java code.
Do we have any sample codes or any "Orchestration Designer + Java" document that contains details about the functions, class, packages involved in implementing these above actions?
Appreciate any inputs on this topic,
Thanks for your support.
Warm regards,
Jaydeep Hatekar
|
|
|
|
|
WilsonYu
Joined: Nov 6, 2013
Messages: 3947
Offline
|
To play a wav file, you just need to use the Text Variable item in the Prompt and select the url type. So the path to the wav file has to be a url. To move a recorded file from the data/temp to another location, you just use the code I provided previously.
|
|
|
|
|
JaydeepH
Joined: Feb 24, 2017
Messages: 41
Offline
|
Hi Wilson,
Thanks for your responses. It has really helped.
Could you please share some info about the recorded file name which is stored by default in data/temp folder.
What I see is:
file_Anonymous_3178894478730921337.au
file_Anonymous_6280273151839582018.au
file_Anonymous_6802919943912942160.au
I am wondering what this number in the above file names made of?
The reason I am asking this is -
When caller#1 records a message, it will be stored in data/temp folder with some file name as shown above. I need to copy this exact file recorded by caller#1 into another folder.
Again when another caller#2 records a message, it will be stored in data/temp folder with some other file name.
Thanks for your support.
Warm regards,
Jaydeep Hatekar
|
|
|
|
|
WilsonYu
Joined: Nov 6, 2013
Messages: 3947
Offline
|
The prefix "Anonymous" could have gotten from the session.ani field which could have been the real ANI from the call sent by EP. The number is just generated randomly for uniqueness, and it is not otherwise meaningful.
|
|
|
|
|
dagrawal.avaya.com
Joined: Oct 30, 2018
Messages: 10
Offline
|
Hi,
Quick question on record node. Do we need ASR for implementing record node? We are trying to use record node but looks like it is trying to find ASR server.
Regards,
Deepak
|
|
|