-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Adding new incoming call event for call automation. Related work item… #47379
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Adding new incoming call event for call automation. Related work item…
…: 3954169
- Loading branch information
commit 75e54be19c6b2b184bc2a0a235595d3618e0960d
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...ication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.Serialization.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
106 changes: 106 additions & 0 deletions
106
...e.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.Serialization.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...unication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCall.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Text.Json; | ||
|
|
||
| namespace Azure.Communication.CallAutomation | ||
| { | ||
| /// <summary> | ||
| /// The add participant failed event. | ||
| /// </summary> | ||
| public class IncomingCall : CallAutomationEventBase | ||
| { | ||
| /// <summary> Initializes a new instance of <see cref="IncomingCall"/>. </summary> | ||
| internal IncomingCall() | ||
| { | ||
| } | ||
|
|
||
| /// <summary> Initializes a new instance of IncomingCallEvent. </summary> | ||
| /// <param name="internalEvent">Internal Representation of the AddParticipantFailedEvent. </param> | ||
antonsamson-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| internal IncomingCall(IncomingCallInternal internalEvent) | ||
| { | ||
| To = CommunicationIdentifierSerializer.Deserialize(internalEvent.To); | ||
| From = CommunicationIdentifierSerializer.Deserialize(internalEvent.From); | ||
| ServerCallId = internalEvent.ServerCallId; | ||
| CallerDisplayName = internalEvent.CallerDisplayName; | ||
| CustomContext = new CustomCallingContext(internalEvent.CustomContext.SipHeaders, internalEvent.CustomContext.VoipHeaders); | ||
| IncomingCallContext = internalEvent.IncomingCallContext; | ||
|
|
||
| if (internalEvent.OnBehalfOfCallee != null) | ||
| { | ||
| OnBehalfOfCallee = CommunicationIdentifierSerializer.Deserialize(internalEvent.OnBehalfOfCallee); | ||
| } | ||
|
|
||
| CorrelationId = internalEvent.CorrelationId; | ||
| } | ||
|
|
||
| /// <summary> The communication identifier of the target user. </summary> | ||
| public CommunicationIdentifier To { get; } | ||
| /// <summary> The communication identifier of the user who initiated the call. </summary> | ||
| public CommunicationIdentifier From { get; } | ||
| /// <summary> Display name of caller. </summary> | ||
| public string CallerDisplayName { get; } | ||
| /// <summary> Custom Context of Incoming Call. </summary> | ||
| public CustomCallingContext CustomContext { get; } | ||
| /// <summary> Incoming call context. </summary> | ||
| public string IncomingCallContext { get; } | ||
| /// <summary> The communication identifier of the user on behalf of whom the call is made. </summary> | ||
| public CommunicationIdentifier OnBehalfOfCallee { get; } | ||
|
|
||
| /// <summary> | ||
| /// Deserialize <see cref="IncomingCall"/> event. | ||
| /// </summary> | ||
| /// <param name="content">The json content.</param> | ||
| /// <returns>The new <see cref="IncomingCall"/> object.</returns> | ||
| public static IncomingCall Deserialize(string content) | ||
| { | ||
| using var document = JsonDocument.Parse(content); | ||
| JsonElement element = document.RootElement; | ||
|
|
||
| var internalEvent = IncomingCallInternal.DeserializeIncomingCallInternal(element); | ||
| return new IncomingCall(internalEvent); | ||
| } | ||
| } | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
...ommunication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCallInternal.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Text.Json; | ||
| using Azure.Core; | ||
|
|
||
| namespace Azure.Communication.CallAutomation | ||
| { | ||
| /// <summary> | ||
| /// The incoming call event internal. | ||
| /// </summary> | ||
| [CodeGenModel("IncomingCall", Usage = new string[] { "output" }, Formats = new string[] { "json" })] | ||
| internal partial class IncomingCallInternal | ||
| { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.