Azure-Samples / communication-services-dotnet-quickstarts

Sample code for Azure Communication Services .Net quickstarts
MIT License
76 stars 104 forks source link

Outbound Call Automation sound does not play during a call and recognize issue #165

Open anasalhafez opened 3 months ago

anasalhafez commented 3 months ago

This issue is for a: (Outbound call no sound && recognize issue)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

1- The azure communication service is connected to multi cognitive service. 2- The mobile number is linked to the Azure Communication Service. 3- TTS cognitive service is used.

Any log messages given by the failure

No failure Message

Expected/desired behavior

The audio must play during the call.

OS and Version?

Windows 10.

Versions

.Net7.0

Mention any other details that might be useful

        if (parsedEvent is CallConnected callConnected) {
            var welcomePlaySource = new TextSource(WelcomeMessage2)
            {
                VoiceName = "en-US-NancyNeural"
            };
            await callMedia.PlayToAllAsync(welcomePlaySource);
        }

CallMediaRecognizeChoiceOptions GetMediaRecognizeChoiceOptions(string content, string targetParticipant, string context = "") { var playSource = new TextSource(content) { VoiceName = SpeechToTextVoice };

var recognizeOptions =
    new CallMediaRecognizeChoiceOptions(targetParticipant: new PhoneNumberIdentifier(targetParticipant), GetChoices())
    {
        InterruptCallMediaOperation = false,
        InterruptPrompt = false,
        InitialSilenceTimeout = TimeSpan.FromSeconds(10),
        Prompt = playSource,
        OperationContext = context
    };

return recognizeOptions;

}

List GetChoices() { return new List { new RecognitionChoice("Confirm", new List { "Confirm", "First", "One" }) { Tone = DtmfTone.One }, new RecognitionChoice("Cancel", new List { "Cancel", "Second", "Two" }) { Tone = DtmfTone.Two } }; }


### Repository
communication-services-dotnet-quickstarts-main/CallAutomation_OutboundCalling.

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.