Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -93,10 +93,23 @@ public async Task<IActionResult> HandleEvents([FromBody] EventGridEvent[] eventG
var callbackUri = new Uri(new Uri(_config.CallbackUriHost), $"/api/callbacks");
_logger.LogInformation($"Incoming call - correlationId: {incomingCallEventData.CorrelationId}, Callback url: {callbackUri}");

var websocketUri = _config.CallbackUriHost.Replace("https", "wss") + "/ws";

MediaStreamingOptions mediaOpts = new MediaStreamingOptions(
new Uri(websocketUri),
MediaStreamingContent.Audio,
MediaStreamingAudioChannel.Mixed,
MediaStreamingTransport.Websocket,
false)
{
EnableBidirectional = false,
AudioFormat = AudioFormat.Pcm24KMono
};
var options = new AnswerCallOptions(incomingCallEventData.IncomingCallContext, callbackUri)
{
// ACS GCCH Phase 2
// CallIntelligenceOptions = new CallIntelligenceOptions() { CognitiveServicesEndpoint = new Uri(cognitiveServicesEndpoint) }
MediaStreamingOptions = mediaOpts
};

_logger.LogInformation($"Answering call with correlationId: {incomingCallEventData.CorrelationId}");
Expand Down
Loading