microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

Create call to PSTN number fails with CreateUsageRequest: Balance not found error

Open
#498 0 comments 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
I'm trying to make my bot ApplicationInstance call a PSTN number. Some days ago it worked successfully, now it doesn't work anymore.

Code Snippet
Invoking POST on https://graph.microsoft.com/v1.0/communications/calls endpoint using Postman with the following body

{ "@odata.type": "#microsoft.graph.call", "callbackUri": "<CALLBACK_URI>", "source": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "applicationInstance": { "@odata.type": "#microsoft.graph.identity", "displayName": "Calling Bot", "id": "<APPLICATION_INSTANCE_ID>" } }, "countryCode": null, "endpointType": null, "region": null, "languageId": null }, "targets": [ { "@odata.type": "#microsoft.graph.invitationParticipantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "phone": { "@odata.type": "#microsoft.graph.identity", "id": "PSTN_NUMBER" } } } ], "requestedModalities": [ "audio" ], "mediaConfig": { "@odata.type": "#microsoft.graph.serviceHostedMediaConfig" }, "tenantId": "<TENANT_ID>" }

Expected behavior
A call to the specified PSTN number should be made

Graph SDK (please complete the following information):
Microsoft Graph 3.18.0

Call ID
Call ID ba1f5d00-d6f8-4cda-98e0-de72e1850587 @ 07:26:20 UTC, 18 October 2021

Logs
The BOT notification endpoint receives the following error
{ "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "deleted", "resource": "/app/calls/ba1f5d00-d6f8-4cda-98e0-de72e1850587", "resourceUrl": "/communications/calls/ba1f5d00-d6f8-4cda-98e0-de72e1850587", "resourceData": { "@odata.type": "#microsoft.graph.call", "state": "terminated", "resultInfo": { "@odata.type": "#microsoft.graph.resultInfo", "code": 404, "subcode": 9999, "message": "Error from CreateUsageRequest:\r\nBalance not found. DiagCode: 404#580406" }, "callChainId": "30a35c10-44b2-4026-a9f5-cc8986f881c0", "terminationSender": { "@odata.type": "#microsoft.graph.identitySet", "phone": { "@odata.type": "#microsoft.graph.identity", "id": "<PSTN_NUMBER>", "displayName": "PSTN_NUMBER", "identityProvider": "None" } } } } ] }

Additional context

The ApplicationInstance used in the request has the following licenses assigned to it via the Office 365 admin portal:
image

ApplicationInstance has a phone number assigned to it (sensitive data blurred for privacy)
image

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 by reproducing the POST request to /v1.0/communications/calls in Postman and compare the terminated call notification with the reported CreateUsageRequest and Balance not found message. Review the ApplicationInstance licensing and phone-number assignment details shown in the issue. Done means identifying a documented configuration or service cause; the payload does not name a repository file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
postman
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.