Initiate PSTN call from teams to public landline.

%3CLINGO-SUB%20id%3D%22lingo-sub-2176608%22%20slang%3D%22en-US%22%3ERe%3A%20Initiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2176608%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F945998%22%20target%3D%22_blank%22%3E%40lund76%3C%2FA%3E%26nbsp%3BCould%20you%20please%20check%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fcall-transfer%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ecall%20Transfer%3C%2FA%3E.%20Try%20if%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2176719%22%20slang%3D%22en-US%22%3ERe%3A%20Initiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2176719%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F590590%22%20target%3D%22_blank%22%3E%40Nikitha-MSFT%3C%2FA%3E%26nbsp%3B%2C%3CBR%20%2F%3EThank%20you%20so%20much%20for%20replying.%20I%20can%20definitely%20have%20a%20look%20at%20that.%20However%20the%20issue%20have%20matured%20a%20bit%20and%20I%20have%20a%20more%20concise%20explanation%20of%20a%20problem%20I%20have%20run%20into%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fanswers%2Fquestions%2F287517%2Ftrying-to-call-pstn-phone-from-bot-using-post-requ.html%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fanswers%2Fquestions%2F287517%2Ftrying-to-call-pstn-phone-from-bot-using-post-requ.html%26nbsp%3B%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20do%20hope%2C%20that%20calling%20any%20public%20landline%20ought%20to%20be%20possible%2C%20and%20not%20only%20the%20numbers%20of%20users%20within%20the%20same%20tenant%20%3F!%20(as%20the%20transfer%20call%20says%20initially)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2180718%22%20slang%3D%22en-US%22%3ERe%3A%20Initiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2180718%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fanswers%2Fquestions%2F287517%2Ftrying-to-call-pstn-phone-from-bot-using-p%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fanswers%2Fquestions%2F287517%2Ftrying-to-call-pstn-phone-from-bot-using-p%3C%2FA%3E...%20giving%20404%20ot%20found%20could%20you%20please%20share%20proper%20link%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2180830%22%20slang%3D%22en-US%22%3ERe%3A%20Initiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2180830%22%20slang%3D%22en-US%22%3ESorry%20about%20that%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F590590%22%20target%3D%22_blank%22%3E%40Nikitha-MSFT%3C%2FA%3E%3CBR%20%2F%3EI%20have%20updated%20the%20link%20..%20For%20some%20reason%20the%20linked%20was%20truncated%20after%20posting%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2105893%22%20slang%3D%22en-US%22%3EInitiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105893%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3EThis%20is%20my%20first%20post.%20I%20search%20on%20this%20concept%20thoroughly%20beforehand.%20But%20couldn't%20seem%20to%20find%20anything%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20looked%20into%20the%20cloud%20communications%20part%20of%20the%20MS%20%23GraphApi%20in%20order%20to%20make%20a%20proof%20of%20concept%20regarding%3A%3CBR%20%2F%3E%3CSTRONG%3Einitiating%3C%2FSTRONG%3E%20%3CSTRONG%3Epstn%20calls%20from%20a%203rd%20party%20program%20through%20Teams%20to%20a%20public%20landline.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ELooking%20at%20examples%20like%3A%26nbsp%3B%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fcall-redirect%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%23example-3-forward-a-call-to-a-pstn-number%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fcall-redirect%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%23example-3-forward-a-call-to-a-pstn-number%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20would%20imagine%20that%20I%20might%20be%20able%20to%20something%20along%20the%20lines%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3COL%3E%3CLI%3EUser1%20in%20company%20Contoso%20activates%20a%20method%20in%203rd%20party%20program.%20Which%20sends%20a%20command%20to%20a%20call%20bot%3C%2FLI%3E%3CLI%3EThe%20call%20bot%20initiate%20a%20connection%20to%20User1%20in%20company%20Contoso%3C%2FLI%3E%3CLI%3EOn%20reply%20(preferably%20automatic)%3C%2FLI%3E%3CLI%3EThe%20bot%20calls%20the%20designated%20landline%20from%20the%203rd%20party%20program%3C%2FLI%3E%3CLI%3EWhen%20the%20PSTN%20call%20is%20accepted%20by%20UserB%20in%20Acme%20Inc.%20The%20call%20is%20%22merged%22%20and%20the%20bot%20leaves%20the%20call.%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lund76_0-1611836174108.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F250241i0682E8550B7861BF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lund76_0-1611836174108.jpeg%22%20alt%3D%22lund76_0-1611836174108.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20even%20doable%20%3F%20Have%20someone%20made%20something%20similar.%20If%20there%20is%20another%20solution%20that%20is%20easier%20that%20is%20also%20very%20much%20welcome.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooking%20much%20forward%20to%20your%20comments.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2105893%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECalling%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPSTN%20Calling%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201645%22%20slang%3D%22en-US%22%3ERe%3A%20Initiate%20PSTN%20call%20from%20teams%20to%20public%20landline.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201645%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F945998%22%20target%3D%22_blank%22%3E%40lund76%3C%2FA%3E%26nbsp%3B-%3CSPAN%3EWhich%20is%20to%20create%20a%20bot%20that%20can%20make%20a%20group%20call%20to%20a%20user%20within%20the%20organisation%2C%20and%20add%20a%20recipient%20by%20PSTN%20(public%20user%20outside%20the%20organisation).%20That%20way%20I%20can%20have%20a%203rd%20party%20program%20initiate%20a%20call%20between%20a%20teams%20user%20and%20PSTN%20landline.%20The%20bot%20can%20then%20either%20remove%20itself%20from%20the%20call%20or%20stay%20and%20do%20bot%20stuff%20for%20the%20teams%20user%20%3A)%3C%2Fimg%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi all,

