コード例 #1
0
        public async Task <HttpResponseMessage> OnNotification(HttpRequestMessage request)
        {
            Log.Info(new CallerInfo(), LogContext.FrontEnd, $"Notification Received HTTP {request.Method} on {request.RequestUri}");

            var response = await RealTimeMediaCalling.SendAsync(request, RealTimeMediaCallRequestType.NotificationEvent).ConfigureAwait(false);

            // Enforce the connection close to ensure that requests are evenly load balanced so
            // calls do no stick to one instance of the worker role.
            response.Headers.ConnectionClose = true;
            return(response);
        }
コード例 #2
0
        public async Task <HttpResponseMessage> OnNotificationAsync()
        {
            Log.Info(new CallerInfo(), LogContext.FrontEnd, $"Notification Received HTTP {Request.Method} on {Request.RequestUri}");

            //let the RealTimeMediaCalling SDK know of the incoming notification. The SDK deserializes the callback, validates it and calls the appropriate
            //events on the IRealTimeMediaCall for this request
            var response = await RealTimeMediaCalling.SendAsync(Request, RealTimeMediaCallRequestType.NotificationEvent).ConfigureAwait(false);

            // Enforce the connection close to ensure that requests are evenly load balanced so
            // calls do no stick to one instance of the worker role.
            response.Headers.ConnectionClose = true;
            return(response);
        }
コード例 #3
0
 /// <summary>
 /// Instantiate a CallController with a specific ICallProcessor (e.g. for testing).
 /// </summary>
 /// <param name="callProcessor"></param>
 static CallController()
 {
     RealTimeMediaCalling.RegisterRealTimeMediaCallingBot(c => { return(new RealTimeMediaCall(c)); },
                                                          new RealTimeMediaCallingBotServiceSettings());
 }