示例#1
0
        public void Example_5b()
        {
            var response = new TwilioResponse();
            response.DialConference("Customer Waiting Room", new { beep = false, endConferenceOnExit = true });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#2
0
        public void Example_3()
        {
            var response = new TwilioResponse();
            response.DialConference("SimpleRoom", new { muted = true });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#3
0
        public void Example_4()
        {
            var response = new TwilioResponse();
            response.DialConference("NoMusicNoBeepRoom", new { beep = false, waitUrl = "", startConferenceOnEnter = true, endConferenceOnExit = false });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#4
0
        public void Example_1()
        {
            var response = new TwilioResponse();
            response.DialConference("1234");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#5
0
        public void Example_2b()
        {
            var response = new TwilioResponse();
            response.DialConference("1234", new { startConferenceOnEnter = false, endConferenceOnExit = true });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#6
0
		public void Can_Generate_Dial_Conference()
		{
			var response = new TwilioResponse();
			response.DialConference("room1");

			Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
		}
示例#7
0
		public void Can_Generate_Dial_Conference_And_Attributes()
		{
			var response = new TwilioResponse();
			response.DialConference("room1", new { muted = true, beep = false, waitUrl = "wait.xml", waitMethod = "GET" });

			Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
		}
示例#8
0
        public void Example_2a()
        {
            var response = new TwilioResponse();
            response.DialConference("1234", new { startConferenceOnEnter = "false" });

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#9
0
        public void Example_2a()
        {
            var response = new TwilioResponse();

            response.DialConference("1234", new { startConferenceOnEnter = "false" });

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#10
0
        public void Example_3()
        {
            var response = new TwilioResponse();

            response.DialConference("SimpleRoom", new { muted = true });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#11
0
        public void Example_2b()
        {
            var response = new TwilioResponse();

            response.DialConference("1234", new { startConferenceOnEnter = false, endConferenceOnExit = true });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#12
0
        public void Can_Generate_Dial_Conference()
        {
            var response = new TwilioResponse();

            response.DialConference("room1");

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#13
0
        public void Can_Generate_Dial_Conference_And_Attributes()
        {
            var response = new TwilioResponse();

            response.DialConference("room1", new { muted = true, beep = false, waitUrl = "wait.xml", waitMethod = "GET" });

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#14
0
        public void Example_1()
        {
            var response = new TwilioResponse();

            response.DialConference("1234");

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#15
0
        public void Example_5b()
        {
            var response = new TwilioResponse();

            response.DialConference("Customer Waiting Room", new { beep = false, endConferenceOnExit = true });

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#16
0
        public void Example_4()
        {
            var response = new TwilioResponse();

            response.DialConference("NoMusicNoBeepRoom", new { beep = false, waitUrl = "", startConferenceOnEnter = true, endConferenceOnExit = false });

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }
示例#17
0
        public void Can_Generate_Dial_Conference_And_Attributes_And_Dial_Attributes()
        {
            var response = new TwilioResponse();

            response.DialConference("room1",
                                    new { muted = true, beep = false, waitUrl = "wait.xml", waitMethod = "GET" },
                                    new { timeLimit = 30, action = "http://example.com" }
                                    );

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
示例#18
0
        public ActionResult PlaceInConference(bool mute)
        {
            Debug.WriteLine("Putting caller into conference: {0}", mute);

            var response = new TwilioResponse();

            response.DialConference("Chapter18Conference", new { muted = mute, beep = false, startConferenceOnEnter = true, endConferenceOnExit = false }, new { hangupOnStar = true });
            response.BeginGather(new { action = Url.ActionAbsolute("ProcessCommand"), numDigits = "1" });
            response.EndGather();
            response.Say("Bye");

            return(TwiML(response));
        }
示例#19
0
        public async Task <ActionResult> HandleCustomerCall(string CallSid, string From)
        {
            var response = new TwilioResponse();

            //check the caller ID and try to find a call config that matches it
            IMobileServiceTable <WarmCall> warmCallTable = MobileService.GetTable <WarmCall>();
            var warmCalls = await warmCallTable.ReadAsync <WarmCall>(warmCallTable.Where(w => w.CustomerPhone == From));

            var warmCall = warmCalls.FirstOrDefault();

            if (warmCall != null)
            {
                //update with the call sid
                warmCall.CustomerCallSid = CallSid;
                await warmCallTable.UpdateAsync(warmCall);

                //put the customer into a conference
                response.Say("Please while while we conjure a support agent");
                response.DialConference(CallSid);

                //dial an agent
                var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken);
                var result = client.InitiateOutboundCall("+17862200728", warmCall.AgentOnePhone, Url.ActionAbsolute("HandleAgentOneCall"));

                if (result.RestException != null)
                {
                    Console.WriteLine(result.RestException.Message);
                }
                //let the browser know that the customer has connected and we're calling the agent
            }
            else
            {
                response.Say("Who are you?  Go away!");
                response.Hangup();
            }


            return(TwiML(response));
        }
示例#20
0
        public void Can_Generate_Dial_Conference_And_Attributes_And_Dial_Attributes()
        {
            var response = new TwilioResponse();
            response.DialConference("room1",
                new { muted = true, beep = false, waitUrl = "wait.xml", waitMethod = "GET" },
                new { timeLimit = 30, action = "http://example.com" }
            );

            Assert.True(IsValidTwiML(response.ToXDocument()));
        }