Author Message
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
Hello everybody could you please help me.
I have find many posts with description how to do record message application.
I created app which based on Record Message. I saw that files were written in temp directory, but i can't copy them in different
If you have simple app with java code, which copy files to the different directory.
I will be very grateful for the help
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You can download a sample app via the following post:

https://www.devconnectprogram.com/forums/posts/list/23.page
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
Thank's for link.
I downloaded one of projects and configure it for my system (without tts). But i can't see any changes.
I've attached a project file. Could you say what's wrong where is my mistake. As i see in java servlet, app after save msg should copy wav file to the:
URL newLocURL = new URL(protocol, host, port, "/ross/" + sourceFile.getName());.
Is this directory: /../apache/webapps/ where apps put wav file?
In trace.log i see only, no errors. I don't have any idea, whats wrong
11:</block>
12:<catch event="connection.disconnect">
13:<goto next="AvayaDefaultDisconnectHandler?___DDSESSIONID=08D855BCA719A28E9FAE0F10EC20C0C8%3A%2FRecordMessage"/>
14:</catch>
15:<block>
16:<submit next="CopyMessage?___DDSESSIONID=08D855BCA719A28E9FAE0F10EC20C0C8%3A%2FRecordMessage"/>
17:</block>




Filename RecordMessage.7z [Disk] Download
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Try to take a look at the one I attach here. The custom code in the CopyMessage node is doing the work of copy the wav file. Note the line:

String absPathToContext = ctx.getInitParameter("copyfilepath");

This requires you to edit the "copyfilepath" parameter in the web.xml file to decide where the file will be copied into.
Filename RecordMessage.zip [Disk] Download
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
hank you for attach.
I compared your java code and my, they are identical.
Also i find in web.xml copyfilepath param-name. And change it:
<context-param>
<param-name>copyfilepath</param-name>
<param-value>C:\Temp\ross</param-value>
</context-param>

I created folder on my local PC. After start record and save msg there are no files.
in catalina logs i didn't see anything.

Maybe it depends of local PC politics??
As i see, file should be copied in folder which located on local PC.
in web.xml
My tomcat located on server, may be trouble in this??
I copy exported file to server, which deployed in tomcat automatically
May be i should try to create folder on server???
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The directory you set in the web.xml should be the one on the Tomcat machine not your local PC.
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
Today I changed Param-value of copyfilepath for:
/opt/Tomcat/AppServer/apache-tomcat-8.5.40/webapps/RecordMessage/data/Ross
And try to copy, but no files in folder. Maybe I should do anything else??
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Do you see any error or exception in the trace.log. You would need to add some debugging statement to see where the code ends
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
I see in trace.log only this:
16:<submit next="CopyMessage?___DDSESSIONID=356FE673D69AFF8376AC1D438A49728B%3A%2FRecordMessage"/>
17:</block>
18:</form>
19:</vxml>
20:

13/10/2019 21:13:40 INFO - 356FE673D69AFF8376AC1D438A49728B:/RecordMessage : Using SCESession 356FE673D69AFF8376AC1D438A49728B:/RecordMessage servlet : CopyMessage
13/10/2019 21:13:40 INFO - 356FE673D69AFF8376AC1D438A49728B:/RecordMessage : Using SCESession 356FE673D69AFF8376AC1D438A49728B:/RecordMessage servlet : back
13/10/2019 21:13:40 DEBUG - 356FE673D69AFF8376AC1D438A49728B:/RecordMessage : *** Reply for [/RecordMessage/back] ***
13/10/2019 21:13:40 DEBUG - 356FE673D69AFF8376AC1D438A49728B:/RecordMessage : 0:<?xml version="1.0" encoding="UTF-8"?>
1:<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-us">
2:<meta name="author" content="Avaya Aura Orchestration Designer"/>
3:<meta name="runtime-version" content="07.21.05.02"/>
4:<meta name="runtimecommon-version" content="07.21.05.02"/>
5:<meta name="copyright" content="Copyright (c) 2002-2018, Avaya"/>
6:<var name="_avayaExitReason" expr="''"/>
7:<var name="_avayaExitInfo1" expr="''"/>
8:<var name="_avayaExitInfo2" expr="''"/>
9:<var name="_avayaExitCustomerId" expr="''"/>
10:<var name="_avayaExitPreferredPath" expr="'1'"/>
11:<var name="_avayaExitTopic" expr="''"/>
12:<var name="_avayaExitParentId" expr="''"/>
13:<form id="back">
14:<block>
15:<var name="recordedMessageURL" expr="'http://172.27.48.18:7080/RecordMessage/data/temp/file_7789490909_3997736708193477387.wav'"/>
16:<var name="recordedMessageLength" expr="'2160'"/>
17:<exit namelist="recordedMessageURL recordedMessageLength _avayaExitReason _avayaExitInfo1 _avayaExitInfo2 _avayaExitCustomerId _avayaExitPreferredPath _avayaExitTopic _avayaExitParentId"/>
18:</block>
19:<catch event="connection.disconnect">
20: <exit namelist="recordedMessageURL recordedMessageLength _avayaExitReason _avayaExitInfo1 _avayaExitInfo2 _avayaExitCustomerId _avayaExitPreferredPath _avayaExitTopic _avayaExitParentId"/>
21:</catch>
22:<block>
23:</block>
24:</form>
25:</vxml>
But I didn't see any errors