This is my first post. I search on this concept thoroughly beforehand. But couldn't seem to find anything

I have looked into the cloud communications part of the MS #GraphApi in order to make a proof of concept regarding:
initiating pstn calls from a 3rd party program through Teams to a public landline.

Looking at examples like: 
https://docs.microsoft.com/en-us/graph/api/call-redirect?view=graph-rest-beta&tabs=http#example-3-fo...

I would imagine that I might be able to something along the lines:

  1. User1 in company Contoso activates a method in 3rd party program. Which sends a command to a call bot
  2. The call bot initiate a connection to User1 in company Contoso
  3. On reply (preferably automatic)
  4. The bot calls the designated landline from the 3rd party program
  5. When the PSTN call is accepted by UserB in Acme Inc. The call is "merged" and the bot leaves the call.

lund76_0-1611836174108.jpeg

 

Is this even doable ? Have someone made something similar. If there is another solution that is easier that is also very much welcome.

 

Looking much forward to your comments.

 

10 Replies

@lund76 Could you please check call Transfer. Try if that helps

Hi @Nikitha-MSFT ,
Thank you so much for replying. I can definitely have a look at that. However the issue have matured a bit and I have a more concise explanation of a problem I have run into
trying-to-call-pstn-phone-from-bot 
I do hope, that calling any public landline ought to be possible, and not only the numbers of users within the same tenant ?! (as the transfer call says initially)

Sorry about that @Nikitha-MSFT
I have updated the link .. For some reason the linked was truncated after posting

@lund76 -Which is to create a bot that can make a group call to a user within the organisation, and add a recipient by PSTN (public user outside the organisation). That way I can have a 3rd party program initiate a call between a teams user and PSTN landline. The bot can then either remove itself from the call or stay and do bot stuff for the teams user :)

@Nikitha-MSFT - Yeah, that was me trying to sum up my intentions :) So far I've not been able to get confirmed, that this scenario is even possible - it should be - but i'm not sure.

Hi @lund76,

 

I have been grappling with a similar approach for my CRM system and I thought I would give my findings here. The basic use case is to implement Click to dial. Since there is no direct dialing in teams i.e. person A calling Person B the bot approach has been used but the bot presents some problems. I am pretty sure there is a bug somewhere. I don't know as to what stage you have got up to but here is where i am.

 

My approach is:

Bot calls originator of the call.

Originator answers - this must happen first.

Bot dials participants and adds to the call.

 

Findings:

1. I send a request to my webserver registered bot to call between Person A in Contoso and Person B in Contoso (I will come to the PSTN portion later).

 

2. I see on Person A's teams it says that the bot is calling. If I press decline I get a call established event which of course is wrong (since I declined) but this leads to a problem because I cannot now automatically add the participant to the call once the originator answers. I decline, the recipient will be in limbo (and if this is external i.e. a pstn number could be even worse). There are lots of times you are making a call and get distracted so you end the call before it begins. It is vital that the Person A is on the call before Person B is called.

 

3. Assuming that you answer the call you will get the same call established event which means that you cannot distinguish between a call answered or declined. To get round this i had to introduce an IVR i.e. press 1 to dial the recipient (hardly slick but cannot do anything else with the event saying established even when it isn't).

 

4. The recipient then either answers or declines and this can be detected again provided you dial multiple recipients 1 by 1 and add them to the call.

 

5. I have not been able to get PSTN working and am still working on that but since the bot is calling the recipients i am intrigued as to what number it uses. While setting up PSTN I needed to get a number from Microsoft and assign that to a user say Person A. Since the bot cannot be assigned a number I am curious as to what the recipient sees as the incoming call number and of course this may stop a bot dialing PSTN anyway (still to be checked). 

 

6. I have confirmed by the help on these forums that direct dialing is not available and have placed as a feature request. i.e. the bot makes the calls but remains silent and invisible so the Person A and Person B think they are the only ones on the call. I also think that unless i am missing anything a declined call should not say established.

 

I get the feeling that there must be a very simple way of doing this click to dial task in the same way you describe but cannot find anything. It is vital i have the originator of the call answer first before adding participants but I cannot see it working at the moment.

 

If anyone has any thoughts please let me know.

 

Thanks.

 

 

HI @chafford100
Thank you so much for taking the time to give such a thorough reply. Looks like you've been through quite a lot already.

My main focus have been on getting the bot to call a pstn number, since if that doesn't work - what's the point really :) .. At least in this architecture.

The most promising engagement I have received is on this thread :
https://docs.microsoft.com/en-us/answers/questions/287517/trying-to-call-pstn-phone-from-bot-using-p... 
From the comments you can see that MS Engineer (i assume) has been able to reproduce the error.

An interesting development ... maybe ... Is a  tweet from Mike Landis, tweeting about some things starting to work. 
https://twitter.com/matthewlandis/status/1371574996590551043 

Best regards
Søren Lund

 

@lund76Hi Søren,

have you ever get a solution for the problem, to call a PSTN number from yout bot?

Regards

Gerd

 

Hello Gerd,

I must admit, it's been a while since I've tried. But the last time was no luck
www.000webhost.com