Author Message
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Hi

I am building an app using 7.2.3, to play an audio file until the response is not received from dialogflow side. I have followed the white paper document and found that app will receive the following payload as instruction


{
  "avaya_telephony": {
    "followup_event": {
      "name": "WaitStart",
      "parameters": {
        "Key1": "Value1",
        "Key2": "Value2",
        "ThirdKey": "Value3"
      }
    },
    "reply_audio_uri": "http://1.2.3.4/prompt/music.wav"
  }
}

I am able to receive this on the app but not understanding how to use in the OD app in order play the audio until the response of the followup event is not received. Can someone please let me know. It is urgent.

Thanks
Navneet
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I just made some changes to the attached DefaultDialogflowApp sample app for you to try. The changes are highlighted in the attached doc. Essentially, logic is added to get the event from the Dialogflow payload, play the audio as transitional audio. To play the audio from the uri coming from the payload, you have to make the phraseset load the phrase dynamically. The custom code is in the ps2.java. I have tested it fully. Please give it a try and I can help debug if there is any problem.
Filename DefaultDialogflowApp.zip [Disk] Download
Filename followupevent.docx [Disk] Download
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Hi Thanks for the response. I think you are referring to ps1.java instead of ps2.java as there is no ps2.java in app.

I am receiving the following payload:

"payload" : {
"avaya_telephony" : {
"reply_audio_uri" : "http://mauvecloud.net/sounds/pcm1608m.wav",
"followup_event" : {
"parameters" : {
"Key1" : "Value1",
"Key2" : "Value2",
"ThirdKey" : "Value3"
},
"name" : "continue_salescheck"
}
}
}

With reference to your app, the followup event here i.e. "continue_salescheck" is getting triggered but the transitional audio is not getting played even though it enter the "PlayTransAudio" node.
I have tried using the phrasevariable also by giving it type "audioURL" . Also placed the phrase locally and used phrase set. But still not able to play it.

Though the audio gets played when we use the def_dialogflow.vxml that is there on mpp


Any suggestions.

Thanks
Navneet
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Can you show me the vxml in the OD trace.log?
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Sure i will share the vxml.

One clarification, phrase variable should also work in transitional prompt. Right? By using type as AudioURL and assigning the variable that contains the url received as shown in the payload above
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Yes, if you have a local phrase instead of one determined dynamically.
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
The vxml that is generated for PlatTransAudio node is:

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.23.08.01.p1"/> ?
4:<meta name="runtimecommon-version" content="07.22.10.04"/> ?
5:<meta name="copyright" content="Copyright (c) 2002-2019, Avaya"/> ?
6:<form id="PlayTransAudio"> ?
7:<property name="fetchaudio" value="http://mauvecloud.net/sounds/pcm1608m.wav" /> ?
8:<catch event="connection.disconnect"> ?
9:<goto next="AvayaDefaultDisconnectHandler?___DDSESSIONID=79C2498166787D46BEEB367D7918AB7C%3A%2FScheduleDelivery"/> ?
10:</catch> ?
11:<block> ?
12:<submit next="SetEventProps?___DDSESSIONID=79C2498166787D46BEEB367D7918AB7C%3A%2FScheduleDelivery"/> ?
13:</block> ?
14:</form> ?
15:</vxml> ?



I saw the vxml specification, it says that " If an error occurs retrieving fetchaudio from its URI, no badfetch event is thrown and no audio is played during the fetch." How can I be sure that this problem is not occurring.? Also I tried using the local phrase set that are not getting played also though they get played when i use normal prompts.


Thanks
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Forgot to add the below finding on the above comment:

It only worked when I set the "minimum play seconds" property of transitional prompt. If not specified I cannot hear it
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The vxml looks OK. It should at least play the audio once without the minimum. So after setting the minimum, does it work as expected?
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Yes. I think there is some silence in the audio at the start due to which I was not able to hear it. What is the minimum duration for which it will play if I don't specify minimum?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The audio only plays until the next fetch is done. That means once the EventPrompt node/vxml is loaded the audio is done. Hmm, that brings up the question whether the transition audio element is in the right place. I would need to refer back to the def_dialogflow vxml app on MPP to see where exactly this should be placed.
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Yes. Please let me know as soon as possible. As the audio should be played until the response of the event is not received.

One more query I have for the same application.

Will removing the below classes have any affect on the functionality? I have to remove the unused code. I am not using any SMS feature in my application

DisplayChatdata.java
FormSMSMsg.java
GetChatData.java
GetFirstChatQuestion.java
SendSMS.java

Thanks
Navneet kaur
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Yes, you can just delete those files.
With the vxml app I got, I don't see any special code that makes audio repeat itself in an Input form such as the EventPrompt, and I don't know how that could possible work within a vxml form. I think instead of using the fetchaudio property, it just plays a regular prompt that can be barged in. You can try to change the PlayTransAudio node to use a regular prompt instead.
TCSLtd
Joined: Sep 11, 2019
Messages: 69
Offline
Is there any way the audio file can play again from start if it reached the end but the response is not received. I mean repeating the prompt continuosly ?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I don't know of any. If there is, it should be in the def_dialogflow vxml app directory $MPP/web/misc/dialogflowapp/prompts
Go to:   
Mobile view