Beispiel #1
0
        public TwiMLResult FindDetail(string digits)
        {
            var response               = new VoiceResponse();
            ReviewRepository   repo    = new ReviewRepository();
            List <OrderDetail> details = repo.GetOrderDetailsByItemCode((int)Session["orderId"], digits);

            if (details == null || details.Count == 0)
            {
                response.Say("we could not find that item in your order", voice: "alice", language: "en-US");
                response.Redirect("/Review/EnterDetail");
            }
            else if (details.Count > 1)
            {
                response.Gather(new Gather(action: "/Review/FindBySize?productCode=" + int.Parse(digits), numDigits: 3)
                                .Say("we found multiple of that item in your order. to narrow it down please enter the size code of the item you want to edit", voice: "alice", language: "en-US"));
                response.Redirect("/Review/FindDetail?digits=" + details[0].Product.ProductCode);
            }
            else
            {
                Session["OrderDetailID"] = details[0].OrderDetailID;
                response.Gather(new Gather(action: "/Review/ChooseEdit1", numDigits: 1)
                                .Say("you chose, " + details[0].Quantity + " ," + details[0].Product.Description + " ,size " + details[0].Size.Size1
                                     + ". to change the quantity press 1, to change the size press 2, to delete this item from your cart "
                                     + "press 3, to return to the previous menu press 4, to return to "
                                     + "the main menu press 5.", voice: "alice", language: "en-US"));
                response.Redirect("/Review/FindDetail?digits=" + details[0].Product.ProductCode);
            }
            return(TwiML(response));
        }
Beispiel #2
0
        public TwiMLResult ReviewSize1(string digits)
        {
            var response          = new VoiceResponse();
            ReviewRepository repo = new ReviewRepository();
            Size             size = repo.FindSizeBySizeCodeForProduct(digits, (int)Session["OrderDetailID"]);

            if (!repo.DoesSizeExist(digits))
            {
                response.Say("invalid size code, please try again", voice: "alice", language: "en-US");
                response.Redirect("/Review/EditSize1");
            }
            else if (size == null)
            {
                response.Say("Product not available in this size, please try again", voice: "alice", language: "en-US");
                response.Redirect("/Review/EditSize1");
            }
            else if (repo.DoesItemExistInOrder(digits, (int)Session["OrderDetailID"]))
            {
                response.Say("you already have this item in size " + size.Size1 + " in your order, to make changes to that item find it from the review menu "
                             + " and edit it.", voice: "alice", language: "en-US");
                response.Redirect("/Review/ReviewOptions");
            }
            else if (repo.OutOfStock((int)Session["OrderDetailID"], 0, size.SizeID))
            {
                response.Say("I'm sorry but you can't change the size of this item, since there is not enough stock in the size you chose", voice: "alice", language: "en-US");
                response.Redirect("/Review/ReviewOptions");
            }
            else
            {
                response.Gather(new Gather(action: "/Review/ConfirmSize1?sizeId=" + size.SizeID + "&sizeCode=" + size.SizeCode, numDigits: 1)
                                .Say("you have chosen to update the size to, " + size.Size1 + " , to enter the size again, press 1. to confirm press 2.", voice: "alice", language: "en-US"));
                response.Redirect("/Review/ReviewSize1?digits=" + digits);
            }
            return(TwiML(response));
        }
Beispiel #3
0
        public TwiMLResult ReviewEntireOrder()
        {
            var response                    = new VoiceResponse();
            ReviewRepository   repo         = new ReviewRepository();
            List <OrderDetail> orderDetails = repo.GetOrderDetailsByOrderId((int)Session["orderId"]);

            if (orderDetails.Count == 0)
            {
                response.Say("We could not find any items in this order", voice: "alice", language: "en-US");
                response.Redirect("/Review/ReviewOptions");
            }
            else if ((int)Session["Index"] == orderDetails.Count)
            {
                response.Say("there are no more items to review", voice: "alice", language: "en-US");
                response.Redirect("/Review/ReviewOptions");
            }
            else
            {
                Session["OrderDetailID"] = orderDetails[(int)Session["Index"]].OrderDetailID;
                response.Gather(new Gather(action: "/Review/ChooseEdit", numDigits: 1)
                                .Say("you chose " + orderDetails[(int)Session["Index"]].Quantity + ", " + orderDetails[(int)Session["Index"]].Product.Description + ", size " + orderDetails[(int)Session["Index"]].Size.Size1
                                     + ". to change the quantity press 1, to change the size press 2, to delete this item from your cart "
                                     + "press 3, to hear the next item in your cart press 4, to checkout press 5, to return to the previous menu press 6, to return to "
                                     + "the main menu press 7.", voice: "alice", language: "en-US"));
                response.Redirect("/Review/ReviewEntireOrder");
            }
            return(TwiML(response));
        }
