Forum Discussion
relkniw
Oct 26, 2021Copper Contributor
Cannot initiate PSTN calls from bot
Hi everybody, within my calling bot I try to initiate a PSTN call like https://docs.microsoft.com/en-us/graph/api/application-post-calls?view=graph-rest-1.0&tabs=http#example-8-create-peer-to-pee...
- Nov 08, 2021We could solve the problem. We used the wrong object ID for creating the call. After using the object ID from the assigned service user, it works.
Nivedipa-MSFT
Microsoft
Oct 26, 2021We are looking into the issue.We will update you
Thanks,
Nivedipa
------------------------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
relkniw
Nov 03, 2021Copper Contributor
Nivedipa-MSFTHi Nivedipa,
I could solve the "InternalServerError" by using following c# code:
AdditionalData = new Dictionary<string, object>()
{
{"phone", new Identity() { Id = pDevice} }
}
instad of
AdditionalData = new Dictionary<string, object>()
{
{"phone", "{\"@odata.type\":\"#microsoft.graph.identity\",\"id\":\"+12345678901\"}"}
}
But now I have annother problem: After sending the MakeCall Request I get an establishing Event and immediately an Terminated Event with an Error:
"value": [
{
"changeType": "Updated",
"resourceUrl": "/communications/calls/911f6100-723b-400b-9053-893f686f3131",
"resource": "/app/calls/911f6100-723b-400b-9053-893f686f3131",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "establishing",
"callChainId": "ef0c7f6a-974b-4700-8525-d74fe4d924c2"
},
"@odata.type": "#microsoft.graph.commsNotification"
}
],
"@odata.type": "#microsoft.graph.commsNotifications"
}
{
"value": [
{
"changeType": "Deleted",
"resourceUrl": "/communications/calls/911f6100-723b-400b-9053-893f686f3131",
"resource": "/app/calls/911f6100-723b-400b-9053-893f686f3131",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subcode": 9999,
"message": "Get Outbound routing - failed getting userId from billedUserMri: 28:d86f4970-a209-46f1-ad06-87137338eac2. DiagCode: 500#510543"
},
"callChainId": "ef0c7f6a-974b-4700-8525-d74fe4d924c2",
"terminationSender": {
"@odata.type": "#microsoft.graph.identitySet",
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+41*********",
"displayName": "4:+41*******",
"identityProvider": "None"
}
}
},
"@odata.type": "#microsoft.graph.commsNotification"
}
],
"@odata.type": "#microsoft.graph.commsNotifications"
}
The service user for the bot has an "Microsoft 365 E3" and a "Microsoft 365 Phone System" license.
And I am able to make call from a PSTN number to the bot.
Any idea?
Regards
Gerd
- relkniwNov 08, 2021Copper ContributorWe could solve the problem. We used the wrong object ID for creating the call. After using the object ID from the assigned service user, it works.
- lukaszzwierkoApr 15, 2022Copper ContributorHi, would you mind sharing where exactly in the API / code do you user the service user object id instead of bot registration ID. Basically I'm trying to get the IncidentBot sample to call PSTN, I did all the configuration as described is this thread but getting the same error "DiagCode: 500#510543".
thanks in advance.
Łukasz- lukaszzwierkoApr 15, 2022Copper ContributorOk, I've found the issue, you need to add call source "applicationInstance" with id of the service account. It's not well documented and not in c# api, must be done manually through additional data.
- ecastan1Dec 13, 2021Copper Contributor
Hi relkniw
Could you please show where do you get the correct object id that works in your case? There seem to be several options and we are not sure which one is correct.
Thanks a lot.
- relkniwDec 13, 2021Copper Contributor
Hi ecastan1,
I think you have created a new service user in the Azure AD for your calling bot by using a powershell command. Something like New-CsOnlineApplicationInstance -UserPrincipalName
<new userid> -ApplicationId <ClientId>. Then you have to use the object id of that new created user.Hope that answers your question.
Regards
Gerd