Пример #1
0
        /// <summary>
        /// This gets called when the user hangs up the call to the bot
        /// </summary>
        /// <param name="callStateChangeNotification"></param>
        /// <returns></returns>
        private Task OnCallStateChangeNotification(CallStateChangeNotification callStateChangeNotification)
        {
            Log.Info(new CallerInfo(), LogContext.FrontEnd, $"[{CallId}] Received CallStateChangeNotification with AudioVideoCallStateType={callStateChangeNotification.CurrentState.ToString()}");

            if (callStateChangeNotification.CurrentState == CallState.Terminated)
            {
                MediaSession.Dispose();
            }
            return(Task.CompletedTask);
        }
Пример #2
0
        /// <summary>
        /// This gets called when the user hangs up the call to the bot
        /// </summary>
        /// <param name="callStateChangeNotification"></param>
        /// <returns></returns>
        private Task OnCallStateChangeNotification(CallStateChangeNotification callStateChangeNotification)
        {
            Log.Info(new CallerInfo(), LogContext.FrontEnd, $"[{CallId}] Received CallStateChangeNotification with AudioVideoCallStateType={callStateChangeNotification.CurrentState.ToString()}");

            if (callStateChangeNotification.CurrentState == CallState.Terminated)
            {
                //cleanup the media session that disposes sockets, etc
                MediaSession.Dispose();
                RealTimeMediaCall temp;
                ActiveMediaCalls.TryRemove(CallId, out temp);
            }
            return(Task.CompletedTask);
        }
        private async Task HandleCallStateChangeNotification(CallStateChangeNotification notification)
        {
            Trace.TraceInformation($"RealTimeMediaCallService [{CallLegId}]: Received CallStateChangeNotification.. ");
            notification.Validate();

            var eventHandler = OnCallStateChangeNotification;

            if (eventHandler != null)
            {
                await eventHandler.Invoke(notification).ConfigureAwait(false);
            }

            return;
        }