Example #1
0
        public static async Task ProcessEvent(DtmfEvent ev, UrlHelper url, HttpContextBase context)
        {
            Trace.WriteLine(string.Format("DtmfEvent {0}", ev.DtmfDigit), "Events");
            var call = new Call {
                Id = ev.CallId
            };

            if (ev.DtmfDigit.StartsWith("1"))
            {
                await call.SpeakSentence("Please stay on the line. Your call is being connected.", "gather_complete");
            }
            else
            {
                await call.SpeakSentence("This call will be terminated", "terminating");
            }
        }
 private async Task ProcessCalledToOwnerEvent(DtmfEvent ev, TinyIoCContainer container)
 {
     if (ev.DtmfDigit == "#")
     {
         var call = await Call.Get(ev.CallId);
         if (call.RecordingEnabled)
         {
             Trace.WriteLine("Stop recording of voice message");
             await call.RecordingOff();
             await
                 CurrentConferenceMember
                     .Update(new Dictionary<string, object> {{"hold", false}});
         }
     }
 }