Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { TransferProgressEvent } from '@azure/core-http';

// @public
export interface AddParticipantOptions extends OperationOptions {
alternateCallerId?: string;
alternateCallerId?: PhoneNumberIdentifier;
operationContext?: string;
}

Expand Down Expand Up @@ -395,7 +395,7 @@ export interface TransferToCallOptions extends OperationOptions {

// @public
export interface TransferToParticipantOptions extends OperationOptions {
alternateCallerId?: string;
alternateCallerId?: PhoneNumberIdentifier;
operationContext?: string;
userToUserInformation?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,11 @@ export class CallConnectionImpl implements CallConnection {
operationOptions
);
const alternateCallerId =
typeof restOptions?.alternateCallerId === "undefined"
? restOptions?.alternateCallerId
: serializeCommunicationIdentifier({ phoneNumber: restOptions.alternateCallerId })
.phoneNumber;
restOptions.alternateCallerId == null
? undefined
: serializeCommunicationIdentifier({
phoneNumber: restOptions.alternateCallerId.phoneNumber
}).phoneNumber;

const request: AddParticipantRequest = {
participant: serializeCommunicationIdentifier(participant),
Expand Down Expand Up @@ -762,10 +763,11 @@ export class CallConnectionImpl implements CallConnection {
);

const alternateCallerId =
typeof restOptions?.alternateCallerId === "undefined"
? restOptions?.alternateCallerId
: serializeCommunicationIdentifier({ phoneNumber: restOptions.alternateCallerId })
.phoneNumber;
restOptions.alternateCallerId == null
? undefined
: serializeCommunicationIdentifier({
phoneNumber: restOptions.alternateCallerId.phoneNumber
}).phoneNumber;

const request: TransferToParticipantRequest = {
targetParticipant: serializeCommunicationIdentifier(targetParticipant),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,20 @@ export class CallingServerClient {
operationOptions
);

const alternateCallerId =
restOptions.alternateCallerId == null
? undefined
: serializeCommunicationIdentifier({
phoneNumber: restOptions.alternateCallerId.phoneNumber
}).phoneNumber;

const request: CreateCallRequest = {
source: serializeCommunicationIdentifier(source),
targets: targets.map((m) => serializeCommunicationIdentifier(m)),
callbackUri: restOptions.callbackUrl,
requestedMediaTypes: restOptions.requestedMediaTypes,
requestedCallEvents: restOptions.requestedCallEvents,
alternateCallerId:
restOptions.alternateCallerId == null
? undefined
: { value: restOptions.alternateCallerId.phoneNumber },
subject: restOptions.subject
alternateCallerId: alternateCallerId
};

try {
Expand Down Expand Up @@ -379,16 +382,17 @@ export class CallingServerClient {
"ServerCallRestClient-AddParticipant",
operationOptions
);
const alternate_caller_id =
typeof restOptions?.alternateCallerId === "undefined"
? restOptions?.alternateCallerId
: serializeCommunicationIdentifier({ phoneNumber: restOptions.alternateCallerId })
.phoneNumber;
const alternateCallerId =
restOptions.alternateCallerId == null
? undefined
: serializeCommunicationIdentifier({
phoneNumber: restOptions.alternateCallerId.phoneNumber
}).phoneNumber;

const request: AddParticipantWithCallLocatorRequest = {
callLocator: callLocator,
participant: serializeCommunicationIdentifier(participant),
alternateCallerId: alternate_caller_id,
alternateCallerId: alternateCallerId,
operationContext: restOptions?.operationContext,
callbackUri: callbackUrl
};
Expand Down
6 changes: 3 additions & 3 deletions sdk/communication/communication-calling-server/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface PlayAudioOptions extends OperationOptions {
*/
export interface TransferToParticipantOptions extends OperationOptions {
/** The alternate identity of the source of the call if dialing out to a pstn number */
alternateCallerId?: string;
alternateCallerId?: PhoneNumberIdentifier;
/** The user to user information. */
userToUserInformation?: string;
/** The value to identify context of the operation. */
Expand All @@ -112,8 +112,8 @@ export type PlayAudioToParticipantOptions = PlayAudioOptions;
* Options to add participant to the call.
*/
export interface AddParticipantOptions extends OperationOptions {
/** The phone number to use when adding a pstn participant. */
alternateCallerId?: string;
/** The phone number identity to use when adding a pstn participant. */
alternateCallerId?: PhoneNumberIdentifier;
/** The operation context. */
operationContext?: string;
}
Expand Down