-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Added enhancements on top of Calling Server preview 1 #21686
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
Conversation
…tity with alternateCallerId, other fixes
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them. In order to bootstrap pipelines for a new service, please perform following steps: For data-plane/track 2 SDKs Issue the following command as a pull request comment:
For track 1 management-plane SDKsPlease open a separate PR and to your service SDK path in this file. Once that PR has been merged, you can re-run the pipeline to trigger the verification. |
...ommunication.CallingServer/tests/SessionRecords/Sample1_CallClient/CreateCallAsyncAsync.json
Show resolved
Hide resolved
...on/Azure.Communication.CallingServer/tests/SessionRecords/Sample1_CallClient/CreateCall.json
Show resolved
Hide resolved
...on.CallingServer/tests/SessionRecords/CallingServerClientsLiveTests/CreateCallTestAsync.json
Show resolved
Hide resolved
...ication.CallingServer/tests/SessionRecords/CallingServerClientsLiveTests/CreateCallTest.json
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/src/CallingServerClient.cs
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/src/swagger.json
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/src/Generated/ServerCallRestClient.cs
Show resolved
Hide resolved
| /// </summary> | ||
| /// <returns>The instrumented <see cref="CallClient" />.</returns> | ||
| protected CallClient CreateInstrumentedCallingServerClient() | ||
| /// <returns>The instrumented <see cref="CallConnection" />.</returns> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the return should be CallingServerClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed.
| To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. | ||
|
|
||
| ## Creating an `ServerCallingClient` | ||
| ## Creating an `CallingServerClient` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see an?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still see "an" as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still see an :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more "an"
| options: createCallOption // The options for creating a call. | ||
| ); | ||
| Console.WriteLine($"Call Leg id: {createCallResponse.CallLegId}"); | ||
| Console.WriteLine($"Call connection id: {callConnection.Value.CallConnectionId}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apis are returning Response object which kind of wrapped http response object. The Value property contain the return value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then variable should be named differently - something like callConnectionResponse
…er-preview1-enhancement
* Clean up clients comments. * Update Snippet and Export-API.
…github.com/Azure/azure-sdk-for-net into feature/callingServer-preview1-enhancement
* Update Snippet and Export-API. * remove calloption override in servercall client. * Nit for params and arguments handling. * Merge Downloader updates. * Merge Downloader updates test cases. * Update AutoGen Content.
sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs
Show resolved
Hide resolved
...munication.CallingServer/src/Generated/AzureCommunicationCallingServerServiceModelFactory.cs
Outdated
Show resolved
Hide resolved
...on/Azure.Communication.CallingServer/tests/CallingServerClients/CallingServerClientsTests.cs
Outdated
Show resolved
Hide resolved
| protected async Task SleepIfNotInPlaybackModeAsync() | ||
| { | ||
| if (TestEnvironment.Mode != RecordedTestMode.Playback) | ||
| await Task.Delay(10000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a delay here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few Tests in Record mode required human interaction(i.e. pick up the call to let the call in established state, so that further Api operations can be performed).
Alternative ways is using debug break point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍. You can renaming the method then to WaitToPickUpPhoneInPlaybackModeAsync to make it more clear
sdk/communication/Azure.Communication.CallingServer/src/Downloader/DownloadExtentions.cs
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/src/Models/CallConnectionState.cs
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/TestBase.cs
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/tests/CallingServerClients/TestBase.cs
Show resolved
Hide resolved
…d of Response), fixes based on comments (#21790)
* Update Snippet and Export-API. * remove calloption override in servercall client. * Nit for params and arguments handling. * Merge Downloader updates. * Merge Downloader updates test cases. * Update AutoGen Content. * Nit clean on Unit Tests. * Updating and renaming.
InviteParticipants --> AddParticipant
InviteParticipantResultEvent --> AddParticipantResultEvent
CallModality --> MediaType
CommunicationParticipant --> CallParticipant
Id in PlayAudioResult & CancelAllMediaOperations is now called OperationId
CallConnectionState now has {incoming, connecting, connected, disconnecting, disconnected}
CallRecordingStateResult ---> CallRecording... by Naveed Ali
CallRecordingStateResult ---> CallRecordingProperties
…github.com/Azure/azure-sdk-for-net into feature/callingServer-preview1-enhancement
…gger path (#21870) * Added AddParticipantResult, Re-added communication error, updated swagger path * Fixed unit tests * Updated netstandard
* Update Snippet and Export-API. * remove calloption override in servercall client. * Nit for params and arguments handling. * Merge Downloader updates. * Merge Downloader updates test cases. * Update AutoGen Content. * Nit clean on Unit Tests. * Updating and renaming. * Test update. * Add Call Connection Live Tests. * Add ServerCall Live Tests * Increase Test Coverage. * Reenable sample tests. * Address comments. * Point to swagger file in master branch.
* Update Snippet and Export-API. * remove calloption override in servercall client. * Nit for params and arguments handling. * Merge Downloader updates. * Merge Downloader updates test cases. * Update AutoGen Content. * Nit clean on Unit Tests. * Updating and renaming. * Test update. * Add Call Connection Live Tests. * Add ServerCall Live Tests * Increase Test Coverage. * Reenable sample tests. * Address comments. * Point to swagger file in master branch. * Nit fix. * Nit changes based on Azure boarder review feedback.
sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs
Outdated
Show resolved
Hide resolved
sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs
Outdated
Show resolved
Hide resolved
| /// Calling server model factory | ||
| /// </summary> | ||
| [CodeGenModel("AzureCommunicationServicesModelFactory")] | ||
| internal partial class CallingServerModelFactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably should be moved to .Models namespace and also should it be public so developers can instantiate the models that do not have public constructor.
CC: @minnieliu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, agreed, good catch Reza!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a pattern followed by other modalities? So, far we don't seem to have this need for apps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. See this for more details: https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking
| <PropertyGroup> | ||
| <Description> | ||
| This client library enables working with the Microsoft Azure Communication Service Calling Server APIs. | ||
| This client library enables working with the Microsoft Azure Communication CallingServer service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename to Calling Server, two separate words?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer using "CallingServer" which was "Calling Server" to keep it consistent within SDK library and API
| /// </summary> | ||
| #pragma warning disable CA1707 // Identifiers should not contain underscores | ||
| V2021_04_15_Preview1 = 0 | ||
| V2021_06_15_Preview = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the enum starting with 1 but the 2021_04_15 version is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This number started from 1 was per Azure boarder team suggest, they seems reserve 0 for other usage. CC @navali-msft
"2021_04_15" was a "private review" version. There are plenty of major schema changes on the swagger and since we are not public preview yet, we decide to have "V2021_06_15_Preview" as our first public version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// <param name="identifier"> The communication identifier. </param> | ||
| /// <param name="participantId"> Participant Id. </param> | ||
| /// <param name="isMuted"> Is participant muted. </param> | ||
| public CallParticipant(CommunicationIdentifier identifier, string participantId, bool? isMuted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should isMuted be nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this.
| public string SourcePhoneNumber => GetRecordedVariable(AlternateCallerId, options => options.IsSecret()); | ||
|
|
||
| /// <summary> | ||
| /// The phone number associated with the source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be The phone number associated with the target.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Change it to:
/// The phone number required to make a pstn call.
| /// The phone number associated with the source. | ||
| /// </summary> | ||
| public string SourcePhoneNumber => GetRecordedVariable(AzurePhoneNumber, options => options.IsSecret()); | ||
| public string SourcePhoneNumber => GetRecordedVariable(AlternateCallerId, options => options.IsSecret()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to change it to alternateCallerId, can we change the variable name as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to using the SourcePhoneNumber in comparasion with TargetPhoneNumber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have target phone number, so here we have source phone number, considering later on, the source phone number could be a pstn number that is not from ACS resource, then we assign another number and differentiate it with the AlternateCallerId from ACS.
| /// </summary> | ||
| public class CallingServerTestEnvironment : CommunicationTestEnvironment | ||
| { | ||
| public const string AlternateCallerId = "ALTERNATE_CALLERID"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minnieliu @RezaJooyandeh
Should we move this to CommunicationTestEnvironment.cs and create a Variable in the ACS Live Test KV?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually only add it to CommunicationTestEnvironment for variables that will be shared between all the Communication SDKs. I think it is fine to keep it in CallingServerTestEnvironment
| namespace Azure.Communication.CallingServer | ||
| { | ||
| [CodeGenModel("CommunicationErrorResponse")] | ||
| public partial class CallingServerErrorResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is not currently used, correct? If you plan to convert low level exceptions to this, you should only add this class when the conversion code is added. Otherwise, it is confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navali-msft could you please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the public version. Keep the one generated by sdk.
…operties to readonly (#21980) * Updated models definition based on new swagger, also fixed events to make properties readonly * Update accessibility of internal models * Update the file path in autorest
…o feature/callingServer-preview1-enhancement
| EnvVars: | ||
| # SKIP_PHONENUMBER_LIVE_TESTS skips certain phone number tests such as purchase and release | ||
| SKIP_PHONENUMBER_LIVE_TESTS: TRUE | ||
| SKIP_PHONENUMBER_LIVE_TESTS: TRUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is SKIP_PHONENUMBER_LIVE_TESTS here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this flag is widely used in all the other communication SDK projects, even this flag is not used in them.
|
|
||
| using Azure.Core; | ||
|
|
||
| namespace Azure.Communication.CallingServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Models
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved.
RezaJooyandeh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left another couple of small comments, but feel free to merge once you address those and @minnieliu approve as well.
All SDK Contribution checklist:
This checklist is used to make sure that common guidelines for a pull request are followed.
Draftmode if it is:General Guidelines and Best Practices
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK. Please double check nuget.org current release version.Additional management plane SDK specific contribution checklist:
Note: Only applies to
Microsoft.Azure.Management.[RP]orAzure.ResourceManager.[RP]Management plane SDK Troubleshooting
If this is very first SDK for a services and you are adding new service folders directly under /SDK, please add
new servicelabel and/or contact assigned reviewer.If the check fails at the
Verify Code Generationstep, please ensure:generate.ps1/cmdto generate this PR instead of callingautorestdirectly.Please pay attention to the @microsoft.csharp version output after running
generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version.Note: We have recently updated the PSH module called by
generate.ps1to emit additional data. This would help reduce/eliminate the Code Verification check error. Please run following command:Old outstanding PR cleanup
Please note:
If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.