Beispiel #4
0
    static void Main()
    {
        var response = new VoiceResponse();

        response.Gather();

        Console.WriteLine(response.ToString());;
    }
        public TwiMLResult VerifyExpDate(string ccInfo, string digits)
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Checkout/ConfirmExpDate?ccInfo=" + ccInfo + "&expDate=" + digits, numDigits: 1)
                            .Say("You enterd, " + GetMonth(digits.Substring(0, 2)) + ". " + GetYear(digits.Substring(2, 2)) + " To confirm press 1, to try again press 2.", voice: "alice", language: "en-US"));
            response.Redirect("/Checkout/VerifyExpDate?ccInfo=" + ccInfo + "&digits=" + digits);
            return(TwiML(response));
        }
        public TwiMLResult EnterExpDate(string ccInfo)
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Checkout/VerifyExpDate?ccInfo=" + ccInfo, numDigits: 4)
                            .Say("Please enter the expiration date. enter 2 digits for the month, and 2 digits for the year", voice: "alice", language: "en-US"));
            response.Redirect("/Checkout/EnterExpDate?ccInfo=" + ccInfo);
            return(TwiML(response));
        }
        public TwiMLResult VerifySecurityCode(string ccInfo, string expDate, string digits)
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Checkout/ConfirmSecurityCode?ccInfo=" + ccInfo + "&expDate=" + expDate + "&code=" + digits, numDigits: 1)
                            .Say("You entered, " + LoopThroughDigits(digits) + ". To confirm, press 1. to re-enter security code, press 2.", voice: "alice", language: "en-US"));
            response.Redirect("/Checkout/VerifySecurityCode?ccInfo=" + ccInfo + "&expDate=" + expDate + "&digits=" + digits);
            return(TwiML(response));
        }
Beispiel #8
0
    private static void RenderMainMenu(VoiceResponse response)
    {
        response.Gather(
            new Gather(numDigits: 1)
            .Say("For sales, press 1. For support, press 2."));

        // If the user doesn't enter input, loop
        response.Redirect("/voice");
    }
Beispiel #9
0
        public TwiMLResult EditSize1()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Review/ReviewSize1", numDigits: 1)
                            .Say("Please enter a size code", voice: "alice", language: "en-US"));
            response.Redirect("/Review/EditSize1");
            return(TwiML(response));
        }
Beispiel #10
0
        public TwiMLResult EditQuantity1()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Review/ReviewQuantity1", numDigits: 2)
                            .Say("Please enter a quantity", voice: "alice", language: "en-US"));
            response.Redirect("/Review/EditQuantity1");
            return(TwiML(response));
        }
Beispiel #11
0
        public TwiMLResult EnterDetail()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Review/FindDetail", numDigits: 3)
                            .Say("please enter the item code of the item you want to edit.", voice: "alice", language: "en-US"));
            response.Redirect("Review/EnterDetail");
            return(TwiML(response));
        }
Beispiel #12
0
        public TwiMLResult ChooseSize(int pID)
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Sales/VerifySize?pID=" + pID, numDigits: 3)
                            .Say("Please enter a size code", voice: "alice", language: "en-US"));
            response.Redirect("/Sales/ChooseSize?pID=" + pID);
            return(TwiML(response));
        }
        public TwiMLResult EnterSecurityCode(string ccInfo, string expDate)
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Checkout/VerifySecurityCode?ccInfo=" + ccInfo + "&expDate=" + expDate, numDigits: 3)
                            .Say("Please enter the security code, which is the three digits on the back of the card", voice: "alice", language: "en-US"));
            response.Redirect("/Checkout/EnterSecurityCode?ccInfo=" + ccInfo + "&expDate=" + expDate);
            return(TwiML(response));
        }
        public TwiMLResult ChooseItem()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Sales/ChooseItem", numDigits: 3)
                            .Say("Please enter an item code.", voice: "alice", language: "en-US"));
            response.Redirect("/Welcome/ChooseItem");
            return(TwiML(response));
        }
