-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCallController.cs
30 lines (27 loc) · 932 Bytes
/
CallController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace EmergencyServicesBot
{
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Bot.Builder.Calling;
using Microsoft.Bot.Connector;
[BotAuthentication]
[RoutePrefix("api/calling")]
public class CallingController : ApiController
{
public CallingController() : base()
{
CallingConversation.RegisterCallingBot(callingBotService => new IVRBot(callingBotService));
}
[Route("callback")]
public async Task<HttpResponseMessage> ProcessCallingEventAsync()
{
return await CallingConversation.SendAsync(this.Request, CallRequestType.CallingEvent);
}
[Route("call")]
public async Task<HttpResponseMessage> ProcessIncomingCallAsync()
{
return await CallingConversation.SendAsync(this.Request, CallRequestType.IncomingCall);
}
}
}