Skip to content

Commit 6dec434

Browse files
authored
Update recognize-ai-action-how-to-csharp.md
add max silence time for voice, remove events for recognize completed/failed and canceled
1 parent 6bce740 commit 6dec434

File tree

1 file changed

+1
-145
lines changed

1 file changed

+1
-145
lines changed

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

Lines changed: 1 addition & 145 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 |
@@ -128,74 +128,6 @@ var targetParticipant = new PhoneNumberIdentifier("+1XXXXXXXXXXX");
128128

129129
Developers can subscribe to the *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 previously mentioned events occurs.
130130

131-
### Example of DTMF *RecognizeCompleted* event:
132-
``` json
133-
[
134-
{
135-
"id": "e9cf1c71-f119-48db-86ca-4f2530a2004d",
136-
"source": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted",
137-
"type": "Microsoft.Communication.RecognizeCompleted",
138-
"data": {
139-
"eventSource": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted",
140-
"operationContext": "267e33a9-c28e-4ecf-a33e-b3abd9526e32",
141-
"resultInformation": {
142-
"code": 200,
143-
"subCode": 8531,
144-
"message": "Action completed, max digits received."
145-
},
146-
"recognitionType": "dtmf",
147-
"collectTonesResult": {
148-
"tones": [
149-
"nine",
150-
"eight",
151-
"zero",
152-
"five",
153-
"two"
154-
]
155-
},
156-
"callConnectionId": "411f0b00-d97f-49ad-a6ff-3f8c05dc64d7",
157-
"serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEyLTAxLmNvbnYuc2t5cGUuY29tL2NvbnYvQzNuT3lkY3E0VTZCV0gtcG1GNmc1Zz9pPTQmZT02Mzc5ODYwMDMzNDQ2MTA5MzM=",
158-
"correlationId": "53be6977-d832-4c42-8527-fb2aa4a78b74"
159-
},
160-
"time": "2022-09-13T00:55:08.2240104+00:00",
161-
"specversion": "1.0",
162-
"datacontenttype": "application/json",
163-
"subject": "calling/callConnections/411f0b00-d97f-49ad-a6ff-3f8c05dc64d7/RecognizeCompleted"
164-
}
165-
]
166-
```
167-
### Example of Choices *RecognizeCompleted* event:
168-
``` json
169-
[
170-
{
171-
"id": "cf41d1b3-663d-45ab-94d6-7ff130f41839",
172-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
173-
"type": "Microsoft.Communication.RecognizeCompleted",
174-
"data": {
175-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
176-
"operationContext": "AppointmentReminderMenu",
177-
"resultInformation": {
178-
"code": 200,
179-
"subCode": 8545,
180-
"message": "Action completed, Recognized phrase matches a valid option."
181-
},
182-
"recognitionType": "choices",
183-
"choiceResult": {
184-
"label": "Confirm",
185-
"recognizedPhrase": "confirm"
186-
},
187-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
188-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGerteeqwertrtertsdfrYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNk1VxTjNtajc5M2w2eXc/aTyJmU9N45dfg4MDg5MDEyOTMyODg1OTY5",
189-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
190-
},
191-
"time": "2023-01-10T00:28:56.7369845+00:00",
192-
"specversion": "1.0",
193-
"datacontenttype": "application/json",
194-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
195-
}
196-
]
197-
```
198-
199131
### Example of how you can deserialize the *RecognizeCompleted* event:
200132
``` csharp
201133
if (@event is RecognizeCompleted { OperationContext: "AppointmentReminderMenu" })
@@ -225,60 +157,6 @@ Developers can subscribe to the *RecognizeCompleted* and *RecognizeFailed* event
225157
}
226158
```
227159