What statement do you mean? Could you give an example please???
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You should've seen some error. I don't know why you didn't. But I ran the app and found some problem. You can replace the code in the CopyMessage.java file with the following (in between the two comment lines):


/* convert to a file object */
URI curLocURI = null;
curLocURI = new URI(curLoc.getStringValue());
String path = curLocURI.getPath();
String[] paths = path.split("/");

File sourceFile = new File(mySession.getAbsoluteTempFilePath(paths[paths.length - 1]));
System.out.println("*** Source Path " + sourceFile.getAbsolutePath());
System.out.println("*** File Name :" + sourceFile.getName());

/* get the dest path from the web.xml file */
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
I'm add your code to the java servlet. But it didn't work. That's all i see in log

15/10/2019 09:06:29 INFO - AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage : Using SCESession AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage servlet : CopyMessage
15/10/2019 09:06:29 INFO - AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage : Using SCESession AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage servlet : back
15/10/2019 09:06:29 DEBUG - AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage : *** Reply for [/RecordMessage/back] ***
15/10/2019 09:06:29 DEBUG - AE9DC57E3B719FDD2C9AEB85FDB53AA6:/RecordMessage : 0:<?xml version="1.0" encoding="UTF-8"?>
1:<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-us">
2:<meta name="author" content="Avaya Aura Orchestration Designer"/>
3:<meta name="runtime-version" content="07.21.05.02"/>
4:<meta name="runtimecommon-version" content="07.21.05.02"/>
5:<meta name="copyright" content="Copyright (c) 2002-2018, Avaya"/>
6:<var name="_avayaExitReason" expr="''"/>
7:<var name="_avayaExitInfo1" expr="''"/>
8:<var name="_avayaExitInfo2" expr="''"/>
9:<var name="_avayaExitCustomerId" expr="''"/>
10:<var name="_avayaExitPreferredPath" expr="'1'"/>
11:<var name="_avayaExitTopic" expr="''"/>
12:<var name="_avayaExitParentId" expr="''"/>
13:<form id="back">
14:<block>
15:<var name="recordedMessageURL" expr="'http://172.27.48.18:7080/RecordMessage/data/temp/file_78788_933971718759721559.wav'"/>
16:<var name="recordedMessageLength" expr="'1460'"/>
17:<exit namelist="recordedMessageURL recordedMessageLength _avayaExitReason _avayaExitInfo1 _avayaExitInfo2 _avayaExitCustomerId _avayaExitPreferredPath _avayaExitTopic _avayaExitParentId"/>
18:</block>
19:<catch event="connection.disconnect">
20: <exit namelist="recordedMessageURL recordedMessageLength _avayaExitReason _avayaExitInfo1 _avayaExitInfo2 _avayaExitCustomerId _avayaExitPreferredPath _avayaExitTopic _avayaExitParentId"/>
21:</catch>
22:<block>
23:</block>
24:</form>
25:</vxml>

Full log file i've attached
Filename trace.log [Disk] Download
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
There should be some logs or exceptions in the Tomcat/logs/systemout.log file. You need to take a look there.
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
I found only catalina.out logs
there are:
16/10/2019 08:26:15 INFO - B526CD9F644DA0E85D45E35C7FAFDFA3:/RecordMessage : Using SCESession B526CD9F644DA0E85D45E35C7FAFDFA3:/RecordMessage servlet : CopyMessage
16/10/2019 08:26:15 INFO - Node Entry | session id:cc-mpp1-2019289022602-6 | RecordMessage:CopyMessage | Framework | CopyMessage | | | 07777139521571192762
16/10/2019 08:26:15 INFO - B526CD9F644DA0E85D45E35C7FAFDFA3:/RecordMessage : Using SCESession B526CD9F644DA0E85D45E35C7FAFDFA3:/RecordMessage servlet : back
16/10/2019 08:26:15 INFO - Node Entry | session id:cc-mpp1-2019289022602-6 | RecordMessage:back | Framework | back | | | 07777139521571192762
16/10/2019 08:26:15 INFO - Module Exit | session id:cc-mpp1-2019289022602-6 | RecordMessage:back | Framework | Output Parameter | recordedMessageURL | http://172.27.48.18:7080/RecordMessage/data/temp/file_7781247100_4516599282471604774.wav | 07777139521571192762
16/10/2019 08:26:15 INFO - Module Exit | session id:cc-mpp1-2019289022602-6 | RecordMessage:back | Framework | Output Parameter | recordedMessageLength | 560 | 07777139521571192762
16/10/2019 08:26:15 INFO - Application Exit | session id:cc-mpp1-2019289022602-6 | RecordMessage:back | Framework | Application Exiting | | | 07777139521571192762
16/10/2019 08:26:15 DEBUG - B526CD9F644DA0E85D45E35C7FAFDFA3:/RecordMessage : *** Reply for [/RecordMessage/back] ***

I've attached full file
the time of call: 8:26:04

Filename catalina_out_logs.txt [Disk] Download
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
For some reason, your catalina log does not show any system or console log written by the code "System.out..." or the code didn't get executed at all. It should have written some line per the lines below. I was puzzling why you didn't see an exception before. It looks like the code didn't get executed. You would have to figure this out. Not sure how else I can help.

System.out.println("*** Source Path " + sourceFile.getAbsolutePath());
System.out.println("*** File Name :" + sourceFile.getName());
IvanIvanov3
Joined: Jan 23, 2019
Messages: 18
Offline
Could you say, what should i do for test code?
May be you have different advice what should i do with this app???
Go to:   
Mobile view