2015-07-03 108 views
1

我一直在爲這個小項目工作幾天,現在我只是覺得我需要一點點正確的方向,因爲我覺得我只是在圈子裏跑。Twilio語音信箱

我想要做的是;一旦客戶撥打我的支持熱線並留言,它會將此消息放入twilios錄音選項卡中。這很完美,我相信這就是我想要的。

接下來我需要的是,我想用c#代碼來抓取錄音並將其發送到多個電話號碼,類似於語音郵件。它將打電話給列表中的每個人,直到其中一個人接聽電話並收聽錄製的文件。

目前我所知道的是如何獲取記錄ID;我覺得這是做錯的方法。如何我搶了上述聲音記錄文件,並將其發送到手機....任何幫助表示讚賞

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; 
} 

這部分查詢數據庫和大家一起就行了,我只是抓住他們的手機號碼。

//Grabbing all employees on the support list 
List <string> persons = new List<string>(); 
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); 
       } 
      } 
    } 
} 

回答

0

我在Twilio和開發者社區一起工作。

這聽起來像你在這裏需要的是Call Screening。在C#中也有一些例子。

希望這會有所幫助。