Skip to content

Commit

Permalink
Merge pull request #186 from Azure-Samples/users/v-vdharmaraj/liveTra…
Browse files Browse the repository at this point in the history
…nscriptionBugFix

bug fix for the transcription
  • Loading branch information
v-vdharmaraj authored Jan 23, 2025
2 parents 4b73a6b + 591bbc1 commit 3a3f036
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
{
var callerId = incomingCallEventData.FromCommunicationIdentifier.RawId;
var callbackUri = new Uri(new Uri(callbackUriHost), $"/api/callbacks/{Guid.NewGuid()}?callerId={callerId}");
var websocketUri = callbackUriHost.Replace("https", "wss") + "ws";
var websocketUri = callbackUriHost.Replace("https", "wss") + "/ws";
logger.LogInformation($"Incoming call - correlationId: {incomingCallEventData.CorrelationId}, " +
$"Callback url: {callbackUri}, websocket Url: {websocketUri}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
},
"AllowedHosts": "*",
"CallbackUriHost": "MY_NGROK_TUNNEL_URI",
"CallbackUriHost": "MY_DEVTUNNEL_URI",
"CognitiveServiceEndpoint": "MY_COGNITIVE_SERVICES_ENDPOINT",
"AcsConnectionString": "MY_ACS_CONNECTION_STRING",
"AcsPhoneNumber": "ACS_PHONE_NUMBER",
Expand Down
24 changes: 13 additions & 11 deletions CallAutomation_CallLiveTranscription/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ It accepts an incoming call from a phone number, performs DTMF recognition, and

## Before running the sample for the first time

##### 1. Clone the Repo

1. Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you would like to clone the sample to.
2. git clone `https://github.com/Azure-Samples/Communication-Services-dotnet-quickstarts.git`.
3. Navigate to `CallAutomation_CallLiveTanscription` folder and open `CallAutomation_CallLiveTanscription.sln` file.
3. Navigate to `CallAutomation_CallLiveTranscription` folder and open `CallAutomation_CallLiveTranscription.sln` file.

### Setup and host your Azure DevTunnel
##### 2. Setup and host your Azure DevTunnel

[Azure DevTunnels](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/overview) is an Azure service that enables you to share local web services hosted on the internet. Use the commands below to connect your local development environment to the public internet. This creates a tunnel with a persistent endpoint URL and which allows anonymous access. We will then use this endpoint to notify your application of calling events from the ACS Call Automation service.

Expand All @@ -30,23 +32,23 @@ devtunnel create --allow-anonymous
devtunnel port create -p 8080
devtunnel host
```
##### 3. Add a Managed Identity to the ACS Resource that connects to the Cognitive Services resource
Follow the instructions in this [documentation](https://learn.microsoft.com/en-us/azure/communication-services/concepts/call-automation/azure-communication-services-azure-cognitive-services-integration).


### Configuring application

##### 4. Add required configuration
Open the appsettings.json file to configure the following settings

1. `CallbackUriHost`: Base url of the app. (For local development replace the above dev tunnel url from the above for the port 8080).
1. `CognitiveServiceEndpoint`: Azure Multi Service endpoint.
1. `AcsConnectionString`: Azure Communication Service resource's connection string.
2. `AcsPhoneNumber`: Phone number associated with the Azure Communication Service resource. For e.g. "+1425XXXAAAA"
3. `Locale`: Transcription locale
4. `AgentPhoneNumber`: Phone number associated to with Agent
2. `CognitiveServiceEndpoint`: Azure Multi Service endpoint.
3. `AcsConnectionString`: Azure Communication Service resource's connection string.
4. `AcsPhoneNumber`: Phone number associated with the Azure Communication Service resource. For e.g. "+1425XXXAAAA"
5. `Locale`: Transcription locale
6. `AgentPhoneNumber`: Phone number associated to with Agent

### Run app locally

1. Run the `CallAutomation_CallLiveTranscription` project with `dotnet run`
2. Open `http://localhost:8080/swagger/index.html` or your dev tunnel url for the port 8080 in browser
3. Register an EventGrid Webhook for the IncomingCall Event that points to your DevTunnel URI endpoint ex `{CallbackUriHost}/api/incomingCall` and register Recording File Status Updated event to you recordingstatus api endpoint ex. `{CALLBACK_HOST_URI}/api/recordingFileStatus`. Instructions [here](https://learn.microsoft.com/en-us/azure/communication-services/concepts/call-automation/incoming-call-notification).

Once that's completed you should have a running application. The best way to test this is to place a call to your ACS phone number and talk to your intelligent agent.
Once that's completed you should have a running application. The best way to test this is to place a call to your ACS phone number and talk to your intelligent agent.

0 comments on commit 3a3f036

Please sign in to comment.