/// <summary> /// Handles the Click event of the Right control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void Right_Click(object sender, RoutedEventArgs e) { Button tempbtn = sender as Button; if (tempbtn.Content.ToString().Contains("Reject")) { string a = _dataContext.DialedNumbers; if (!string.IsNullOrEmpty(_dataContext.ThridpartyDN)) { if (_dataContext.ThisDN == _dataContext.ThridpartyDN) { logger.Warn("Redirect DN and This DN are same."); } else { SoftPhone softRedirect = new SoftPhone(); softRedirect.Redirect(_dataContext.ThridpartyDN); } } _dataContext.CallTypeStatus = string.Empty; } else if (tempbtn.Content.ToString().Contains("Accept")) { SoftPhone softAnswer = new SoftPhone(); softAnswer.Answer(); } base.stayOpenTimer.Stop(); base.DisplayState = Pointel.TaskbarNotifier.TaskbarNotifier.DisplayStates.Hiding; }
/// <summary> /// Sends the record processed. /// </summary> private void SendRecordProcessed(KeyValueCollection updateUserEventData) { try { if (updateUserEventData == null || _datacontext.userAttachData == null) { return; } if (_datacontext.userAttachData.ContainsKey("GSW_AGENT_REQ_TYPE") && updateUserEventData.ContainsKey("GSW_AGENT_REQ_TYPE")) { _datacontext.userAttachData["GSW_AGENT_REQ_TYPE"] = "RecordProcessed"; updateUserEventData["GSW_AGENT_REQ_TYPE"] = "RecordProceed"; var soft = new SoftPhone(); OutputValues output = soft.UpdateOCSCallData(_updateUserEventData); if (output.MessageCode == "200") { _logger.Info("OCS Call Data Updated Successfully...."); } } } catch (Exception generalException) { _logger.Error("Error occurred SendRecordProcessed() : " + generalException.ToString()); } }
/// <summary> /// Handles the RowEditEnding event of the DGAttachData control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs"/> instance containing the event data.</param> private void DGAttachData_RowEditEnding(object sender, Microsoft.Windows.Controls.DataGridRowEditEndingEventArgs e) { try { Microsoft.Windows.Controls.DataGridRow dgRow = e.Row; if (dgRow != null) { var selectedCallData = dgRow.Item as CallData; string key = selectedCallData.Key.ToString().Trim(); string value = selectedCallData.Value.ToString().Trim(); var updateCallData = new SoftPhone(); if (_dataContext.userAttachData.ContainsKey(key)) { string originalValue = _dataContext.userAttachData[key]; if (value != originalValue) { _dataContext.userAttachData.Remove(key); _dataContext.userAttachData.Add(key, value); updateCallData.UpdateUserData(_dataContext.userAttachData); } } BindGrid(); } } catch (Exception ex) { _logger.Error("Error occurred as " + ex.Message); } }
/// <summary> /// Handles the Click event of the btnUpdate control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void btnUpdate_Click(object sender, RoutedEventArgs e) { try { var selectedCallData = DGAttachData.SelectedCells[0].Item as CallData; string key = selectedCallData.Key.ToString().Trim(); string value = selectedCallData.Value.ToString().Trim(); var updateCallData = new SoftPhone(); if (_dataContext.userAttachData.ContainsKey(key)) { string originalValue = _dataContext.userAttachData[key]; if (value != originalValue) { _dataContext.userAttachData.Remove(key); _dataContext.userAttachData.Add(key, value); updateCallData.UpdateUserData(_dataContext.userAttachData); } } BindGrid(); } catch (Exception commonException) { _logger.Error("Error occurred as " + commonException.Message); } }
/// <summary> /// Handles the Click event of the Left control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void Left_Click(object sender, RoutedEventArgs e) { SoftPhone softAnswer = new SoftPhone(); softAnswer.Answer(); base.stayOpenTimer.Stop(); base.DisplayState = Pointel.TaskbarNotifier.TaskbarNotifier.DisplayStates.Hiding; }
private void btnClose_Click(object sender, RoutedEventArgs e) { if (this.Call != null) { SoftPhone.TerminateCall(this.Call); } this.Close(); }
void Softphone_IncomingCall(object sender, Ozeki.VoIP.VoIPEventArgs <Ozeki.VoIP.IPhoneCall> e) { if (_currentModel == null) { return; } SoftPhone.SetModel(_currentModel.AudioSender, _currentModel.VideoSender); }
private void btnAppend_Click(object sender, RoutedEventArgs e) { if (this.Call != null) { //SoftPhone.ReceiveOrResumeCall(this.Call); SoftPhone.ReceiveCall(this.Call); } this.Close(); }
void SipRegistrationButton_Click(object sender, RoutedEventArgs e) { if (AccountModel == null) { return; } SoftPhone.RegisterSipAccount(AccountModel); OnPropertyChanged("SoftPhone"); }
void CallButton_Click(object sender, RoutedEventArgs e) { if (_currentModel == null) { return; } SoftPhone.SetModel(_currentModel.AudioSender, _currentModel.VideoSender); SoftPhone.StartCall(SoftPhone.SelectedDial); }
/// <summary> /// Handles the Click event of the Number control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void Number_Click(object sender, RoutedEventArgs e) { Button number = sender as Button; string dialedDigit = number.Content.ToString(); //typednumber.Append(dialedDigit); _dataContext.DialedDigits = _dataContext.DialedDigits.Trim(); if (string.IsNullOrEmpty(_dataContext.DialedDigits)) { _dataContext.DialedDigits = dialedDigit; } else { _dataContext.DialedDigits += dialedDigit; } if (_dataContext.DialedDigits.Length > 9 && txtNumbers.FontSize > 26.75) { txtNumbers.FontSize = txtNumbers.FontSize - 2.75; } else if (_dataContext.DialedDigits.Length <= 9) { if (txtNumbers.FontSize != 35) { txtNumbers.FontSize = 35; } } else { _dataContext.DialedDigits += " "; } SoftPhone softPhone = new SoftPhone(); OutputValues output = softPhone.DtmfSend(dialedDigit); if (output.MessageCode == "200") { //_dataContext.StatusMessage = output.Message.ToString(); } else if (output.MessageCode == "2001") { //_dataContext.StatusMessage = output.Message.ToString(); //lblStatus.Foreground = Brushes.Red; } if (txtNumbers.Text.Length >= 0) { txtNumbers.SelectionStart = txtNumbers.Text.Length - 1; txtNumbers.SelectionLength = 0; txtNumbers.UpdateLayout(); } }
void Model_AlarmEvent(object sender, EventArgs e) { if (_currentModel != null) { SoftPhone.SetModel(_currentModel.AudioSender, _currentModel.VideoSender); } InvokeGuiThread(() => { if (AlarmCallCheckBox.IsChecked != null && (bool)AlarmCallCheckBox.IsChecked) { if (SoftPhone != null) { Task.Factory.StartNew(SoftPhone.StartAlarmCalls); } } }); }
void MainWindow_OnClosing(object sender, CancelEventArgs e) { if (SoftPhone != null) { SoftPhone.CloseCall(); SoftPhone.CloseAlarmCalls(); } foreach (var camera in ModelList) { camera.Disconnect(); camera.Close(); } foreach (var viewer in _videoViewerList.Where(viewer => viewer.Model != null)) { viewer.Model.Disconnect(); viewer.Model.Close(); } }
private object InitalizeProcess() { CloudLog.Debug("{0} Initializing has started...", GetType().Name); var sw = new Stopwatch(); sw.Start(); if (!string.IsNullOrEmpty(_username)) { var logonResponse = Request("Logon", new { User = _username, Password = _password }); Debug.WriteSuccess(GetType().Name + " Login Response", logonResponse); } if (_components.Count == 0) { CloudLog.Debug("{0} has no component details... requesting...", GetType().Name); var response = Request("Component.GetComponents", null); CloudLog.Debug("QsysCore has received list of user defined components, count = {0}", response.Result.Children().Count()); foreach (var component in response.Result.Children()) { CloudLog.Debug("QsysCore has compononent \"{0}\"", component["Name"].Value <string>()); } foreach (var component in response.Result.Children() .Where(c => _userDefinedComponentNames.Contains(c["Name"].Value <string>()))) { var name = component["Name"].Value <string>(); if (_components.ContainsKey(name)) { continue; } switch (component["Type"].Value <string>()) { case "audio_file_player": _components[name] = new AudioFilePlayer(this, component); break; case "mixer": _components[name] = new Mixer(this, component); break; case "system_mute": case "gain": _components[name] = new Gain(this, component); break; case "scriptable_controls": _components[name] = new ScriptableControls(this, component); break; case "snapshot_controller": _components[name] = new SnapshotController(this, component); break; case "softphone": _components[name] = new SoftPhone(this, component); break; case "pots_control_status_core": _components[name] = new PotsPhone(this, component); break; case "signal_presence": _components[name] = new SignalPresence(this, component); break; case "sine": _components[name] = new Sine(this, component); break; case "router_with_output": _components[name] = new RouterWithOutput(this, component); break; case "io_status": _components[name] = new IoStatus(this, component); break; default: _components[name] = new GenericComponent(this, component); break; } } } else { CloudLog.Debug("{0} has component details... updating...", GetType().Name); foreach (var component in this) { component.UpdateAsync(); } } _initialized = true; sw.Stop(); CloudLog.Debug("{0} has initialized, process time = {1}", GetType().Name, sw.Elapsed); OnHasIntitialized(this); DefaultChangeGroup.PollAuto(1.0); return(null); }
/// <summary> /// Handles the Click event of the btnOk control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void btnOk_Click(object sender, RoutedEventArgs e) { try { if (cbQueue.Text != "" && _dataContext.LoadCollection.FindIndex(x => x.Equals(cbQueue.Text, StringComparison.OrdinalIgnoreCase)) != -1) { OutputValues loginResponse = null; _dataContext.AgentPassword = txtAgentPassword.Password.ToString(); string workMode = "optional"; string switchtype = "avaya"; if (_dataContext.SwitchName.ToLower().Contains("nortel")) { switchtype = "nortel"; } var softLogin = new SoftPhone(); if (!_dataContext.IsTserverConnected) { var media = (Datacontext.AvailableServerDic.Where(x => x.Value == Genesyslab.Platform.Configuration.Protocols.Types.CfgAppType.CFGTServer.ToString())).ToDictionary(x => x.Key, y => y.Value); if (media == null) { return; } if (media.Count > 0) { if (Datacontext.TServersSwitchDic.ContainsKey(Datacontext.UsedTServerSwitchDBId) && media.Any(x => (x.Key.ToString().Split(','))[0].Trim() == Datacontext.TServersSwitchDic[Datacontext.UsedTServerSwitchDBId])) { var tserverName = media.Where(x => (x.Key.ToString().Split(','))[0].Trim() == Datacontext.TServersSwitchDic[Datacontext.UsedTServerSwitchDBId]).FirstOrDefault().Key; loginResponse = softLogin.Initialize(_dataContext.Place, _dataContext.UserName, _configContainer.ConfServiceObject, tserverName, _dataContext.AgentLoginId, _dataContext.AgentPassword, _dataContext.SwitchType); if (loginResponse.MessageCode != "200") { goto End; } } } else { _logger.Error("LogonInfo btnOk_Click: " + "T-server not configured"); goto End; } } loginResponse = softLogin.Login(_dataContext.Place, _dataContext.UserName, workMode, _dataContext.Queue, _dataContext.AgentLoginId, _dataContext.AgentPassword); if (loginResponse.MessageCode == "200") { if (_configContainer.AllKeys.Contains("login.voice.enable.auto-ready") && ((string)_configContainer.GetValue("login.voice.enable.auto-ready")).ToLower().Equals("true")) { var softReady = new SoftPhone(); softReady.Ready(); } _logger.Debug("Agent Login Successful"); } else if (loginResponse.MessageCode == "2001" || loginResponse.MessageCode == "2002") { _logger.Error(" LogonInfo btnOk_Click:" + loginResponse.Message); } else if (loginResponse.MessageCode == "2004") { if (_view != null) { _view.PlaceAlreadyTaken(loginResponse); } } End: _logger.Debug("LogonInfo btnok_click : Login using Place : " + _dataContext.Place + " Username : "******" Queue : " + _dataContext.QueueSelectedValue + " Application : " + _dataContext.ApplicationName + " LoginID : " + _dataContext.AgentLoginId); this.Close(); _dataContext.IsLogonInfoOpened = false; } } catch (Exception commonException) { _logger.Error("btnOk_Click:" + commonException.ToString()); } }
/// <summary> /// Prepares the user data. /// </summary> private void PrepareUserData() { string finalDateTime = string.Empty; try { _updateUserEventData.Clear(); if (_datacontext.userAttachData.ContainsKey("GSW_RECORD_HANDLE")) { if (!_updateUserEventData.ContainsKey("GSW_RECORD_HANDLE")) { _updateUserEventData.Add("GSW_RECORD_HANDLE", Convert.ToInt32(_datacontext.userAttachData["GSW_RECORD_HANDLE"])); } else { _logger.Debug("PrepareUserData : GSW_RECORD_HANDLE is null"); } } if (_datacontext.userAttachData.ContainsKey("GSW_APPLICATION_ID")) { if (!_updateUserEventData.ContainsKey("GSW_APPLICATION_ID")) { _updateUserEventData.Add("GSW_APPLICATION_ID", Convert.ToInt32(_datacontext.userAttachData["GSW_APPLICATION_ID"])); } else { _logger.Debug("PrepareUserData : GSW_APPLICATION_ID is null"); } } if (_datacontext.userAttachData.ContainsKey("GSW_CAMPAIGN_NAME")) { if (!_updateUserEventData.ContainsKey("GSW_CAMPAIGN_NAME")) { _updateUserEventData.Add("GSW_CAMPAIGN_NAME", Convert.ToInt32(_datacontext.userAttachData["GSW_CAMPAIGN_NAME"])); } else { _logger.Debug("PrepareUserData : GSW_CAMPAIGN_NAME is null"); } } if (chkbxPersonalCallback.IsChecked == true) { if (!_updateUserEventData.ContainsKey("PHSPCB")) { _updateUserEventData.Add("PHSPCB", "1"); } } else { if (!_updateUserEventData.ContainsKey("PHSPCB")) { _updateUserEventData.Add("PHSPCB", "0"); } } if (!_updateUserEventData.ContainsKey("GSW_CALLBACK_TYPE")) { _updateUserEventData.Add("GSW_CALLBACK_TYPE", "Campaign"); } if (_datacontext.userAttachData.ContainsKey("GSW_CALLING_LIST")) { if (!_updateUserEventData.ContainsKey("GSW_CALLING_LIST")) { _updateUserEventData.Add("GSW_CALLING_LIST", Convert.ToInt32(_datacontext.userAttachData["GSW_CALLING_LIST"])); } else { _logger.Debug("PrepareUserData : GSW_CALLING_LIST is null"); } } if (chkbxRescheduleCall.IsChecked == true) { DateTime dt = new DateTime(); dt = Convert.ToDateTime(dpRescheduledate.Text); DateTime dtTime = new DateTime(); dtTime = Convert.ToDateTime(dpRescheduletime.Text); if (_configContainer.AllKeys.Contains("voice.ocs.time-format") && !string.IsNullOrEmpty(_configContainer.GetAsString("voice.ocs.time-format"))) { try { finalDateTime = dt.Date.ToShortDateString() + " " + dtTime.ToString(_configContainer.GetAsString("voice.ocs.time-format"), CultureInfo.InstalledUICulture); } catch (Exception generalException) { _logger.Error("Error occurred while converting time in the given format : " + _configContainer.GetAsString("voice.ocs.time-format") + " : " + generalException.ToString()); finalDateTime = dt.Date.ToShortDateString() + " " + dtTime.ToString("HH:mm", CultureInfo.InstalledUICulture); } } if (!_updateUserEventData.ContainsKey("GSW_DATE_TIME")) { _updateUserEventData.Add("GSW_DATE_TIME", finalDateTime); } if (!_updateUserEventData.ContainsKey("GSW_AGENT_REQ_TYPE")) { _updateUserEventData.Add("GSW_AGENT_REQ_TYPE", "RecordReschedule"); } } if (!string.IsNullOrEmpty(cmbCallResult.Text.Trim()) && cmbCallResult.SelectedIndex >= 0) { if (!_updateUserEventData.ContainsKey("GSW_CALL_RESULT")) { _updateUserEventData.Add("GSW_CALL_RESULT", Convert.ToInt32(cmbCallResult.SelectedValue.ToString())); } } if (_datacontext.userAttachData.ContainsKey("GSW_PHONE")) { if (!_updateUserEventData.ContainsKey("GSW_PHONE")) { _updateUserEventData.Add("GSW_PHONE", _datacontext.userAttachData["GSW_PHONE"].ToString()); } } if (!_updateUserEventData.ContainsKey("GSW_AGENT_REQ_TYPE")) { _updateUserEventData.Add("GSW_AGENT_REQ_TYPE", "UpdateCallCompletionStats"); } var soft = new SoftPhone(); OutputValues output = soft.UpdateOCSCallData(_updateUserEventData); if (output.MessageCode == "200") { _logger.Info("OCS Call Data Updated Successfully...."); } SendRecordProcessed(_updateUserEventData); } catch (Exception generalException) { _logger.Error("Error occurred in PrepareUserData() : " + generalException.ToString()); } }
public void InitializeIntegration(ConfService confProtocol, string applicationName, System.Collections.Generic.Dictionary <string, bool> integrationMediaList = null) { Thread newThread = new Thread(() => { _logger.Info("**********************************************************************************************************************"); _logger.Info("Pointel.Integration.Core :" + Assembly.GetExecutingAssembly().GetName().Version); _logger.Info("***********************************************************************************************************************"); _logger.Info("Retrieving Values from Application third party integration start."); ReadApplication readApplication = new ReadApplication(); Settings settings = Settings.GetInstance(); try { readApplication.ReadIntegrationDecisionKeyCollections(); callData = readApplication.ReadFileIntegrationKeyCollections(confProtocol, applicationName); readApplication.ReadApplicationValue(confProtocol, applicationName); newCallDataProvider = new CallDataProviders(); if (settings.EnableFileCommunication) { InitFileIntegration(); } else { _logger.Warn("File Communication Disabled"); } if (settings.EnablePortCommunication) { try { portSubscriber = new PortSubscriber(); portSubscriber.Subscribe(newCallDataProvider); callData.PortData.Decision = IntegrationAction.Open; newCallDataProvider.NewCallData(callData); } catch (Exception ex) { _logger.Error("Error occurred while subcribe Port as " + ex.Message); } } else { _logger.Info("Port integration disabled."); } if (settings.EnablePipeCommunication) { InitPipeIntegration(); } else { _logger.Info("Pipe integration disabled."); } if (settings.EnableURLCommunication) { InitWebUrlIntegration(integrationMediaList); } else { _logger.Info("URL integration disabled."); } if (settings.EnableCrmDbCommunication) { try { crmDbSubscriber = new CrmDbSubscriber(); crmDbSubscriber.Subscribe(newCallDataProvider); } catch (Exception ex) { _logger.Error("Error occurred while subcribe DB Communication as " + ex.Message); } } else { _logger.Info("Database integration disabled"); } if (ConfigContainer.Instance().AllKeys.Contains("voice.enable.agent-activity-db-integration") && ConfigContainer.Instance().GetAsBoolean("voice.enable.agent-activity-db-integration")) { try { var agentActivitySubscriber = new AgentActivitySubscriber(); agentActivitySubscriber.Subscribe(newCallDataProvider); } catch (Exception ex) { _logger.Error("Error occurred while subcribe DB Communication as " + ex.Message); } } else { _logger.Info("Agent interaction activity disabled"); } ISoftphoneListener softSubscriber = new DesktopMessenger(); SoftPhone softPhone = new SoftPhone(); softPhone.Subscribe(softSubscriber, Softphone.Voice.SoftPhoneSubscriber.Integration); StartHIMMSIntegration(); } catch (Exception generalException) { _logger.Error("Error occurred while reading integration part from the application " + generalException.ToString()); } }); newThread.Start(); }
void SipUnregistrationButton_Click(object sender, RoutedEventArgs e) { SoftPhone.UnregisterPhoneLine(); }
void CallHangUpButton_Click(object sender, RoutedEventArgs e) { SoftPhone.CloseCall(); }