microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

SimpleIvrBot - CallId not available in Call Object on Established notification so 'PlayPromptOperation' fails

Open
#616 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
253
Forks
275
Avg merge
1d 5h
Merged PRs (30d)
1

Description

Describe the issue
The 'PlayPromptOperation' generates the following error due to the 'callId' being null in Call object (args.ResourceData).

{"Code: UnknownError\r\nMessage: {\"message\":\"No HTTP resource was found that matches the request URI 'https://pma.plat.skype.com/newPlatform/v1/communications/calls('microsoft.graph.playPrompt')'.\"}\r\nAdditionalData:\r\n\tinnerError: {\"date\":\"2023-01-04T14:18:00\",\"request-id\":\"ec5251bf-a346-4374-821c-f7c46c403906\",\"client-request-id\":\"02164f14-eace-464c-bcb5-421ccfe421b2\"}\r\n"}

Code Snippet
Download the lastest version of 'microsoft-graph-comms-samples-master'
Change the Target Framework to be 'net6.0'
Modify the (Bot.cs constructor) with the code below to correct serialization problem as per (https://github.com/microsoftgraph/microsoft-graph-comms-samples/issues/508)

// graph client
var productInfo = new ProductInfoHeaderValue(
    typeof(Bot).Assembly.GetName().Name,
    typeof(Bot).Assembly.GetName().Version.ToString());

JsonSerializerOptions jsonSerializerOptions = new();
jsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase, false));

GraphApiClient = new GraphAuthClient(
    GraphLogger,
    jsonSerializerOptions, // replaced Serializer.JsonSerializerSettings,
    new HttpClient(),
    AuthenticationProvider,
    productInfo,
    defaultProperties);

Modify 'ProcessNotificationAsync' in Bot.cs to use 'HttpResponseMessage' and replace 'httpRequest.CreateResponse'.

 //var httpResponse = httpRequest.CreateResponse(HttpStatusCode.Forbidden);
var httpResponse = new HttpResponseMessage(HttpStatusCode.Forbidden);
await httpResponse.CreateHttpResponseAsync(response).ConfigureAwait(false);

Expected behavior
The CallId should not be null and the phrase should successfully play. This worked when using older versions of the packages (1.2.0.850).

Graph SDK (please complete the following information):

  • Graph-dotnet-2.0.5
  • Package Versions: 1.2.0.3742

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Bot.cs, reviewing the Bot constructor and ProcessNotificationAsync changes described in the report, then compare the serialization guidance from issue 508 and the listed Graph SDK/package versions. Done means the Established notification provides a non-null CallId and PlayPromptOperation successfully plays the phrase.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.