public IActionResult Answer()
        {
            var TO_NUMBER     = Environment.GetEnvironmentVariable("TO_NUMBER") ?? "TO_NUMBER";
            var VONAGE_NUMBER = Environment.GetEnvironmentVariable("VONAGE_NUMBER") ?? "VONAGE_NUMBER";
            var host          = Request.Host.ToString();
            //Uncomment the next line if using ngrok with --host-header option
            //host = Request.Headers["X-Original-Host"];
            var sitebase = $"{Request.Scheme}://{host}";

            var recordAction = new RecordAction()
            {
                EventUrl    = new string[] { $"{sitebase}/recordcall/webhooks/recording" },
                EventMethod = "POST"
            };

            var connectAction = new ConnectAction()
            {
                From = VONAGE_NUMBER, Endpoint = new[] { new PhoneEndpoint {
                                                             Number = TO_NUMBER
                                                         } }
            };

            var ncco = new Ncco(recordAction, connectAction);

            return(Ok(ncco.ToString()));
        }
Exemple #2
0
        public RecordSelectForm(RecordType record, RecordAction action, User currentUser)
        {
            InitializeComponent();
            activeUser = currentUser;
            Type       = record;
            Action     = action;


            switch (record)
            {
            case RecordType.Customer:
                headerLabel.Text = "Select Customer";
                RefreshList(customers, "CustomerName", "CustomerId");
                break;

            case RecordType.Appointment:
                headerLabel.Text = "Select Appointment";
                RefreshList(appointments, "ApptSelectDisplay", "AppointmentId");
                break;

            case RecordType.User:
                headerLabel.Text = "Select Consultant";
                RefreshList(users, "Username", "userId");
                break;

            case RecordType.Month:
                headerLabel.Text = "Select Month";
                string[] names = DateTimeFormatInfo.CurrentInfo.MonthNames;
                Array.Resize(ref names, 12);
                selectionBox.Items.AddRange(names);
                break;
            }
        }
Exemple #3
0
        public void DoPhonesAction(RecordAction action, GDMTag itemTag)
        {
            string val;

            switch (action)
            {
            case RecordAction.raAdd:
                val = "";
                if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Telephone), ref val))
                {
                    fAddress.AddPhoneNumber(val);
                }
                break;

            case RecordAction.raEdit:
                val = itemTag.StringValue;
                if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Telephone), ref val))
                {
                    itemTag.StringValue = val;
                }
                break;

            case RecordAction.raDelete:
                fAddress.PhoneNumbers.Delete(itemTag);
                break;
            }
            UpdateLists();
        }
Exemple #4
0
        private Response OnAnswerRecordingSplitAudio()
        {
            string TO_NUMBER    = "TO_NUMBER";
            string NEXMO_NUMBER = "NEXMO_NUMBER";

            var recordAction = new RecordAction()
            {
                Split    = "conversation",
                Channels = 2,
                EventUrl = new [] { $"{SiteBase}/webhook/record" }
            };
            var phoneEndpoint = new PhoneEndpoint()
            {
                Number = TO_NUMBER
            };
            var connectAction = new ConnectAction()
            {
                From     = NEXMO_NUMBER,
                Endpoint = new [] { phoneEndpoint }
            };

            var ncco = new Ncco(recordAction, connectAction);

            return(ncco.ToString());
        }
Exemple #5
0
        public IActionResult Answer()
        {
            var TO_NUMBER     = Environment.GetEnvironmentVariable("TO_NUMBER") ?? "TO_NUMBER";
            var VONAGE_NUMBER = Environment.GetEnvironmentVariable("VONAGE_NUMBER") ?? "VONAGE_NUMBER";
            var host          = Request.Host.ToString();
            //Uncomment the next line if using ngrok with --host-header option
            //host = Request.Headers["X-Original-Host"];

            var eventUrl   = $"{Request.Scheme}://{host}/SplitAudio/webhooks/recording";
            var talkAction = new TalkAction {
                Text = "recording call", BargeIn = "false"
            };
            var recordAction = new RecordAction()
            {
                EventUrl    = new string[] { eventUrl },
                EventMethod = "POST",
                Channels    = 2,
                Split       = "conversation"
            };

            var connectAction = new ConnectAction()
            {
                From     = VONAGE_NUMBER,
                Endpoint = new[] { new PhoneEndpoint {
                                       Number = TO_NUMBER
                                   } },
            };

            var ncco = new Ncco(talkAction, recordAction, connectAction);

            return(Ok(ncco.ToString()));
        }
