Author Message
qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
Thanks Bob.

I create a file as voice.vxml on my http server and this time AMS error saying "Invalid document structure".
I tried to write sample simple lines in vxml format, but AMS error saying "Unknown element 'vxml'".
Do I need to create a vxml file manually and write in a specific format?


(05-12 15:46:53.957)<I,Interp,95214448,90ce9579-5646-38db-b788-0bfd04884b8b> (40)8000|com.avaya.vxi|DocumentParser::FetchDocument - Parse error in file "https://135.9.39.61/services/NotifyMeRecordService/resources/voice.vxml", line 1, column 1 - Invalid document structure
(05-12 15:46:53.957)<I,Interp,95214448,90ce9579-5646-38db-b788-0bfd04884b8b> (40)|com.avaya.OSBlog|308||

(05-12 15:46:53.957)<I,Interp,95214448,90ce9579-5646-38db-b788-0bfd04884b8b> (40)|com.avaya.vxi|990||URL=https://135.9.39.61/services/NotifyMeRecordService/resources/voice.vxml

(05-12 15:46:53.957)<I,Interp,95214448,90ce9579-5646-38db-b788-0bfd04884b8b> (40)|com.avaya.vxi|205||URL=https://135.9.39.61/services/NotifyMeRecordService/resources/voice.vxml

(05-12 15:46:53.957)<I,Interp,95214448,90ce9579-5646-38db-b788-0bfd04884b8b> (40)|com.avaya.vxi|999||message=fail to prepare document|URL=https://135.9.39.61/services/NotifyMeRecordService/resources/voice.vxml

Regards,
Qian
BobBraudes
Joined: Dec 19, 2013
Messages: 34
Offline
Hi Qain,

I'm glad to hear you are making progress. The media server should accept standard VoiceXML, plus some extensions, so it sounds like you may have some syntax errors. Do you have another VXML interpreter you can use to validate the generated script?

Thanks,
Bob.
qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
Hi,

Is there any sample for me to learn how voiceXML worked in EDP?
All samples I can found in EDP API have only JAVA code, no voiceXML sample code.

I am even not clear how to assign a path for AMS to save those .wav files in voiceXML script.

Thanks,
Qian

qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
Hi,

Here is my VoiceXML script:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="play0">
<record name="R_1" beep="true" dtmfterm="true" finalsilence="5s" maxtime="100s">
<prompt>
Here you will hear a beep indicating
that you should start your recording.
</prompt>
</record>
</form>
</vxml>


and here is some of the AMS log:

==========Data Start==========
(05-13 13:53:22.544)<I,Plat,main,00000000-0000-0000-0000-000000000000>
Dialog.Start:( private:( callid:"2b9b0f35-32b9-3f04-8e80-3826de02d461" url:(0:"https://135.9.39.61/services/NotifyMeRecordService/resources/voice.vxml" )
defpath:"file:///opt/avaya/app/amsinst/ma/MAS/platdata/CStore/StorageRoot/n-1408721378-4/defaults-gen-1/"))
==========Data End ==========

Also the log said "Fail request since no resource attached" in AMS.

Is the defpath that AMS will save .wav files in? how can I modified this path to our http server ?

Appreciate for any help.

Qian
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
Hi Qian,

Please see attached CollectDigits.jsp example which produces a vxml. The JSP allows the VXML to be dynamic in that request parameters can be passed and vxml is generated on the fly. This sample demonstrates prompt with collect digits and it's been validated on EDP.

In regards to <record> element, you can store the wav file to your preferred location by submitting the vxml form using POST method, multipart form data to your preferred endpoint (e.g Servlet, REST interface). You can find an example on this site: http://www.w3.org/TR/voicexml20/#dml2.3.6

I'm attaching it here for your convenience. See submit tag.. this is where you will define endpoint which will be responsible for saving the file.

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/voicexml20/vxml.xsd">
<form>
<property name="bargein" value="true"/>
<block>
<prompt>
Riley is not available to take your call.
</prompt>
</block>
<record name="msg" beep="true" maxtime="10s"
finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">
<prompt timeout="5s">
Record a message after the beep.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>

<field name="confirm">
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
<prompt>
Your message is <audio expr="msg"/>.
</prompt>
<prompt>
To keep it, say yes. To discard it, say no.
</prompt>
<filled>
<if cond="confirm">
<submit next="save_message.pl" enctype="multipart/form-data"
method="post" namelist="msg"/>
</if>
<clear/>
</filled>
</field>
</form>
</vxml>
Filename CollectDigits.jsp [Disk] Download

Dipesh Gandhi Software Engineer, Avaya DevConnect
qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
Thanks all.

Now we can use voiceXML for recording and sending the audio file to other servers.

It is strange that sometime when I change the "type" value for the "record" tag in voiceXML, AMS will throw an "unsupported.format" error. But several munutes after(20 minutes longer), there is no error. No code changes.

<record name="msg" beep="true" maxtime="20s" finalsilence="4000ms" dtmfterm="true" type="audio/wav">
I switch the "type" value among "audio/basic", "audio/wav" and "audio/x-wav";

Does anybody know details about the voiceXML part in AMS? Is there a delay for this switch of audio types?


Regards,
Qian
BobBraudes
Joined: Dec 19, 2013
Messages: 34
Offline
Hi Qian,

First, I am happy to hear that things are working - congratulations!

With regard to the delay in refresh, that is almost certainly due to the file being cached (and I am assuming you are reusing the same file name - if not please let me know). Here is the response I received from the AMS team when I asked them about both the format and the cache refresh interval:



For <record> the type must be "audio/x-wav". AMS will cache pages, which is based on the HTTP headers returned by the application and/or web server.



Thanks,
Bob
qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
Thanks for the information Bob!

How can we associate the call which makes record with the recorded wav file?

we have a callID for each call and a fileID for each recorded wav file.
But it seems I cannot locate the call object or any other identifier (like mediaID, vxmlRequestID) in the JSP file, which I use for receive data from voiceXML and save them. In this case, I cannot connect the callID with the fileID together.







liu159
Joined: Jan 19, 2015
Messages: 96
Offline
It seems that all calls use the same voiceXML.

If we have multiple calls trying to record audio files. How do we determine which audio file belongs to which call ? How can we assign the callId to the corresponding audio file (we want to use callId as the file name, how to pass it to voiceXML) ?
qqiao
Joined: Jan 14, 2015
Messages: 24
Offline
-- Update Solution --

Using URL parameter to parse the callId to voiceXML script, i.e. https://135.9.39.61/services/NotifyMeRecordService/resources/voice.jsp?callId=callId

In the voice.jsp, get the parameter by request.getParameter(“callId”), assign it to a variable by expr="'<%=callId%>'".

Then this variable can be submitted together with the record file.

Thanks for all help.
Go to:   
Mobile view