Пример #1
0
        private TwimlVerbResult SendToPhone(XElement twimnode)
        {
            var words = twimnode.Value;
            var verb  = twimnode.Name;
            var a     = new LogObj()
            {
                Caption      = "Twiml " + verb + ": " + words,
                LogSymbol    = LogSymbol.TwilioToPhone,
                CallInstance = MyCall
            }.LogIt();



            SystemController.Instance.Office.SayToPhone(MyCall, verb + "ing (" + words + ")");


            return(TwimlVerbResult.Continue);
        }
Пример #2
0
        protected TwimlVerbResult Say(XElement twimnode)
        {
            var words = twimnode.Value;
            var a     = new LogObj()
            {
                Caption      = "Twiml Say: " + words,
                LogSymbol    = LogSymbol.TwilioToPhone,
                CallInstance = MyCall
            }.LogIt();


            foreach (var wd in twimnode.Value.Split(' '))
            {
                SystemController.Instance.Office.SayToPhone(MyCall, wd);
                Thread.Sleep(200);
            }

            return(TwimlVerbResult.Continue);
        }
Пример #3
0
        private void DoTwimlRequest(string UrlToUse, string LogAs)
        {
            CurrentUrl = UrlToUse;
            var a   = "";
            var nvc = MyCall.GenerateCallBackValue();
            var v   = new LogObj()
            {
                LogSymbol    = LogSymbol.TwilioToWeb,
                CallInstance = MyCall,
                Caption      = LogAs + " to " + UrlToUse
            };



            try
            {
                v.AddNode("Request", nvc);
                a = MyCall.BrowserClient.DoRequest(UrlToUse, nvc);
                v.AddNode("Response", a);
            }
            catch (Exception ex)
            {
                v.Caption = "<- Exception on Call Start Call Back to " + MyCall.CallBackurl + ex.Message;
                v.AddException(ex);
            }
            try
            {
                Twiml = XDocument.Parse(a);
                v.AddNode("Twiml:", a);
            }
            catch (Exception ex)
            {
                v.AddNode("TWiml Error", "Error parsing Twiml " + ex.Message + " Defaulting to a blank document").IsInError = true;
                Twiml = XDocument.Parse(@"<?xml version=""1.0"" encoding=""UTF-8"" ?><Response></Response>");
            }
            SystemController.Instance.Logger.LogObj(v);
        }