@@ -70,10 +70,12 @@ var sendDtmfAsyncResult = await callAutomationClient.GetCallConnection(c
70
70
### [Java](#tab/java)
71
71
` ` ` java
72
72
List< DtmfTone> tones = Arrays .asList (DtmfTone .ONE , DtmfTone .TWO , DtmfTone .THREE , DtmfTone .POUND );
73
+ SendDtmfTonesOptions options = new SendDtmfTonesOptions (tones, new PhoneNumberIdentifier (c2Target));
74
+ options .setOperationContext (" dtmfs-to-ivr" );
73
75
callAutomationClient .getCallConnectionAsync (callConnectionId)
74
- .getCallMediaAsync ()
75
- .sendDtmfTonesWithResponse (tones, new PhoneNumberIdentifier (c2Target), " dtmfs-to-ivr " )
76
- .block ();
76
+ .getCallMediaAsync ()
77
+ .sendDtmfTonesWithResponse (options )
78
+ .block ();
77
79
` ` `
78
80
### [JavaScript](#tab/javascript)
79
81
` ` ` javascript
@@ -171,10 +173,12 @@ await callAutomationClient.GetCallConnection(callConnectionId)
171
173
` ` `
172
174
### [Java](#tab/java)
173
175
` ` ` java
176
+ ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions (new PhoneNumberIdentifier (c2Target));
177
+ options .setOperationContext (" dtmf-reco-on-c2" );
174
178
callAutomationClient .getCallConnectionAsync (callConnectionId)
175
- .getCallMediaAsync ()
176
- .startContinuousDtmfRecognitionWithResponse (new PhoneNumberIdentifier (c2Target), " dtmf-reco-on-c2 " )
177
- .block ();
179
+ .getCallMediaAsync ()
180
+ .startContinuousDtmfRecognitionWithResponse (options )
181
+ .block ();
178
182
` ` `
179
183
### [JavaScript](#tab/javascript)
180
184
` ` ` javascript
@@ -212,17 +216,17 @@ var continuousDtmfRecognitionOptions = new ContinuousDtmfRecognitionOpti
212
216
};
213
217
214
218
var startContinuousDtmfRecognitionAsyncResult = await callAutomationClient .GetCallConnection (callConnectionId)
215
-
216
219
.GetCallMedia ()
217
-
218
220
.StartContinuousDtmfRecognitionAsync (continuousDtmfRecognitionOptions);
219
221
` ` `
220
222
### [Java](#tab/java)
221
223
` ` ` java
224
+ ContinuousDtmfRecognitionOptions options = new ContinuousDtmfRecognitionOptions (new PhoneNumberIdentifier (c2Target));
225
+ options .setOperationContext (" dtmf-reco-on-c2" );
222
226
callAutomationClient .getCallConnectionAsync (callConnectionId)
223
- .getCallMediaAsync ()
224
- .stopContinuousDtmfRecognitionWithResponse (new PhoneNumberIdentifier (c2Target), " dtmf-reco-on-c2 " )
225
- .block ();
227
+ .getCallMediaAsync ()
228
+ .stopContinuousDtmfRecognitionWithResponse (options )
229
+ .block ();
226
230
` ` `
227
231
### [JavaScript](#tab/javascript)
228
232
` ` ` javascript
@@ -260,30 +264,29 @@ if (acsEvent is ContinuousDtmfRecognitionToneReceived continuousDtmfReco
260
264
` ` `
261
265
### [Java](#tab/java)
262
266
` ` ` java
263
- if (acsEvent instanceof ContinuousDtmfRecognitionToneReceived) {
264
- ContinuousDtmfRecognitionToneReceived event = (ContinuousDtmfRecognitionToneReceived) acsEvent;
265
- log .info (" Tone detected: sequenceId=" + event . getToneInfo () .getSequenceId ()
266
- + " , tone=" + event . getToneInfo () .getTone ().convertToString ()
267
- + " , context=" + event .getOperationContext ());
267
+ if (acsEvent instanceof ContinuousDtmfRecognitionToneReceived) {
268
+ ContinuousDtmfRecognitionToneReceived event = (ContinuousDtmfRecognitionToneReceived) acsEvent;
269
+ log .info (" Tone detected: sequenceId=" + event .getSequenceId ()
270
+ + " , tone=" + event .getTone ().convertToString ()
271
+ + " , context=" + event .getOperationContext ());
268
272
}
269
273
` ` `
270
274
### [JavaScript](#tab/javascript)
271
275
` ` ` javascript
272
- if (event .type === " Microsoft.Communication.ContinuousDtmfRecognitionToneReceived" ) {
273
- console .log (" Tone detected: sequenceId=%s, tone=%s, context=%s" ,
274
- eventData .toneInfo .sequenceId ,
275
- eventData .toneInfo .tone ,
276
- eventData .operationContext );
277
-
278
- }
276
+ if (event .type === " Microsoft.Communication.ContinuousDtmfRecognitionToneReceived" ) {
277
+ console .log (" Tone detected: sequenceId=%s, tone=%s, context=%s" ,
278
+ eventData .sequenceId ,
279
+ eventData .tone ,
280
+ eventData .operationContext );
281
+ }
279
282
` ` `
280
283
### [Python](#tab/python)
281
284
` ` ` python
282
- if event .type == " Microsoft.Communication.ContinuousDtmfRecognitionToneReceived" :
283
- app .logger .info (" Tone detected: sequenceId=%s, tone=%s, context=%s" ,
284
- event .data [' toneInfo ' ][ ' sequenceId' ],
285
- event .data [' toneInfo ' ][ ' tone' ],
286
- event .data [' operationContext' ])
285
+ if event .type == " Microsoft.Communication.ContinuousDtmfRecognitionToneReceived" :
286
+ app .logger .info (" Tone detected: sequenceId=%s, tone=%s, context=%s" ,
287
+ event .data [' sequenceId' ],
288
+ event .data [' tone' ],
289
+ event .data [' operationContext' ])
287
290
` ` `
288
291
-----
289
292
0 commit comments