Skip to content

Commit c33f657

Browse files
authored
Update recognize-ai-action-how-to-java.md
add max timeout for choices and remove event schemas
1 parent 6dec434 commit c33f657

File tree

1 file changed

+1
-146
lines changed

1 file changed

+1
-146
lines changed

articles/communication-services/how-tos/call-automation/includes/recognize-ai-action-how-to-java.md

Lines changed: 1 addition & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The following parameters are available to customize the Recognize function:
3030
| InterToneTimeout | TimeSpan | 2 seconds <br/><br/>**Min:** 1 second <br/>**Max:** 60 seconds | Limit in seconds that ACS will wait for the caller to press another digit (inter-digit timeout). | Optional |
3131
| InitialSegmentationSilenceTimeoutInSeconds | Integer | 0.5 seconds | How long recognize action will wait for input before considering it a timeout. [Read more here](../../../../../articles/cognitive-services/Speech-Service/how-to-recognize-speech.md). | Optional |
3232
| RecognizeInputsType | Enum | dtmf | Type of input that will be recognized. Options will be dtmf and choices. | Required |
33-
| InitialSilenceTimeout | TimeSpan | 5 seconds<br/><br/>**Min:** 0 seconds <br/>**Max:** 300 seconds | Initial silence timeout adjusts how much non-speech audio is allowed before a phrase before the recognition attempt ends in a "no match" result. [Read more here](../../../../../articles/cognitive-services/Speech-Service/how-to-recognize-speech.md). | Optional |
33+
| InitialSilenceTimeout | TimeSpan | 5 seconds<br/><br/>**Min:** 0 seconds <br/>**Max:** 300 seconds (DTMF) <br/>**Max:** 20 seconds (Choices)| Initial silence timeout adjusts how much non-speech audio is allowed before a phrase before the recognition attempt ends in a "no match" result. [Read more here](../../../../../articles/cognitive-services/Speech-Service/how-to-recognize-speech.md). | Optional |
3434
| MaxTonesToCollect | Integer | No default<br/><br/>**Min:** 1|Number of digits a developer expects as input from the participant.| Required |
3535
| StopTones |IEnumeration\<DtmfTone\> | Not set | The digit participants can press to escape out of a batch DTMF event. | Optional |
3636
| InterruptPrompt | Bool | True | If the participant has the ability to interrupt the playMessage by pressing a digit. | Optional |
@@ -143,74 +143,6 @@ Logger.logMessage(
143143
144144
Developers can subscribe to *RecognizeCompleted* and *RecognizeFailed* events on the webhook callback they registered for the call to create business logic in their application for determining next steps when one of the aforementioned events occurs.
145145
146-
### Example of DTMF *RecognizeCompleted* event:
147-
``` json
148-
[
149-
{
150-
"id": "e9cf1c71-f119-48db-86ca-4f2530a2004d",
151-
"source": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted",
152-
"type": "Microsoft.Communication.RecognizeCompleted",
153-
"data": {
154-
"eventSource": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted",
155-
"operationContext": "267e33a9-c28e-4ecf-a33e-b3abd9526e32",
156-
"resultInformation": {
157-
"code": 200,
158-
"subCode": 8531,
159-
"message": "Action completed, max digits received."
160-
},
161-
"recognitionType": "dtmf",
162-
"collectTonesResult": {
163-
"tones": [
164-
"nine",
165-
"eight",
166-
"zero",
167-
"five",
168-
"two"
169-
]
170-
},
171-
"callConnectionId": "411f0b00-d97f-49ad-a6ff-3f8c05dc64d7",
172-
"serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEyLTAxLmNvbnYuc2t5cGUuY29tL2NvbnYvQzNuT3lkY3E0VTZCV0gtcG1GNmc1Zz9pPTQmZT02Mzc5ODYwMDMzNDQ2MTA5MzM=",
173-
"correlationId": "53be6977-d832-4c42-8527-fb2aa4a78b74"
174-
},
175-
"time": "2022-09-13T00:55:08.2240104+00:00",
176-
"specversion": "1.0",
177-
"datacontenttype": "application/json",
178-
"subject": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted"
179-
}
180-
]
181-
```
182-
183-
### Example of Choices *RecognizeCompleted* event:
184-
``` json
185-
[
186-
{
187-
"id": "cf41d1b3-663d-45ab-94d6-7ff130f41839",
188-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
189-
"type": "Microsoft.Communication.RecognizeCompleted",
190-
"data": {
191-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
192-
"operationContext": "ReminderMenu",
193-
"resultInformation": {
194-
"code": 200,
195-
"subCode": 8545,
196-
"message": "Action completed, Recognized phrase matches a valid option."
197-
},
198-
"recognitionType": "choices",
199-
"choiceResult": {
200-
"label": "Confirm",
201-
"recognizedPhrase": "confirm"
202-
},
203-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
204-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGerteeqwertrtertsdfrYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNk1VxTjNtajc5M2w2eXc/aTyJmU9N45dfg4MDg5MDEyOTMyODg1OTY5",
205-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
206-
},
207-
"time": "2023-01-10T00:28:56.7369845+00:00",
208-
"specversion": "1.0",
209-
"datacontenttype": "application/json",
210-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
211-
}
212-
]
213-
```
214146
### Example of how you can deserialize the *RecognizeCompleted* event:
215147
``` java
216148
if (callEvent instanceof RecognizeCompleted) {
@@ -232,61 +164,6 @@ if (callEvent instanceof RecognizeCompleted) {
232164
}
233165
```
234166
235-
236-
### Example of DTMF *RecognizeFailed* event:
237-
``` json
238-
[
239-
{
240-
"id": "47d9cb04-7039-427b-af50-aebdd94db054",
241-
"source": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed",
242-
"type": "Microsoft.Communication.RecognizeFailed",
243-
"data": {
244-
"eventSource": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed",
245-
"operationContext": "267e33a9-c28e-4ecf-a33e-b3abd9526e32",
246-
"resultInformation": {
247-
"code": 500,
248-
"subCode": 8511,
249-
"message": "Action failed, encountered failure while trying to play the prompt."
250-
},
251-
"callConnectionId": "411f0b00-bb72-4d5b-9524-ae1c29713335",
252-
"serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEyLTAxLmNvbnYuc2t5cGUuY29tL2NvbnYvQzNuT3lkY3E0VTZCV0gtcG1GNmc1Zz9pPTQmZT02Mzc5ODYwMDMzNDQ2MTA5MzM=",
253-
"correlationId": "53be6977-d832-4c42-8527-fb2aa4a78b74"
254-
},
255-
"time": "2022-09-13T00:55:37.0660233+00:00",
256-
"specversion": "1.0",
257-
"datacontenttype": "application/json",
258-
"subject": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed"
259-
}
260-
]
261-
```
262-
263-
### Example of Choices *RecognizeFailed* event:
264-
``` json
265-
[
266-
{
267-
"id": "264be623-5915-415e-bf06-2165e3fa0a08",
268-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
269-
"type": "Microsoft.Communication.RecognizeFailed",
270-
"data": {
271-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
272-
"operationContext": "AppointmentChoiceMenu",
273-
"resultInformation": {
274-
"code": 400,
275-
"subCode": 8547,
276-
"message": "Action failed, recognized phrase does not match a valid option."
277-
},
278-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
279-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGkvdjIvY3AvY29udi1kZXYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNkJYU1VxTjNtajc5M2w2eXc/aT0yJmU9NjM4MDg5MDEyOTMyODg1OTY5",
280-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
281-
},
282-
"time": "2023-01-10T00:29:30.300373+00:00",
283-
"specversion": "1.0",
284-
"datacontenttype": "application/json",
285-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
286-
}
287-
]
288-
```
289-
290167
### Example of how you can deserialize the *RecognizeFailed* event:
291168
``` java
292169
if (callEvent instanceof RecognizeFailed) {
@@ -313,28 +190,6 @@ if (callEvent instanceof RecognizeFailed) {
313190
}
314191
```
315192
316-
### Example of *RecognizeCanceled* event:
317-
``` json
318-
[
319-
{
320-
"id": "d4f2e476-fb8f-43c2-abf8-0981f8e70df9",
321-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
322-
"type": "Microsoft.Communication.RecognizeCanceled",
323-
"data": {
324-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
325-
"operationContext": "AppointmentChoiceMenu",
326-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
327-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGkvdjIvY3AvY29udi1kZXYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNkJYU1VxTjNtajc5M2w2eXc/aT0yJmU9NjM4MDg5MDEyOTMyODg1OTY5",
328-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
329-
},
330-
"time": "2023-01-10T00:31:15.3606572+00:00",
331-
"specversion": "1.0",
332-
"datacontenttype": "application/json",
333-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
334-
}
335-
]
336-
```
337-
338193
### Example of how you can deserialize the *RecognizeCanceled* event:
339194
``` java
340195
if (callEvent instanceof RecognizeCanceled) {

0 commit comments

Comments
 (0)