Skip to content

Commit fdf52c4

Browse files
Juntuchen/callback media (Azure#26860)
### Packages impacted by this PR ### Issues associated with this PR ### Describe the problem that is addressed by this PR ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
1 parent 673fa8b commit fdf52c4

File tree

6 files changed

+55
-3
lines changed

6 files changed

+55
-3
lines changed

sdk/communication/communication-call-automation/review/communication-call-automation.api.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ export interface CallMediaRecognizeDtmfOptions extends CallMediaRecognizeOptions
181181

182182
// @public
183183
export interface CallMediaRecognizeOptions extends OperationOptions {
184+
// (undocumented)
185+
callbackUrl?: string;
184186
// (undocumented)
185187
initialSilenceTimeoutInSeconds?: number;
186188
// (undocumented)
@@ -272,6 +274,7 @@ export interface Choice {
272274

273275
// @public
274276
export interface ContinuousDtmfRecognitionOptions extends OperationOptions {
277+
callbackUrl?: string;
275278
operationContext?: string;
276279
}
277280

@@ -494,9 +497,8 @@ export interface PlayFailed extends Omit<RestPlayFailed, "callConnectionId" | "s
494497

495498
// @public
496499
export interface PlayOptions extends OperationOptions {
497-
// (undocumented)
500+
callbackUrl?: string;
498501
loop?: boolean;
499-
// (undocumented)
500502
operationContext?: string;
501503
}
502504

@@ -866,6 +868,7 @@ export interface SendDtmfFailed extends Omit<RestSendDtmfFailed, "callConnection
866868

867869
// @public
868870
export interface SendDtmfOptions extends OperationOptions {
871+
callbackUrl?: string;
869872
operationContext?: string;
870873
}
871874

sdk/communication/communication-call-automation/src/callMedia.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export class CallMedia {
119119
loop: false,
120120
},
121121
operationContext: playOptions.operationContext,
122+
callbackUri: playOptions.callbackUrl,
122123
};
123124

124125
if (playOptions.loop !== undefined) {
@@ -145,6 +146,7 @@ export class CallMedia {
145146
loop: false,
146147
},
147148
operationContext: playOptions.operationContext,
149+
callbackUri: playOptions.callbackUrl,
148150
};
149151

150152
if (playOptions.loop !== undefined) {
@@ -187,6 +189,7 @@ export class CallMedia {
187189
interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
188190
recognizeOptions: recognizeOptionsInternal,
189191
operationContext: recognizeOptions.operationContext,
192+
callbackUri: recognizeOptions.callbackUrl,
190193
};
191194
} else if (recognizeOptions.kind === "callMediaRecognizeChoiceOptions") {
192195
const recognizeOptionsInternal: RecognizeOptions = {
@@ -205,6 +208,7 @@ export class CallMedia {
205208
interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
206209
recognizeOptions: recognizeOptionsInternal,
207210
operationContext: recognizeOptions.operationContext,
211+
callbackUri: recognizeOptions.callbackUrl,
208212
};
209213
} else if (recognizeOptions.kind === "callMediaRecognizeSpeechOptions") {
210214
const speechOptions: SpeechOptions = {
@@ -229,6 +233,7 @@ export class CallMedia {
229233
interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
230234
recognizeOptions: recognizeOptionsInternal,
231235
operationContext: recognizeOptions.operationContext,
236+
callbackUri: recognizeOptions.callbackUrl,
232237
};
233238
} else if (recognizeOptions.kind === "callMediaRecognizeSpeechOrDtmfOptions") {
234239
const dtmfOptionsInternal: DtmfOptions = {
@@ -261,6 +266,7 @@ export class CallMedia {
261266
interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,
262267
recognizeOptions: recognizeOptionsInternal,
263268
operationContext: recognizeOptions.operationContext,
269+
callbackUri: recognizeOptions.callbackUrl,
264270
};
265271
}
266272
throw new Error("Invalid recognizeOptions");
@@ -325,6 +331,7 @@ export class CallMedia {
325331
const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {
326332
targetParticipant: serializeCommunicationIdentifier(targetParticipant),
327333
operationContext: continuousDtmfRecognitionOptions.operationContext,
334+
callbackUri: continuousDtmfRecognitionOptions.callbackUrl,
328335
};
329336
return this.callMedia.stopContinuousDtmfRecognition(
330337
this.callConnectionId,
@@ -348,6 +355,7 @@ export class CallMedia {
348355
tones: tones,
349356
targetParticipant: serializeCommunicationIdentifier(targetParticipant),
350357
operationContext: sendDtmfOptions.operationContext,
358+
callbackUri: sendDtmfOptions.callbackUrl,
351359
};
352360
return this.callMedia.sendDtmf(this.callConnectionId, sendDtmfRequest, {});
353361
}

sdk/communication/communication-call-automation/src/generated/src/models/index.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/communication-call-automation/src/generated/src/models/mappers.ts

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/communication/communication-call-automation/src/models/options.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface CallMediaRecognizeOptions extends OperationOptions {
2828
interruptPrompt?: boolean;
2929
initialSilenceTimeoutInSeconds?: number;
3030
speechModelEndpointId?: string;
31+
callbackUrl?: string;
3132
}
3233

3334
/** The recognize configuration specific to Dtmf. */
@@ -164,8 +165,12 @@ export interface MuteParticipantsOption extends OperationOptions {
164165
* Options to play audio.
165166
*/
166167
export interface PlayOptions extends OperationOptions {
168+
/** Determine if it is looping */
167169
loop?: boolean;
170+
/** The value to identify context of the operation. */
168171
operationContext?: string;
172+
/** Call back URI override for this request */
173+
callbackUrl?: string;
169174
}
170175

171176
/**
@@ -253,6 +258,8 @@ export interface DownloadRecordingOptions extends OperationOptions {
253258
export interface ContinuousDtmfRecognitionOptions extends OperationOptions {
254259
/** The value to identify context of the operation. */
255260
operationContext?: string;
261+
/** Call back URI override for this request */
262+
callbackUrl?: string;
256263
}
257264

258265
/**
@@ -261,4 +268,6 @@ export interface ContinuousDtmfRecognitionOptions extends OperationOptions {
261268
export interface SendDtmfOptions extends OperationOptions {
262269
/** The value to identify context of the operation. */
263270
operationContext?: string;
271+
/** Call back URI override for this request */
272+
callbackUrl?: string;
264273
}

sdk/communication/communication-call-automation/swagger/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generate-metadata: false
1212
license-header: MICROSOFT_MIT_NO_VERSION
1313
output-folder: ../src/generated
1414
tag: V2023-01-15-preview
15-
input-file: https://github.com/williamzhao87/azure-rest-api-specs/blob/b496fbaf1cef0d9a8d31cfb11c3fc301d4c328ef/specification/communication/data-plane/CallAutomation/preview/2023-01-15-preview/communicationservicescallautomation.json
15+
input-file: https://github.com/williamzhao87/azure-rest-api-specs/blob/18fef29e753a6637d5639874ab20825003ae2077/specification/communication/data-plane/CallAutomation/preview/2023-01-15-preview/communicationservicescallautomation.json
1616
package-version: 1.0.0-beta.1
1717
model-date-time-as-string: false
1818
optional-response-headers: true

0 commit comments

Comments
 (0)