- public void device_CallEstablished(object sender, CallEstablishedEventArgs e)
- {
- //APICallAsync(e.ConnectedDevice.DeviceNumber, e.Line, false, DateTime.Now);
- if (e.ConnectedDevice.DeviceNumber[0] != '#' && e.ConnectedDevice.DeviceNumber.Length >= 4)
- {
- if (
- e.ControllerDevice.DialedDigits == "#840" ||
- e.ControllerDevice.DialedDigits == "#845" ||
- e.ControllerDevice.DialedDigits == "0130" ||
- e.ControllerDevice.DialedDigits == "" ||
- e.ControllerDevice.DialedDigits == "#848" ||
- e.ControllerDevice.DialedDigits == "#120")
- {
- APICallAsync(e.ConnectedDevice.DeviceNumber, e.Line, false, DateTime.Now);
- }
- else
- {
- DBContext dal = new DBContext();
- dal.InsertOutboundAsync(e.ConnectedDevice.DeviceNumber, e.Line);
- APICallAsync(e.ConnectedDevice.DeviceNumber, e.Line, true, DateTime.Now);
- }
- }
- if (menuEventsCallEstablished.Checked)
- {
- CallEventsListViewEventArgs args = new CallEventsListViewEventArgs(
- sender as Device, EVENT_NAME_CALL_ESTABLISHED,
- e.EventTime, string.Empty, e.DeviceNumber,
- string.Empty, string.Empty, string.Empty);
- UpdateCallEventsListViewWrapper(sender as Device, args);
- }
- }
Recent Pastes