Exemple #6
0
 public ScheduleId(string id, DateTime runsFrom, StpIndicator stp, RecordAction action)
 {
     TimetableUid = id;
     StpIndicator = stp;
     Action       = action;
     RunsFrom     = runsFrom;
 }
        public void DoMailsAction(RecordAction action, GDMTag itemTag)
        {
            string val;

            switch (action)
            {
            case RecordAction.raAdd:
                val = "";
                if (AppHost.StdDialogs.GetInput(fView, LangMan.LS(LSID.LSID_Mail), ref val))
                {
                    fAddress.AddEmailAddress(val);
                }
                break;

            case RecordAction.raEdit:
                val = itemTag.StringValue;
                if (AppHost.StdDialogs.GetInput(fView, LangMan.LS(LSID.LSID_Mail), ref val))
                {
                    itemTag.StringValue = val;
                }
                break;

            case RecordAction.raDelete:
                fAddress.EmailAddresses.Delete(itemTag);
                break;
            }
            UpdateLists();
        }
        private void GuardarBtn_Click(object sender, EventArgs e)
        {
            ClienteDTO recordActual = new ClienteDTO {
                Idcliente = currentcliente.Idcliente, Credito = this.checkBox1.Checked, Debito = this.checkBox2.Checked, Direccion = textBox4.Text, Nombre = this.textBox2.Text, Telefono = textBox3.Text, Identificacion = comboBox1.Text + textBox1.Text
            };

            if (validarRegistro(recordActual) == "")
            {
                status = RecordAction.Save;
                ActivarBotonesEdicion();
                Auxiliares(false);

                if (status == RecordAction.Insert)
                {
                    cli.Insert(recordActual);
                }
                if (status == RecordAction.Update)
                {
                    cli.Edit(recordActual);
                }

                status = RecordAction.None;
            }
            else
            {
                Utilities.Mensaje(errorBar1, validarRegistro(recordActual), errorType.Error);
            }
        }
Exemple #9
0
 private void Deshacer_Click(object sender, EventArgs e)
 {
     previo = RecordAction.None;
     Auxiliares(false);
     ActivarBotonesEdicion();
     status = RecordAction.Undo;
 }
 /* Set Role For User*/
 public JsonResult CreateStaff(int Id, string Role)
 {
     CustomerAction.Create_Staff(Id, Role);
     //return Redirect("~/Customer/Index/" + Session["id"]);
     RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " update role " + Role + "  for account " + CustomerAction.Find_Customer(Id).email, DateTime.Now.Date);
     return(Json(JsonRequestBehavior.AllowGet));
 }
        public void DoWebsAction(RecordAction action, GEDCOMTag itemTag)
        {
            string val;

            switch (action)
            {
            case RecordAction.raAdd:
                val = "";
                if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_WebSite), ref val))
                {
                    fAddress.AddWebPage(val);
                }
                break;

            case RecordAction.raEdit:
                val = itemTag.StringValue;
                if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_WebSite), ref val))
                {
                    itemTag.StringValue = val;
                }
                break;

            case RecordAction.raDelete:
                fAddress.WebPages.Delete(itemTag);
                break;
            }
            UpdateLists();
        }
Exemple #12
0
 private void Deshacer_Click(object sender, EventArgs e)
 {
     status = RecordAction.None;
     Auxiliares(false);
     ActivarBotonesEdicion();
     Utilities.Controles(this, "Lock");
 }
Exemple #13
0
 private void AgregarBtn_Click(object sender, EventArgs e)
 {
     status = RecordAction.Insert;
     DesactivarBotonesEdicion();
     Auxiliares(true);
     Utilities.Controles(this, "Unlock");
 }
 public ActionResult Register(string Email, string First_Name, string Last_Name,
                              string Phone, string Address, string Date_Birth, string Gender, string Password)
 {
     CustomerAction.Create_Customer(Email, First_Name, Last_Name, Address, Phone, Password, Date_Birth, Gender);
     RecordAction.Create_Record(Email, Email + " create account.", DateTime.Now.Date);
     return(Redirect("~/Book/ShowBook"));
 }