Beispiel #15
0
        public TwiMLResult ChooseQuantity()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Sales/VerifyQuantity", numDigits: 2)
                            .Say("Please enter a quantity, and then press the pound key.", voice: "alice", language: "en-US"));
            response.Redirect("/Sales/ChooseQuantity");
            return(TwiML(response));
        }
        public ActionResult Incoming()
        {
            var response = new VoiceResponse();
            var gather   = new Gather(numDigits: 1, action: "/call/enqueue", method: "POST");

            gather.Say("For Programmable SMS, press one. For Voice, press any other key.");
            response.Gather(gather);

            return(TwiML(response));
        }
        public TwiMLResult Welcome()
        {
            var response = new VoiceResponse();
            var gather   = new Gather(action: Url.Action("Show", "Menu"), numDigits: 1);

            gather.Play("http://howtodocs.s3.amazonaws.com/et-phone.mp3", loop: 3);
            response.Gather(gather);

            return(TwiML(response));
        }
Beispiel #18
0
    static void Main()
    {
        var response = new VoiceResponse();
        var gather   = new Gather(action: "/completed", input: "speech");

        gather.Say("Welcome to Twilio, please tell us why you're calling");
        response.Gather(gather);

        System.Console.WriteLine(response.ToString());
    }
Beispiel #19
0
    static void Main()
    {
        var response = new VoiceResponse();
        var gather   = new Gather(input: "speech dtmf", numDigits: 1, timeout: 3);

        gather.Say("Please press 1 or say sales for sales.");
        response.Gather(gather);

        System.Console.WriteLine(response.ToString());
    }
        public ActionResult CollectZip()
        {
            var voiceResponse = new VoiceResponse();

            voiceResponse.Say("If you wish to call your senators, please " +
                              "enter your 5-digit zip code.");
            voiceResponse.Gather(numDigits: 5, action: "/callcongress/statelookup", method: "POST");

            return(TwiML(voiceResponse));
        }
Beispiel #21
0
    static void Main()
    {
        var response = new VoiceResponse();
        var gather   = new Gather(method: "GET", action: "/process_gather.php");

        gather.Say("Enter something, or not");
        response.Gather(gather);
        response.Redirect("/process_gather.php?Digits=TIMEOUT", method: "GET");

        System.Console.WriteLine(response.ToString());
    }
        public ActionResult Welcome(string fromState)
        {
            var voiceResponse = new VoiceResponse();

            if (!string.IsNullOrEmpty(fromState))
            {
                voiceResponse.Say("Thank you for calling congress! It looks like " +
                                  $"you\'re calling from {fromState}. " +
                                  "If this is correct, please press 1. Press 2 if " +
                                  "this is not your current state of residence.");
                voiceResponse.Gather(numDigits: 1, action: "/callcongress/setstate", method: "POST");
            }
            else
            {
                voiceResponse.Say("Thank you for calling Call Congress! If you wish to " +
                                  "call your senators, please enter your 5 - digit zip code.");
                voiceResponse.Gather(numDigits: 5, action: "/callcongress/statelookup", method: "POST");
            }
            return(TwiML(voiceResponse));
        }
Beispiel #23
0
        public TwiMLResult ChooseDelete1()
        {
            var         respone = new VoiceResponse();
            var         repo    = new ReviewRepository();
            OrderDetail od      = repo.GetOrderDetailByOrderDetailId((int)Session["OrderDetailID"]);

            respone.Gather(new Gather(action: "/Review/ConfirmDelete1", numDigits: 1)
                           .Say("You chose to delete " + od.Product.Description + " ,size " + od.Size.Size1 + " , from your order. to confirm press 1. to cancel "
                                + "press2", voice: "alice", language: "en-US"));
            respone.Redirect("/Review/ChooseDelete1");
            return(TwiML(respone));
        }