228-
### Example of DTMF *RecognizeFailed* event:
229-
``` json
230-
[
231-
{
232-
"id": "47d9cb04-7039-427b-af50-aebdd94db054",
233-
"source": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed",
234-
"type": "Microsoft.Communication.RecognizeFailed",
235-
"data": {
236-
"eventSource": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed",
237-
"operationContext": "267e33a9-c28e-4ecf-a33e-b3abd9526e32",
238-
"resultInformation": {
239-
"code": 500,
240-
"subCode": 8511,
241-
"message": "Action failed, encountered failure while trying to play the prompt."
242-
},
243-
"callConnectionId": "411f0b00-bb72-4d5b-9524-ae1c29713335",
244-
"serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzZWEyLTAxLmNvbnYuc2t5cGUuY29tL2NvbnYvQzNuT3lkY3E0VTZCV0gtcG1GNmc1Zz9pPTQmZT02Mzc5ODYwMDMzNDQ2MTA5MzM=",
245-
"correlationId": "53be6977-d832-4c42-8527-fb2aa4a78b74"
246-
},
247-
"time": "2022-09-13T00:55:37.0660233+00:00",
248-
"specversion": "1.0",
249-
"datacontenttype": "application/json",
250-
"subject": "calling/callConnections/411f0b00-bb72-4d5b-9524-ae1c29713335/RecognizeFailed"
251-
}
252-
]
253-
```
254-
255-
### Example of Choices *RecognizeFailed* event:
256-
``` json
257-
[
258-
{
259-
"id": "264be623-5915-415e-bf06-2165e3fa0a08",
260-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
261-
"type": "Microsoft.Communication.RecognizeFailed",
262-
"data": {
263-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
264-
"operationContext": "AppointmentReminderMenu",
265-
"resultInformation": {
266-
"code": 400,
267-
"subCode": 8547,
268-
"message": "Action failed, recognized phrase does not match a valid option."
269-
},
270-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
271-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGkvdjIvY3AvY29udi1kZXYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNkJYU1VxTjNtajc5M2w2eXc/aT0yJmU9NjM4MDg5MDEyOTMyODg1OTY5",
272-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
273-
},
274-
"time": "2023-01-10T00:29:30.300373+00:00",
275-
"specversion": "1.0",
276-
"datacontenttype": "application/json",
277-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
278-
}
279-
]
280-
```
281-
282160
### Example of how you can deserialize the *RecognizeFailed* event:
283161
``` csharp
284162
if (@event is RecognizeFailed { OperationContext: "AppointmentReminderMenu" })
@@ -308,28 +186,6 @@ if (@event is RecognizeFailed { OperationContext: "AppointmentReminderMenu" })
308186
}
309187
```
310188

311-
### Example of *RecognizeCanceled* event:
312-
``` json
313-
[
314-
{
315-
"id": "d4f2e476-fb8f-43c2-abf8-0981f8e70df9",
316-
"source": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
317-
"type": "Microsoft.Communication.RecognizeCanceled",
318-
"data": {
319-
"eventSource": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41",
320-
"operationContext": "AppointmentChoiceMenu",
321-
"callConnectionId": "411f7000-1831-48f7-95f3-b8ee7470dd41",
322-
"serverCallId": "aHR0cHM6Ly9hcGkuZXAtZGV2LnNreXBlLm5ldC9hcGkvdjIvY3AvY29udi1kZXYtMjAwLmNvbnYtZGV2LnNreXBlLm5ldC9jb252L3dIMTZkNkJYU1VxTjNtajc5M2w2eXc/aT0yJmU9NjM4MDg5MDEyOTMyODg1OTY5",
323-
"correlationId": "0f40d4ea-2e26-412a-ad43-171411927bf3"
324-
},
325-
"time": "2023-01-10T00:31:15.3606572+00:00",
326-
"specversion": "1.0",
327-
"datacontenttype": "application/json",
328-
"subject": "calling/callConnections/411f7000-1831-48f7-95f3-b8ee7470dd41"
329-
}
330-
]
331-
```
332-
333189
### Example of how you can deserialize the *RecognizeCanceled* event:
334190
``` csharp
335191
if (@event is RecognizeCanceled { OperationContext: "AppointmentReminderMenu" })

0 commit comments

Comments
 (0)