Exemple #15
0
        public void NotifyRecord(IBaseWindow baseWin, object record, RecordAction action)
        {
            GDMRecord gRecord = record as GDMRecord;

            if (gRecord == null)
            {
                return;
            }

            string recName = GKUtils.GetRecordName(gRecord, false);

            int index = Find(gRecord);

            if (index >= 0)
            {
                fChangedRecords.RemoveAt(index);
            }

            switch (action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                fChangedRecords.Add(new RecordInfo(action, gRecord.XRef, recName, gRecord.RecordType, gRecord));
                break;

            case RecordAction.raDelete:
                fChangedRecords.Add(new RecordInfo(action, gRecord.XRef, recName, gRecord.RecordType, null));
                break;
            }
        }
Exemple #16
0
 private void EditarBtn_Click(object sender, EventArgs e)
 {
     previo = RecordAction.Update;
     status = RecordAction.Update;
     DesactivarBotonesEdicion();
     Auxiliares(true);
 }
Exemple #17
0
        public IActionResult Answer()
        {
            var host = Request.Host.ToString();
            //Uncomment the next line if using ngrok with --host-header option
            //host = Request.Headers["X-Original-Host"];
            var sitebase       = $"{Request.Scheme}://{host}";
            var outGoingAction = new TalkAction()
            {
                Text = "Please leave a message after the tone, then press #. We will get back to you as soon as we can"
            };
            var recordAction = new RecordAction()
            {
                EventUrl     = new string[] { $"{sitebase}/recordmessage/webhooks/recording" },
                EventMethod  = "POST",
                EndOnSilence = "3",
                EndOnKey     = "#",
                BeepStart    = "true"
            };
            var thankYouAction = new TalkAction {
                Text = "Thank you for your message. Goodbye"
            };
            var ncco = new Ncco(outGoingAction, recordAction, thankYouAction);

            return(Ok(ncco.ToString()));
        }
 public ActionResult EditCustomer(int Id, string Email, string Password, string First_name, string Last_name, string Address,
                                  string Phone, string Date_Birth, string Gender)
 {
     ViewBag.ID = Id;
     CustomerAction.Edit_Customer(Id, Email, First_name, Last_name, Password, Phone, Date_Birth, Gender, Address);
     RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " update infomation.", DateTime.Now.Date);
     return(Redirect("~/Customer/Index/" + Session["id"]));
 }
Exemple #19
0
 public RecordInfo(RecordAction action, string xref, string name, GDMRecordType type, GDMRecord record)
 {
     Action = action;
     XRef   = xref;
     Name   = name;
     Type   = type;
     Record = record;
     Time   = DateTime.Now;
 }
 /* DELETE CUSTOMER */
 public ActionResult DeleteCustomer(int Id)
 {
     if (Id != 0)
     {
         CustomerAction.Delete_Customer(Id);
         RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " lock account " + CustomerAction.Find_Customer(Id).email, DateTime.Now.Date);
         return(Redirect("~/Customer/Index/"));
     }
     return(Redirect("~/Customer/Index/"));
 }
 /* RESTORE CUSTOMERS WERE DELETED */
 public ActionResult UnLockCustomer(int Id)
 {
     if (Id != 0)
     {
         CustomerAction.UnLock(Id);
         RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " unlock account " + CustomerAction.Find_Customer(Id).email, DateTime.Now.Date);
         return(Redirect("~/Home/RestoreData"));
     }
     return(Redirect("~/Customer/Index/"));
 }
Exemple #22
0
        public void NotifyRecord(IBaseWindow baseWin, object record, RecordAction action)
        {
            if (baseWin == null || record == null)
            {
                return;
            }

            string baseName = baseWin.Context.FileName;

            fData[baseName].NotifyRecord(baseWin, record, action);
        }
Exemple #23
0
        private void AgregarBtn_Click(object sender, EventArgs e)
        {
            previo = RecordAction.Insert;
            DesactivarBotonesEdicion();
            status = RecordAction.Insert;

            Auxiliares(true);
            Form Parent = new Form();

            Parent.SelectNextControl(Parent.Parent, true, true, true, true);
        }
