public void CallSave(ref Call phoneCall)
 {
     StoredProcedure proc = new StoredProcedure(SQLResource.ProcessTwilioCall, this.ConnectionString);
     proc.Parameters.AddWithValue("@CallSID", phoneCall.Sid);
     proc.Parameters.AddWithValue("@ParentCallSID", phoneCall.ParentCallSid ?? string.Empty);
     proc.Parameters.AddWithValue("@PhoneNumberSID", phoneCall.PhoneNumberSid);
     proc.Parameters.AddWithValue("@To", phoneCall.To);
     proc.Parameters.AddWithValue("@From", phoneCall.From);
     proc.Parameters.AddWithValue("@Status", phoneCall.Status);
     proc.Parameters.AddWithValue("@StartTime", phoneCall.StartTime);
     proc.Parameters.AddWithValue("@EndTime", phoneCall.EndTime);
     proc.Parameters.AddWithValue("@Duration", phoneCall.Duration);
     proc.Parameters.AddWithValue("@Direction", phoneCall.Direction);
     proc.Parameters.AddWithValue("@DateCreated", phoneCall.DateCreated);
     proc.Parameters.AddWithValue("@DateUpdated", phoneCall.DateUpdated);
     proc.ExecuteNonQuery();
 }
예제 #2
0
        private static string GetCallStatus(Call activeCall)
        {
            string accountSid = "ACa2de2b9a03db42ee981073b917cc8132";
            string authToken = "921a664399748302a019ee35c40e888c";

            TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
            var call = client.GetCall(activeCall.Sid);
            return call.Status;
        }
 public static void Save(Call phoneCall, IExternalDataProvider dataProvider)
 {
     dataProvider.CallSave(ref phoneCall);
 }
예제 #4
0
        private static int GetCallDuration(Call activeCall)
        {
            string accountSid = "ACa2de2b9a03db42ee981073b917cc8132";
            string authToken = "921a664399748302a019ee35c40e888c";

            TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
            var call = client.GetCall(activeCall.Sid);
            return call.Duration.HasValue ? call.Duration.Value : 0;
        }
예제 #5
0
 public LocationalCall(Call call)
 {
     Sid = call.Sid;
     From = call.From;
     DateCreated = call.DateCreated;
 }