---
title: "Twilio inbound call handling"  
description: "Twilio inbound call handling"  
author: "Jack C"  
published: 2010-10-18  
updated: 2010-10-20  
canonical: https://www.mindstick.com/forum/50/twilio-inbound-call-handling  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# Twilio inbound call handling

Hi,\
\
I am using Twilio [service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities) to [handle](https://www.mindstick.com/articles/311004/suede-skillet-handle-cover) inbound call to a number, but I'm unable to do that.\
You can find more about Twilio [api](https://www.mindstick.com/articles/12641/instagram-api-upgraded-to-facebook-graph) at http://www.twilio.com/.\
\
Please help its urgent.

## Replies

### Reply by Anonymous User

Hello Jack,\
\
You can do this by simply creating an .aspx page. Write the following code to accomplish your goal.\
\

```
string strxml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";     protected void Page_Load(object sender, EventArgs e)     {                HttpContext current = HttpContext.Current;          string pollId = null;         string msg;         if (!string.IsNullOrEmpty(current.Request.Form["Digits"]))         {             pollId = current.Request.Form["Digits"];             if (pollId == "1")             {                 msg = "You will get the list of latest offer soon. Thanks for calling mindstick.";                 current.Response.Write(strxml + @"<Response><Say voice='woman'>" + msg + @"</Say><Sms>We are processing your request. Thanks for calling MindStick.</Sms></Response>");             }             else if (pollId == "2")             {                 msg = "This is not the right time to talk to our experts, please call later. Thanks for calling mindstick.";                 current.Response.Write(strxml + @"<Response><Say voice='woman'>" + msg + @"</Say></Response>");             }             else             {                 msg = "You have provide the wrong input. Please provide correct input.Please press 1 for latest offers and press 2 to talk to our experts.";                 poll(current, msg);             }         }         if (string.IsNullOrEmpty(pollId))         {              string introMsg = "Welcome to MindStick Software. Please press 1 for latest offers and press 2 to talk to our experts.";             poll(current, introMsg);         }     }     protected void poll(HttpContext current, string introMsg)     {         string actionSelf = current.Request.Url.ToString().Replace(":" + current.Request.Url.Port.ToString(), "");                current.Response.Write(strxml + @"<Response><Say voice='woman'>Welcome.</Say><Gather method = 'Post' numDigits='1' action ='" + actionSelf + "'><Say voice='woman'>" + introMsg + @"</Say></Gather></Response>");         return;     }
```

You can make changes in the message according to your needs.\
\
Now, host this page on your server and give the address of this web page in Twilio Voice URL.\
\
Now call the Twilio Number and check.\
\
\
\


---

Original Source: https://www.mindstick.com/forum/50/twilio-inbound-call-handling

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