Exemple #24
0
        public void NotifyRecord(GDMRecord record, RecordAction action)
        {
            if (record == null)
            {
                return;
            }

            DateTime dtNow = DateTime.Now;

            switch (action)
            {
            case RecordAction.raAdd:
            case RecordAction.raEdit:
                record.ChangeDate.ChangeDateTime = dtNow;
                CheckChangedRecord(record, true);
                break;

            case RecordAction.raDelete:
            {
                CheckChangedRecord(record, false);

                IListView rView = GetRecordsViewByType(record.RecordType);
                if (rView != null)
                {
                    rView.DeleteRecord(record);

                    IHyperView hView = GetHyperViewByType(record.RecordType);
                    if ((hView != null) && (rView.ListMan.FilteredCount == 0))
                    {
                        hView.Lines.Clear();
                    }
                }
            }
            break;

            case RecordAction.raJump:
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
                break;
            }

            if (action != RecordAction.raJump)
            {
                fContext.Tree.Header.TransmissionDateTime = dtNow;
                fContext.Modified = true;

                AppHost.Instance.NotifyRecord(fView, record, action);
            }
        }
Exemple #25
0
        /* ------------------------------------------------------------- */



        /* UPDATE IMAGE BOOK */
        public ActionResult UpdateImg(int Id, HttpPostedFileBase File)
        {
            string path = "";

            if (File.ContentLength > 0)
            {
                string File_Name = Path.GetFileName(File.FileName);
                path = Path.Combine(Server.MapPath("~/UploadFiles"), File_Name);
                File.SaveAs(path);
                BookAction.Update_Img(Id, File_Name);
            }
            RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " change image from " + BookAction.Find_Book(Id).ten_sach, DateTime.Now.Date);
            return(Redirect("~/Book/BookDetail/" + Id));
        }
Exemple #26
0
 /* Show Record And Auto Delete Record After 3 Days */
 public ActionResult RecordUser()
 {
     if ((string)Session["role"] == "admin")
     {
         int page = RecordAction.ShowAll().Count;
         RecordAction.Auto_Delete_Record(3); // Set 3 Days Auto Delete Record
         ViewBag.Page = page / page_size + (page % page_size == 0 ? 0 : 1);
         return(View());
     }
     else
     {
         return(Redirect("~/Book/ShowBook"));
     }
 }
Exemple #27
0
        public ActionResult CreateBook(string Ten_Sach, string Tac_Gia, string The_Loai, string Nha_Xuat_Ban, string Mo_Ta, double Gia_Ban, HttpPostedFileBase File)
        {
            Book   book = new Book();
            string path = "";

            if (File.ContentLength > 0)
            {
                string File_Name = Path.GetFileName(File.FileName);
                path = Path.Combine(Server.MapPath("~/UploadFiles"), File_Name);
                File.SaveAs(path);
                BookAction.Create_Book(Ten_Sach, Tac_Gia, The_Loai, Nha_Xuat_Ban, Mo_Ta, Gia_Ban, File_Name);
            }
            RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " create new book.", DateTime.Now.Date);
            return(Redirect("~/Book/CreateBook"));
        }
Exemple #28
0
        private void BorrarBtn_Click(object sender, EventArgs e)
        {
            previo = RecordAction.None;
            var resp = MessageBox.Show("Confirma Borrado?", "Confirmación", MessageBoxButtons.YesNo);

            if (resp == DialogResult.Yes)
            {
                confirma = true;
            }
            else
            {
                confirma = false;
            }
            status = RecordAction.Delete;
        }
Exemple #29
0
 /// <summary>
 /// 添加录制动作
 /// </summary>
 /// <param name="recordAction">录制指令</param>
 /// <param name="pms">指令参数</param>
 public static void addAction(RecordAction recordAction, string pms)
 {
     if (instance != null)
     {
         if (!instance.isPageRecording)
         {
             return;
         }
         instance.tempRecordQueue.Add(new RecordItem
         {
             slideTime = instance.slideTime,
             ra        = recordAction,
             raParams  = pms
         });
     }
 }
Exemple #30
0
 private void EditarBtn_Click(object sender, EventArgs e)
 {
     if (currentcliente != null)
     {
         if (currentcliente.Idcliente != -1)
         {
             status = RecordAction.Update;
             DesactivarBotonesEdicion();
             Auxiliares(true);
             Utilities.Controles(this, "Unlock");
         }
         else
         {
             Utilities.Mensaje(errorBar1, "Debe seleccionar un usuario", errorType.Info);
         }
     }
 }
Exemple #31
0
 public SequenceEvent(object source, RecordAction action)
     : base(source, action.ToString())
 {
     this._action = action;
 }