title: Twilio Voicemail
body: <p>I have been working on this little project for a few days now and I just think I need a little push in the right direction since I feel I am just running in circles.</p>
  
  <p>What I am trying to do is; once a client calls my support line and leaves a message, it puts this message into twilios recordings tab.  Thats perfect, I believe that is what I want.</p>
  
  <p>The next thing I need though is, I would like to use c# code to grab the recording and send it to multiple phone numbers sort of like a voicemail.  It is going to call everyone in the list until one of the people answers the call and listens to the recorded file.</p>
  
  <p>Currently all I have figured out is how to grab the record ID; I feel like this is the wrong way to do it though. How to I grab the said voice recorded file and send it to a cell phone.... Any help is appreciated</p>
  
  <pre><code> string ACCOUNT_SID = "AC2b69a2a2ef0a6c61674ace79d58737e4";
   string AUTH_TOKEN = "*********************";
   var client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
  
   var recordings = client.ListRecordings(null,DateTime.Today,null,null);
   foreach (var test in recordings.Recordings) {
        var t = test.Sid;
   }
  </code></pre>
  
  <p>This portion queries the database with everyone on the list and I just grab their cell numbers.</p>
  
  <pre><code> //Grabbing all employees on the support list
   List &lt;string&gt; persons = new List&lt;string&gt;();
   using (SqlConnection connection = new SqlConnection("Data Source=server/server;Initial Catalog=CompanyDirectory;Integrated Security=SSPI"))
   using (SqlCommand cmd = new SqlCommand("SELECT Cell FROM EmployeePhoneList WHERE IsEnabled = 1 ORDER BY NextToCall ASC", connection)) {
       connection.Open();
       using (SqlDataReader reader = cmd.ExecuteReader()) {
            if (reader.HasRows) {
                string p = "";
                while (reader.Read()) {
                    p = reader.GetString(reader.GetOrdinal("Cell"));                           
                    persons.Add(p);
                }
            }
       }
   }
  </code></pre>