Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove call source for create call request #34039

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
0265fe6
add Call Invite class
richardcho-msft Feb 7, 2023
a4c2acb
integrate call invite to create call
richardcho-msft Feb 7, 2023
2887e08
fix tests
richardcho-msft Feb 7, 2023
1b10570
integrate call invite to create call
richardcho-msft Feb 7, 2023
9db89a0
fix tests
richardcho-msft Feb 7, 2023
a52299f
Merge branch 'richardcho/callinvite' into richardcho/create-call
richardcho-msft Feb 7, 2023
36e4222
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
be317a3
remove validation related unit tests
richardcho-msft Feb 7, 2023
211dd65
fix tests
richardcho-msft Feb 7, 2023
7d4b830
integrate call invite to create call
richardcho-msft Feb 7, 2023
749bdc0
fix tests
richardcho-msft Feb 7, 2023
0b40dbd
remove validation related unit tests
richardcho-msft Feb 7, 2023
3f3511c
fix tests
richardcho-msft Feb 7, 2023
23b5276
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
ec579d6
remove comment
richardcho-msft Feb 8, 2023
22062d1
integrate call invite to create call
richardcho-msft Feb 7, 2023
ecbcf5b
fix tests
richardcho-msft Feb 7, 2023
8854fff
remove validation related unit tests
richardcho-msft Feb 7, 2023
0ed41d1
fix tests
richardcho-msft Feb 7, 2023
571d418
integrate call invite to create call
richardcho-msft Feb 7, 2023
04e2b40
fix tests
richardcho-msft Feb 7, 2023
240d070
Merge branch 'richardcho/callinvite' into richardcho/create-call
richardcho-msft Feb 7, 2023
233c880
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
edb3696
remove validation related unit tests
richardcho-msft Feb 7, 2023
5a5f550
fix tests
richardcho-msft Feb 7, 2023
c1519d0
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
4390eb2
remove comment
richardcho-msft Feb 8, 2023
ae2631e
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 8, 2023
2bd8929
resolve conflit
richardcho-msft Feb 8, 2023
3ab516f
fix merge conflicts
richardcho-msft Feb 8, 2023
f015f60
integrate call invite to create call
richardcho-msft Feb 7, 2023
26877fe
fix tests
richardcho-msft Feb 7, 2023
aeba1e2
Merge branch 'richardcho/callinvite' into richardcho/create-call
richardcho-msft Feb 7, 2023
05ead1f
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
5417e01
remove validation related unit tests
richardcho-msft Feb 7, 2023
f5b5266
integrate call invite to create call
richardcho-msft Feb 7, 2023
16bf482
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
b517e7f
remove comment
richardcho-msft Feb 8, 2023
1b98295
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 8, 2023
daebdfe
fix merge conflicts
richardcho-msft Feb 8, 2023
c132dd5
update swagger endpoint
richardcho-msft Feb 8, 2023
4928ad7
generate code from swagger
richardcho-msft Feb 9, 2023
42de3a9
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 9, 2023
9cfadfb
fix linter
richardcho-msft Feb 9, 2023
b081c60
update autogen'
richardcho-msft Feb 9, 2023
9a01adc
fix auto gen
richardcho-msft Feb 9, 2023
612619a
update autogen
richardcho-msft Feb 9, 2023
3ff9ed1
Merge branch 'richardcho/create-call' into richardcho/remove-call-source
richardcho-msft Feb 9, 2023
fe56f84
merge conflict
richardcho-msft Feb 9, 2023
cb0c2e0
remove duplicate code
richardcho-msft Feb 9, 2023
dbb5a62
use call invite in transfer (#34083)
yyw-msft Feb 10, 2023
09ecd78
integrate call invite to create call
richardcho-msft Feb 7, 2023
9510203
fix tests
richardcho-msft Feb 7, 2023
5f58f5b
Merge branch 'richardcho/callinvite' into richardcho/create-call
richardcho-msft Feb 7, 2023
e70e2e8
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 13, 2023
c295901
integrate call invite to create call
richardcho-msft Feb 7, 2023
0cffc40
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 7, 2023
8448bc2
remove comment
richardcho-msft Feb 8, 2023
fc0f713
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 8, 2023
acb7cb4
fix merge conflicts
richardcho-msft Feb 13, 2023
24a63e6
update swagger endpoint
richardcho-msft Feb 8, 2023
1261b04
generate code from swagger
richardcho-msft Feb 9, 2023
1649aa5
Merge branch 'richardcho/create-call' of https://github.com/richardch…
richardcho-msft Feb 9, 2023
6360e3c
fix linter
richardcho-msft Feb 9, 2023
25f3eb2
update autogen'
richardcho-msft Feb 9, 2023
714be17
fix auto gen
richardcho-msft Feb 9, 2023
eb34d98
update autogen
richardcho-msft Feb 9, 2023
d7d0222
Merge branch 'richardcho/create-call' into richardcho/remove-call-source
richardcho-msft Feb 13, 2023
e3c40ce
Merge branch 'richardcho/remove-call-source' of https://github.com/ri…
richardcho-msft Feb 13, 2023
ac523d7
update swagger
richardcho-msft Feb 13, 2023
762d1fa
Revert "update swagger"
richardcho-msft Feb 13, 2023
7182741
update swagger ref
richardcho-msft Feb 13, 2023
962fa78
fix build
richardcho-msft Feb 13, 2023
2fa3069
remove call source
richardcho-msft Feb 13, 2023
781d59b
update api
richardcho-msft Feb 13, 2023
a4bb4f2
update mock response
richardcho-msft Feb 13, 2023
4c227f5
fix tests
richardcho-msft Feb 13, 2023
b477e6b
fix more tests
richardcho-msft Feb 13, 2023
b9c07ea
Revert "fix more tests"
richardcho-msft Feb 13, 2023
c06599a
Revert "fix tests"
richardcho-msft Feb 13, 2023
4747d82
fix tests
richardcho-msft Feb 13, 2023
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 @@ -134,7 +134,7 @@ public static partial class CallAutomationModelFactory
public static Azure.Communication.CallAutomation.AddParticipantsSucceeded AddParticipantsSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> participants = null) { throw null; }
public static Azure.Communication.CallAutomation.AnswerCallResult AnswerCallResult(Azure.Communication.CallAutomation.CallConnection callConnection = null, Azure.Communication.CallAutomation.CallConnectionProperties callConnectionProperties = null) { throw null; }
public static Azure.Communication.CallAutomation.CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; }
public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, Azure.Communication.CallAutomation.CallSource callSource = null, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackEndpoint = null, string mediaSubscriptionId = null) { throw null; }
public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackEndpoint = null, Azure.Communication.CommunicationIdentifier sourceIdentity = null, Azure.Communication.PhoneNumberIdentifier sourceCallerIdNumber = null, string sourceDisplayName = null, string mediaSubscriptionId = null) { throw null; }
public static Azure.Communication.CallAutomation.CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; }
public static Azure.Communication.CallAutomation.CallParticipant CallParticipant(Azure.Communication.CommunicationIdentifier identifier = null, bool isMuted = false) { throw null; }
public static Azure.Communication.CallAutomation.CallTransferAccepted CallTransferAccepted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
Expand Down Expand Up @@ -187,7 +187,9 @@ protected CallConnection() { }
public virtual Azure.Response<Azure.Communication.CallAutomation.RemoveParticipantsResult> RemoveParticipants(System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> participantsToRemove, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.RemoveParticipantsResult>> RemoveParticipantsAsync(Azure.Communication.CallAutomation.RemoveParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.RemoveParticipantsResult>> RemoveParticipantsAsync(System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> participantsToRemove, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.TransferCallToParticipantResult> TransferCallToParticipant(Azure.Communication.CallAutomation.CallInvite callInvite, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.TransferCallToParticipantResult> TransferCallToParticipant(Azure.Communication.CallAutomation.TransferToParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.TransferCallToParticipantResult>> TransferCallToParticipantAsync(Azure.Communication.CallAutomation.CallInvite callInvite, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.CallAutomation.TransferCallToParticipantResult>> TransferCallToParticipantAsync(Azure.Communication.CallAutomation.TransferToParticipantOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.UnmuteParticipantsResponse> UnmuteParticipants(Azure.Communication.CallAutomation.UnmuteParticipantsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.CallAutomation.UnmuteParticipantsResponse> UnmuteParticipants(Azure.Communication.CommunicationIdentifier targetParticipant, string operationContext = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -200,9 +202,11 @@ internal CallConnectionProperties() { }
public System.Uri CallbackEndpoint { get { throw null; } }
public string CallConnectionId { get { throw null; } }
public Azure.Communication.CallAutomation.CallConnectionState CallConnectionState { get { throw null; } }
public Azure.Communication.CallAutomation.CallSource CallSource { get { throw null; } }
public string MediaSubscriptionId { get { throw null; } }
public string ServerCallId { get { throw null; } }
public Azure.Communication.PhoneNumberIdentifier SourceCallerIdNumber { get { throw null; } }
public string SourceDisplayName { get { throw null; } }
public Azure.Communication.CommunicationIdentifier SourceIdentity { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.CommunicationIdentifier> Targets { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
Expand Down Expand Up @@ -351,13 +355,6 @@ protected CallRecording() { }
public static bool operator !=(Azure.Communication.CallAutomation.CallRejectReason left, Azure.Communication.CallAutomation.CallRejectReason right) { throw null; }
public override string ToString() { throw null; }
}
public partial class CallSource
{
public CallSource(Azure.Communication.CommunicationIdentifier identifier) { }
public Azure.Communication.PhoneNumberIdentifier CallerId { get { throw null; } set { } }
public string DisplayName { get { throw null; } set { } }
public Azure.Communication.CommunicationIdentifier Identifier { get { throw null; } }
}
public partial class CallTransferAccepted : Azure.Communication.CallAutomation.CallAutomationEventBase
{
internal CallTransferAccepted() { }
Expand Down Expand Up @@ -439,6 +436,12 @@ public CreateGroupCallOptions(System.Collections.Generic.IEnumerable<Azure.Commu
public string SourceDisplayName { get { throw null; } set { } }
public System.Collections.Generic.IEnumerable<Azure.Communication.CommunicationIdentifier> Targets { get { throw null; } }
}
public partial class CustomContext
{
public CustomContext() { }
public System.Collections.Generic.IDictionary<string, string> SipHeaders { get { throw null; } }
public System.Collections.Generic.IDictionary<string, string> VoipHeaders { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct DtmfTone : System.IEquatable<Azure.Communication.CallAutomation.DtmfTone>
{
Expand Down Expand Up @@ -948,10 +951,9 @@ internal TransferCallToParticipantResult() { }
}
public partial class TransferToParticipantOptions
{
public TransferToParticipantOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { }
public TransferToParticipantOptions(Azure.Communication.CallAutomation.CallInvite callInvite) { }
public Azure.Communication.CallAutomation.CallInvite CallInvite { get { throw null; } }
public string OperationContext { get { throw null; } set { } }
public Azure.Communication.PhoneNumberIdentifier SourceCallerId { get { throw null; } set { } }
public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } }
public string UserToUserInformation { get { throw null; } set { } }
}
public partial class UnmuteParticipantsOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ private CallAutomationClient(Uri endpoint, HttpPipeline httpPipeline, CallAutoma
_pipeline = httpPipeline;
_resourceEndpoint = endpoint.AbsoluteUri;
_clientDiagnostics = new ClientDiagnostics(options);
AzureCommunicationServicesRestClient = new AzureCommunicationServicesRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
CallConnectionRestClient = new CallConnectionRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
CallMediaRestClient = new CallMediaRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
CallRecordingRestClient = new CallRecordingRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion);
AzureCommunicationServicesRestClient = new AzureCommunicationServicesRestClient(_clientDiagnostics, httpPipeline, endpoint.AbsolutePath, options.ApiVersion);
CallConnectionRestClient = new CallConnectionRestClient(_clientDiagnostics, httpPipeline, endpoint.AbsolutePath, options.ApiVersion);
CallMediaRestClient = new CallMediaRestClient(_clientDiagnostics, httpPipeline, endpoint.AbsolutePath, options.ApiVersion);
CallRecordingRestClient = new CallRecordingRestClient(_clientDiagnostics, httpPipeline, endpoint.AbsolutePath, options.ApiVersion);
EventProcessor = new EventProcessor(options.EventProcessorOptions);
Source = options.Source;
}
Expand Down Expand Up @@ -288,7 +288,7 @@ public virtual async Task<Response> RedirectCallAsync(RedirectCallOptions option

/// Redirect an incoming call to the target identities.
/// <param name="incomingCallContext"> The incoming call context </param>
/// <param name="callInvite"> The target where the call is redirected to. </param>
/// <param name="callInvite"> The target where the call is redirected to.</param>
/// <param name="cancellationToken"> The cancellation token. </param>
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
/// <exception cref="ArgumentNullException"><paramref name="incomingCallContext"/> is null.</exception>
Expand Down Expand Up @@ -624,18 +624,16 @@ public virtual Response<CreateCallResult> CreateGroupCall(CreateGroupCallOptions

private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options)
{
CallSourceInternal sourceDto = new(CommunicationIdentifierSerializer.Serialize(Source))
CreateCallRequestInternal request = new(
targets: new List<CommunicationIdentifierModel>() { { CommunicationIdentifierSerializer.Serialize(options.CallInvite.Target) } },
callbackUri: options.CallbackUri.AbsoluteUri)
{
CallerId = options?.CallInvite?.SourceCallerIdNumber == null
SourceCallerIdNumber = options?.CallInvite?.SourceCallerIdNumber == null
? null
: new PhoneNumberIdentifierModel(options?.CallInvite?.SourceCallerIdNumber?.PhoneNumber),
DisplayName = options.CallInvite.SourceDisplayName,
SourceDisplayName = options?.CallInvite?.SourceDisplayName,
CallSourceIdentifier = CommunicationIdentifierSerializer.Serialize(Source),
};

CreateCallRequestInternal request = new(
new List<CommunicationIdentifierModel>() { { CommunicationIdentifierSerializer.Serialize(options.CallInvite.Target) } },
sourceDto,
options.CallbackUri.AbsoluteUri);
// Add custom cognitive service domain name
if (options.AzureCognitiveServicesEndpointUrl != null)
{
Expand All @@ -653,16 +651,16 @@ private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options)

private CreateCallRequestInternal CreateCallRequest(CreateGroupCallOptions options)
{
CallSourceInternal sourceDto = new(CommunicationIdentifierSerializer.Serialize(Source))
CreateCallRequestInternal request = new(
targets: options.Targets.Select(t => CommunicationIdentifierSerializer.Serialize(t)),
callbackUri: options.CallbackUri.AbsoluteUri)
{
CallerId = options?.SourceCallerIdNumber == null ? null : new PhoneNumberIdentifierModel(options?.SourceCallerIdNumber?.PhoneNumber),
DisplayName = options.SourceDisplayName,
SourceCallerIdNumber = options?.SourceCallerIdNumber == null
? null
: new PhoneNumberIdentifierModel(options?.SourceCallerIdNumber?.PhoneNumber),
SourceDisplayName = options?.SourceDisplayName,
CallSourceIdentifier = CommunicationIdentifierSerializer.Serialize(Source),
};

CreateCallRequestInternal request = new(
options.Targets.Select(t => CommunicationIdentifierSerializer.Serialize(t)),
sourceDto,
options.CallbackUri.AbsoluteUri);
// Add custom cognitive service domain name
if (options.AzureCognitiveServicesEndpointUrl != null)
{
Expand Down
Loading