Beispiel #24
0
    static void Main()
    {
        var response = new VoiceResponse();
        var gather   = new Gather(action: "/process_gather.php", method: "GET");

        gather
        .Say("Please enter your account number,\nfollowed by the pound sign");
        response.Gather(gather);
        response.Say("We didn't receive any input. Goodbye!");

        System.Console.WriteLine(response.ToString());
    }
Beispiel #25
0
    public ActionResult Index()
    {
        var response = new VoiceResponse();

        // Use the <Gather> verb to collect user input
        response.Gather(new Gather(numDigits: 1)
                        .Say("For sales, press 1. For support, press 2."));
        // If the user doesn't enter input, loop
        response.Redirect("/voice");

        return(Content(response.ToString(), "text/xml"));
    }
Beispiel #26
0
        public TwiMLResult VerifyQuantity(string digits)
        {
            var         response = new VoiceResponse();
            var         repo     = new SalesRepository();
            OrderDetail detail   = repo.GetOrderDetailByOrderDetailId((int)Session["orderDetailId"]);

            if (repo.OutOfStock(detail.Product.ProductID, detail.Size.SizeID, int.Parse(digits)))
            {
                response.Gather(new Gather(action: "/Sales/NotEnoughStock?digi=" + digits, numDigits: 1)
                                .Say("There is not enough stock left in size " + detail.Size.Size1 + " for the quantity you chose, to choose a different Quantity press 1,"
                                     + " to delete this item press 2.", voice: "alice", language: "en-US"));
                response.Redirect("/Sales/VerifyQuantity?digits=" + digits);
            }
            else
            {
                response.Gather(new Gather(action: "/Sales/ConfirmQuantity?qty=" + digits, numDigits: 1)
                                .Say("You have chosen, " + digits + " ,items. To confirm press 1. to re-enter quantity press 2.", voice: "alice", language: "en-US"));
                response.Redirect("/Sales/VerifyQuantity?digits=" + digits);
            }
            return(TwiML(response));
        }
Beispiel #27
0
        public TwiMLResult ReviewOptions()
        {
            Session["Index"] = 0;
            // _index = 0;
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Review/ReviewChoice", numDigits: 1)
                            .Say("To review your entire order press 1, to review a specific item in your order press 2, to add an item to your order press 3,"
                                 + "to checkout items in your cart that were not paid for yet press 4, to return to the main menu press 5.", voice: "alice", language: "en-US"));
            response.Redirect("/Review/ReviewOptions");
            return(TwiML(response));
        }
        public TwiMLResult Welcome()
        {
            var response = new VoiceResponse();

            response.Gather(new Gather(action: "/Welcome/Menu", numDigits: 1, method: "GET")
                            // .Play("/Sound_Files/PracticeTwilio2.wav")
                            .Say("Welcome To the Berov am clothing Hotline. press 1 to start shopping, "
                                 + "press 2 to review a previous order, press 3 to hear deadline and pickup location, "
                                 + "press 4 to leave a message.", voice: "alice", language: "en-US"));
            response.Redirect("/Welcome/Welcome", method: "GET");
            return(TwiML(response));
        }
        public ActionResult Join()
        {
            var response = new VoiceResponse();

            response.Say("You are about to join the Rapid Response conference");
            response.Gather(new Gather(action: @Url.Action("Connect"))
                            .Say("Press 1 to join as a listener")
                            .Say("Press 2 to join as a speaker")
                            .Say("Press 3 to join as the moderator"));

            return(TwiML(response));
        }
Beispiel #30
0
        private TwiMLResult Planets()
        {
            var response = new VoiceResponse();
            var gather   = new Gather(action: Url.Action("Interconnect", "PhoneExchange"), numDigits: 1);

            gather.Say("To call the planet Broh doe As O G, press 2. To call the planet " +
                       "DuhGo bah, press 3. To call an oober asteroid to your location, press 4. To " +
                       "go back to the main menu, press the star key ",
                       voice: "alice", language: "en-GB", loop: 3);
            response.Gather(gather);

            return(TwiML(response));
        }