Beispiel #1
0
 internal Method(string methodName, object[] parameters, bool isSuccess = true, CallStatus status = CallStatus.Request)
 {
     Name = methodName;
     Parameters = parameters;
     IsSuccess = isSuccess;
     CallStatus = status;
 }
Beispiel #2
0
        internal void Save(DataEntityCollectionDTO entitys, SecurityToken sessionToken)
        {
            // Almost all iSIMS calls fill a callStatus response message in with status and error messages.
            CallStatus callStatus = new CallStatus();

            // Create a communication channel factory to communicate with the iSIMS application server
            using (ChannelFactory <IDataEntityIO> factory = GetApplicationServerChannelFactory())
            {
                // Because our communication now will be secured using our Identity Token we need to use some WIF extension methods to make sure the identity token
                // is sent as a Cookie on the SOAP call that WCF will be generating.
                factory.Credentials.UseIdentityConfiguration = true;
                IDataEntityIO secureConnection = factory.CreateChannelWithIssuedToken(sessionToken);

                DataEntityDTOChangeBatchCollection changes = new DataEntityDTOChangeBatchCollection
                {
                    Batches = new List <DataEntityDTOChangeBatch>()
                };
                DataEntityDTO.DataModelTypeDTO dataModelType = new DataEntityDTO.DataModelTypeDTO {
                    SchemaName = "dbo", DataModelPurpose = "BusinessDataModel"
                };
                changes.DataModelType = dataModelType;
                DataEntityDTOChangeBatch batch = new DataEntityDTOChangeBatch {
                    EntitiesToSave = entitys
                };
                DataEntitySaveContext batchSaveContext = new DataEntitySaveContext();
                List <string>         alternateKeys    = new List <string>();
                // Simplest thing to do is declare which field we believe we have changed
                List <string> batchSaveScope = new List <string> {
                    "Learner.PreferredForename"
                };
                List <WorkflowPackage> customWorkflows = new List <WorkflowPackage>();
                batchSaveContext.SaveScope             = batchSaveScope;
                batchSaveContext.AlternateKeyFields    = alternateKeys;
                batchSaveContext.CustomWorkflows       = customWorkflows;
                batchSaveContext.CustomDeleteWorkflows = new List <WorkflowPackage>();
                batch.SaveContext = batchSaveContext;
                changes.Batches.Add(batch);
                secureConnection.SaveEntityCollection(changes, ref callStatus);



                // Handle an unsuccessful call.
                if (callStatus.Result != CallStatusenumCallResult.Success)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (ValidationError error in callStatus.Messages)
                    {
                        sb.AppendLine(error.Message);
                    }
                    throw new Exception("Call did not complete successfully" + Environment.NewLine + sb);
                }
            }
        }
Beispiel #3
0
 public OrderMonitor(SUTI theMsg, string _tpak_id, string _kela_id)
 {
     inSUTImsg     = theMsg;
     tpak_id       = _tpak_id;
     kela_id       = _kela_id;
     orderStatus   = CallStatus.NOEXIST;
     veh_nbr       = "";
     bSentAccept   = false;
     bSentConfirm  = false;
     bSentPickup   = false;
     due_date_time = 0;
 }
Beispiel #4
0
        /// <summary>
        /// Signal erroneous completion of request dispatching. This method is used by transports that post outgoing message asynchronously
        /// </summary>
        internal void SignalDispatchError(string errorMessage)
        {
            lock (m_Sync)
            {
                m_DispatchErrorMessage = errorMessage;
                m_CallStatus           = CallStatus.DispatchError;

                Monitor.Pulse(m_Sync);

                completePendingTask();//dispatch error that became apparent later-on (after CallSlot was created)
            }
        }
        private void OnCallStatusChanged(object sender, CallStatus status)
        {
            log.Info("OnCallStatusChanged start.");
            if (CallStatus.Ended == status || CallStatus.Idle == status)
            {
                log.Info("Call Ended or status, empty ConferenceNumber");
                ConferenceNumber = "";
                if (CallStatus.Ended == status)
                {
                    SetDefaultSetting();
                }
                PeerImageUrl = "";
            }
            else if (CallStatus.ConfIncoming == status || CallStatus.P2pIncoming == status)
            {
                VideoAnswerVisibility = Visibility.Visible;
                ConfNumberVisibility  = Visibility.Collapsed;
                PeerDisplayName       = CallController.Instance.CallInfo.peer;
                if (CallStatus.P2pIncoming == status)
                {
                    InvitingInfo = LanguageUtil.Instance.GetValueByKey("INVITING_YOU");
                }
                else if (CallStatus.ConfIncoming == status)
                {
                    if (string.IsNullOrEmpty(PeerDisplayName))
                    {
                        InvitingInfo = string.Format(LanguageUtil.Instance.GetValueByKey("INVITED_JOIN_CONF_PROMPT"), CallController.Instance.CallInfo.conference_number);
                    }
                    else
                    {
                        InvitingInfo = string.Format(LanguageUtil.Instance.GetValueByKey("ADMIN_INVITE_YOU_JOIN_CONF_PROMPT"), CallController.Instance.CallInfo.conference_number);
                    }
                }
            }
            else if (CallStatus.Dialing == status)
            {
                if (CallController.Instance.IsP2pCall)
                {
                    ConferenceNumber = CallController.Instance.PeerDisplayName;
                }
                else
                {
                    ConferenceNumber = CallController.Instance.ConferenceNumber;
                }
                log.InfoFormat("Dialing, set ConferenceNumber: {0}", ConferenceNumber);
                VideoAnswerVisibility = Visibility.Collapsed;
                ConfNumberVisibility  = Visibility.Visible;
                PeerDisplayName       = "";
            }

            log.Info("OnCallStatusChanged end.");
        }
        public void MapEntityToModelList()
        {
            var        mapper = new DALCallStatusMapper();
            CallStatus item   = new CallStatus();

            item.SetProperties(1, "A");
            List <ApiCallStatusServerResponseModel> response = mapper.MapEntityToModel(new List <CallStatus>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
        public virtual async Task <ApiCallStatusServerResponseModel> Get(int id)
        {
            CallStatus record = await this.CallStatusRepository.Get(id);

            if (record == null)
            {
                return(null);
            }
            else
            {
                return(this.DalCallStatusMapper.MapEntityToModel(record));
            }
        }
Beispiel #8
0
        public void SetCallSatus(String status)
        {
            switch (status)
            {
            case "call_rejected":
                _Status = CallStatus.Rejected;
                break;

            default:
                _Status = CallStatus.Unknown;
                break;
            }
        }
        private void InitializeCallIndicators()
        {
            DomainEvents.Register<CallStatusChanged>(args =>
                {
                    callStatus = args.CallStatus;
                    skypeLightNotifyIcon.Icon = args.CallStatus == CallStatus.NotOnCall
                        ? Resources.NoCallStatusIcon
                        : Resources.OnCallStatusIcon;
                });

            busylightService = new BusylightService(new BusylightAdapter());
            busylightService.Initialize();
        }
Beispiel #10
0
 private void SetImagesFor(CallStatus status)
 {
     if (status == CallStatus.OnAudioCall)
     {
         Icon = Resources.OnCallStatusIcon;
         pbCallStatus.Image = Resources.OnCallStatusImage;
     }
     else
     {
         Icon = Resources.NoCallStatusIcon;
         pbCallStatus.Image = Resources.NoCallStatusImage;
     }
 }
Beispiel #11
0
 private void SetImagesFor(CallStatus status)
 {
     if (status == CallStatus.OnAudioCall)
     {
         Icon = Resources.OnCallStatusIcon;
         pbCallStatus.Image = Resources.OnCallStatusImage;
     }
     else
     {
         Icon = Resources.NoCallStatusIcon;
         pbCallStatus.Image = Resources.NoCallStatusImage;
     }
 }
 private void ZDK_NET_OnCallStatusChanged(Call call, CallStatus status)
 {
     if (status.LineStatus == CallLineStatus.Terminated)
     {
         if (ActiveUsers[UserId].ActiveCalls.Keys.Contains(call.CallHandle))
         {
             ActiveUsers[UserId].ActiveCalls.Remove(call.CallHandle);
         }
     }
     if (OnZoiperEvent != null)
     {
         OnZoiperEvent("OnCallStatusChanged status: " + status.LineStatus);
     }
 }
Beispiel #13
0
        protected void InternalReportCallStatus(CallStatus status, string details)
        {
            if (details?.Length > 64)
            {
                throw new BuilderException("Cannot specify more than 64 characters for details");
            }

            _instructions.Add(new SvamletInstructionModel
            {
                Name    = "ReportCallStatus",
                Value   = status.ToString().ToLowerInvariant(),
                Details = details
            });
        }
        private void OnCallStatusChanged(object sender, CallStatus status)
        {
            log.Info("OnCallStatusChanged start.");
            UpdateWindowVisibility();
            switch (status)
            {
            case CallStatus.Idle:
                // do noting. Note: do not remove the branch, or go to default
                break;

            case CallStatus.Dialing:
            case CallStatus.ConfIncoming:
            case CallStatus.P2pIncoming:
            case CallStatus.P2pOutgoing:
            case CallStatus.Connected:
                Application.Current.Dispatcher.InvokeAsync(() => {
                    JoinConfDisplayNameWindow.Instance.CloseWindow();
                });
                break;

            default:     // Ended, PeerDeclined, PeerCancelled, TimeoutSelfCancelled
                log.Info("Call ended and change current view to main view.");
                if (LoginStatus.LoggedIn == LoginManager.Instance.CurrentLoginStatus)
                {
                    CurrentView = _mainView;
                }

                Application.Current.Dispatcher.InvokeAsync(() => {
                    log.Info("CallStatus.Ended");
                    // maybe VideoPeopleWindow.Instance.Set2PresettingState() in UpdateWindowVisibility(), so hide LayoutBackgroundWindow in the following
                    if (Visibility.Visible != LayoutBackgroundWindow.Instance.Visibility)
                    {
                        log.Info("LayoutBackgroundWindow is not visible, so OnCallEnded");
                        LayoutBackgroundWindow.Instance.OnCallEnded();
                    }
                    else
                    {
                        LayoutBackgroundWindow.Instance.HideWindow(true);
                    }
                });

                SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);

                log.Info("Call ended and collect garbage");
                SystemMonitorUtil.Instance.CollectGarbage();
                break;
            }

            log.Info("OnCallStatusChanged end.");
        }
Beispiel #15
0
Datei: VoIP.cs Projekt: zfis/Call
        public VoIP(IMyPhoneCallHandler handler, CallStatus callStatus, MyPhoneStatus phoneStatus)
        {
            this.handler      = handler;
            this._callStatus  = callStatus;
            this._phoneStatus = phoneStatus;

            serializer = new JavaScriptSerializer();

            handler.OnCallStatusChanged    += new CallInfoHandler(CallHandlerOnCallStatusChanged);
            handler.OnMyPhoneStatusChanged += new MyPhoneStatusHandler(CallHandlerOnMyPhoneStatusChanged);
            //Debug.WriteLine(">>>>>>>>>>>>>>>>>>> VoIP handler created.");
            //Debug.WriteLine(">>>>>>>>>>>>>>>>>>> call status: " + callStatus);
            //Debug.WriteLine(">>>>>>>>>>>>>>>>>>> phone status: " + phoneStatus);
        }
        public IHttpActionResult DeleteCallStatus(int id)
        {
            CallStatus callStatus = db.CallStatus.Find(id);

            if (callStatus == null)
            {
                return(NotFound());
            }

            db.CallStatus.Remove(callStatus);
            db.SaveChanges();

            return(Ok(callStatus));
        }
    public string QuantidadeAtivosStatus(string mesAno)
    {
        int mes   = Convert.ToInt32(mesAno.Substring(0, 2));
        int ano   = Convert.ToInt32(mesAno.Substring(3, 4));
        var dados = new List <CallStatus>();

        using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["gtaConnectionString"].ToString()))
        {
            SqlCommand cmm = cnn.CreateCommand();

            //cmm.CommandText = "SELECT COUNT(status_consulta.status) AS qtd_status, status_consulta.status " +
            //                    " FROM hspmCall.dbo.ativo_ligacao INNER JOIN hspmCall.dbo.status_consulta ON hspmCall.dbo.ativo_ligacao.status = status_consulta.id_status " +
            //                    " WHERE MONTH(data_ligacao) = " + mes + " and YEAR(data_ligacao) = " + ano +
            //                    " GROUP BY status_consulta.status " +
            //                    " ORDER BY qtd_status DESC";

            cmm.CommandText = "SELECT COUNT(status_consulta.status) AS qtd_status, status_consulta.status, " +
                              "cast((count(status_consulta.status)*100.0)/(select COUNT(*) FROM hspmCall.dbo.ativo_ligacao INNER JOIN hspmCall.dbo.status_consulta ON hspmCall.dbo.ativo_ligacao.status = status_consulta.id_status " +
                              "WHERE MONTH(data_ligacao) = " + mes + " and YEAR(data_ligacao) = " + ano + ")as decimal(5,2)) as porcentagem " +
                              "FROM hspmCall.dbo.ativo_ligacao INNER JOIN hspmCall.dbo.status_consulta ON hspmCall.dbo.ativo_ligacao.status = status_consulta.id_status " +
                              "WHERE MONTH(data_ligacao) = " + mes + " and YEAR(data_ligacao) = " + ano +
                              "GROUP BY status_consulta.status " +
                              "ORDER BY qtd_status DESC ";
            try
            {
                cnn.Open();
                SqlDataReader dr1 = cmm.ExecuteReader();

                //char[] ponto = { '.', ' ' };
                while (dr1.Read())
                {
                    CallStatus call = new CallStatus();

                    call.quantidade  = dr1.GetInt32(0);
                    call.descricao   = dr1.GetString(1);
                    call.porcentagem = Convert.ToString(dr1.GetDecimal(2)) + "%";


                    dados.Add(call);
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
        JavaScriptSerializer js = new JavaScriptSerializer();

        return(js.Serialize(dados));
    }
Beispiel #18
0
        private void OnCallStatusChanged(object sender, CallStatus status)
        {
            log.Info("OnCallStatusChanged start.");
            OnPropertyChanged("IsVisible");
            if (CallStatus.Idle == status || CallStatus.Ended == status)
            {
                Utils.SetIsConfRunning(false);
                Utils.SetRunningConfId("");
            }
            else
            {
                Utils.SetIsConfRunning(true);
                Utils.SetRunningConfId(CallController.Instance.ConferenceNumber);
            }

            switch (status)
            {
            case CallStatus.Dialing:
            case CallStatus.ConfIncoming:
            case CallStatus.P2pIncoming:
                CurrentView = _callingView;
                Application.Current.Dispatcher.InvokeAsync(() =>
                {
                    LayoutBackgroundWindow.Instance.SetLocalVideoHandle();
                });
                break;

            case CallStatus.Connected:
            case CallStatus.P2pOutgoing:
                Application.Current.Dispatcher.InvokeAsync(() =>
                {
                    CurrentView = _logoView;
                    LayoutBackgroundWindow.Instance.InitSetting();
                    LayoutBackgroundWindow.Instance.ShowWindow(true);
                    if (Utils.GetFullScreenOnCallConnected())
                    {
                        VideoPeopleWindow.Instance.SetFullScreen();
                    }
                });

                if (CallStatus.Connected == status)
                {
                    SaveCurrentConfId();
                }

                break;
            }
            log.Info("OnCallStatusChanged end.");
        }
Beispiel #19
0
        public JsonResult GetDocumentsbyLoginId(Login obj)
        {
            CallStatus status = new CallStatus();

            try
            {
                if (GenericHelper.IsAuthenticToken(obj.LoginId, obj.Token))
                {
                    using (var context = new SpiralDomeDbContext())
                    {
                        obj.SearchByName = obj.SearchByName == null ? "" : obj.SearchByName;



                        var res =

                            obj.SearchByName == "" ?

                            (from document in context.DocumentImages
                             where document.LoginId == obj.LoginId && document.Name.Contains("Divorce") == false
                             select document).OrderBy(x => x.Name).ToList()
                            :

                            (from document in context.DocumentImages
                             where document.LoginId == obj.LoginId && document.Name.Contains(obj.SearchByName)
                             select document).OrderBy(x => x.Name).ToList()
                        ;

                        foreach (var doc in res)
                        {
                            doc.ImageBase64 = Convert.ToBase64String(doc.ImageData);
                        }

                        status.IsSuccess  = true;
                        status.JsonObject = Json(res);
                    }
                }
                else
                {
                    throw new Exception("Invalid Authentication Token");
                }
            }
            catch (Exception ex)
            {
                status.IsSuccess = false;
                status.Message   = ex.Message;
            }
            return(Json(status));
        }
Beispiel #20
0
        /// <summary>
        /// Example of retrieving some data from the application server. In this case we will use the ReadEnity call to retrieve data for a single Learner entity.
        ///
        /// This illustrates the method of constructing a single entity query, and handling the results that are returned. It also illustrates the use of the CallStatus
        /// structure to retrieve information about the call, and any failures that occured.
        /// </summary>
        /// <param name="learnerid"></param>
        /// <param name="sessionToken"></param>
        internal DataEntityCollectionDTO RetrieveSingleLearnerById(string learnerid, SecurityToken sessionToken)
        {
            // The security summary will be filled with any notifications of data fields which were removed by the security protocols prior to being sent to the recipient. This
            // enables you to see whether your data has been redacted before you got to see it.
            SecuritySummary securitySummary = new SecuritySummary();

            // Almost all iSIMS calls fill a callStatus response message in with status and error messages.
            CallStatus callStatus = new CallStatus();

            // Create a communication channel factory to communicate with the iSIMS application server
            using (ChannelFactory <IDataEntityIO> factory = GetApplicationServerChannelFactory())
            {
                // Because our communication now will be secured using our Identity Token we need to use some WIF extension methods to make sure the identity token
                // is sent as a Cookie on the SOAP call that WCF will be generating.
                factory.Credentials.UseIdentityConfiguration = true;
                IDataEntityIO secureConnection = factory.CreateChannelWithIssuedToken(sessionToken);
                Guid          studentId        = new Guid(learnerid);

                // Construct a query to read a specific entity from SIMS8
                DataEntityCollectionDTO entities = secureConnection.ReadEntity( // Tell it which specific unique entity we want to fetch
                    studentId,                                                  // Tell it what type of entity this is
                    "Learner",                                                  // Tell it what scope of data we want to get back from the call.
                    new List <string>(new[]
                {
                    // The surname and forename
                    "Learner.LegalSurname",
                    "Learner.LegalForename",
                    "Learner.PreferredForename",
                    // The Unique Pupil Number
                    "Learner.UPN",
                    // The Learners Addresses, start date. Note that there are many Addresses attached to a single Learner
                    "Learner.LearnerAddresses.StartDate",
                    // The Learners Addresses, Post Code
                    "Learner.LearnerAddresses.Address.PostCode"
                }), ref securitySummary, ref callStatus);

                // Handle an unsuccessful call.
                if (callStatus.Result != CallStatusenumCallResult.Success)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (ValidationError error in callStatus.Messages)
                    {
                        sb.AppendLine(error.Message);
                    }
                    throw new Exception("Call did not complete successfully" + Environment.NewLine + sb);
                }
                return(entities);
            }
        }
Beispiel #21
0
        private void GetCallBtn_Clicked(object sender, EventArgs e)
        {
            try
            {
                Log.Debug(Globals.LogTag, "GetCallStatus call start");
                CallStatus data = call.GetCallStatus((int)activeCallHandle);
                Log.Debug(Globals.LogTag, "GetCallStatus call end, callstatus, id = " + data.CallHandle + ",number = " + data.PhoneNumber + ",volte call =" + data.IsVolteCall +
                          ",state = " + data.State + ",type = " + data.Type + ",conference call = " + data.IsConferenceState + ",Mo call = " + data.IsMoCall);
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "GetCallStatus ,exception = " + ex.ToString());
            }
        }
Beispiel #22
0
        public JsonResult IsValidLogin(Login login)
        {
            var result = new CallStatus();

            try
            {
                using (var context = new SpiralDomeDbContext())
                {
                    var loginObj = (from user in context.Logins
                                    where user.LoginId == login.LoginId.Trim() &&
                                    user.Password == login.Password
                                    select user).SingleOrDefault();

                    var isUserExists = loginObj != null;

                    if (isUserExists)
                    {
                        loginObj.LastModified = DateTime.UtcNow;
                        loginObj.Token        = DateTime.Now.Ticks.ToString();

                        context.SaveChanges();

                        loginObj.LastModified = null;
                        loginObj.Password     = null;

                        result.IsSuccess  = true;
                        result.Message    = "";
                        result.JsonObject = Json(loginObj);
                    }
                    else
                    {
                        throw new Exception("Invalid Username or Password");
                    }
                }
            }
            catch (DbEntityValidationException e)
            {
                result.IsSuccess = false;
                result.Message   = Helper.GenericHelper.GetValidationMessage(e);
            }
            catch (Exception ex)
            {
                result.IsSuccess = false;
                result.Message   = ex.Message;
            }

            return(Json(result));
        }
Beispiel #23
0
        public virtual async Task <CreateResponse <ApiCallStatusServerResponseModel> > Create(
            ApiCallStatusServerRequestModel model)
        {
            CreateResponse <ApiCallStatusServerResponseModel> response = ValidationResponseFactory <ApiCallStatusServerResponseModel> .CreateResponse(await this.CallStatusModelValidator.ValidateCreateAsync(model));

            if (response.Success)
            {
                CallStatus record = this.DalCallStatusMapper.MapModelToEntity(default(int), model);
                record = await this.CallStatusRepository.Create(record);

                response.SetRecord(this.DalCallStatusMapper.MapEntityToModel(record));
                await this.mediator.Publish(new CallStatusCreatedNotification(response.Record));
            }

            return(response);
        }
Beispiel #24
0
        public void Initiate()
        {
            var client  = new TwilioRestClient(_accountSid, _authToken);
            var message = client.InitiateOutboundCall(From, To, "http://example.com/thankyou");

            if (message.RestException != null)
            {
                //TODO: log the error

                this.Status = CallStatus.Fail;
            }
            else
            {
                this.Status = CallStatus.Success;
            }
        }
 public ActionResult SetStatus(int id, CallStatus status)
 {
     try
     {
         using (ITransaction transaction = DbSession.BeginTransaction())
         {
             GetEntity <Call>(id).SetStatus(status);
             transaction.Commit();
             return(SuccessJson());
         }
     }
     catch (Exception e)
     {
         return(FailedJson(e.Message));
     }
 }
Beispiel #26
0
        /// <summary>
        /// INTERNAL METHOD. Developers do not call!
        /// This constructor is used by an Async binding that delivers response after call slot was created
        /// </summary>
        public CallSlot(ClientEndPoint client, ClientTransport clientTransport, RequestMsg request, CallStatus status, int timeoutMs = 0)
        {
            m_Client          = client;
            m_ClientTransport = clientTransport;
            m_RequestID       = request.RequestID;
            m_CallStatus      = status;
            m_OneWay          = request.OneWay;
            m_StartTime       = DateTime.UtcNow;
            m_TimeoutMs       = timeoutMs > 0 ? timeoutMs : DEFAULT_TIMEOUT_MS;

            if (!m_OneWay && client.Binding.MeasureStatTimes)
            {
                m_StatStartTimeTicks   = client.Binding.StatTimeTicks;
                m_StatRoundtripTimeKey = client.Binding.GetClientCallStatTimeKey(client, request);
            }
        }
Beispiel #27
0
        private void OnCallStatusChanged(object sender, CallStatus status)
        {
            log.InfoFormat("OnCallStatusChanged start. {0}", status);
            switch (status)
            {
            case CallStatus.Dialing:
            case CallStatus.ConfIncoming:
            case CallStatus.P2pIncoming:
                CurrentView = _dialingView;
                CallController.Instance.PlayRingtone();
                break;

            default:
                CallController.Instance.StopRingtone();
                break;
            }
            log.Info("OnCallStatusChanged end.");
        }
Beispiel #28
0
        public async Task <CallStatus> Get(long Id)
        {
            CallStatus CallStatus = await DataContext.CallStatus.AsNoTracking()
                                    .Where(x => x.Id == Id)
                                    .Select(x => new CallStatus()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

            if (CallStatus == null)
            {
                return(null);
            }

            return(CallStatus);
        }
        public async void Get_ShouldReturnRecords()
        {
            var mock   = new ServiceMockFacade <ICallStatusService, ICallStatusRepository>();
            var record = new CallStatus();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record));
            var service = new CallStatusService(mock.LoggerMock.Object,
                                                mock.MediatorMock.Object,
                                                mock.RepositoryMock.Object,
                                                mock.ModelValidatorMockFactory.CallStatusModelValidatorMock.Object,
                                                mock.DALMapperMockFactory.DALCallStatusMapperMock,
                                                mock.DALMapperMockFactory.DALCallMapperMock);

            ApiCallStatusServerResponseModel response = await service.Get(default(int));

            response.Should().NotBeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Beispiel #30
0
        private Call GetOrInsert(int id, CallStatus status, CallDirection direction)
        {
            if (_calls.ContainsKey(id))
            {
                return(_calls[id]);
            }

            var call = new Call(_codec, id)
            {
                Status    = status,
                Direction = direction
            };

            _lock.Enter();
            _calls.Add(id, call);
            _lock.Leave();
            return(call);
        }
Beispiel #31
0
 internal void init()
 {
     CallId                       = null;
     CalleeAddress                = null;
     IsUsed                       = false;
     status                       = CallStatus.Disconnected;
     isSendingVideo               = false;
     isSendingAudio               = false;
     isReceivingVideo             = false;
     isReceivingAudio             = false;
     isRemoteSendingVideo         = false;
     isRemoteSendingAudio         = false;
     isReceivingShare             = false;
     memberships                  = new List <CallMembership>();
     IsLocalRejectOrEndCall       = false;
     IsGroup                      = false;
     IsWaittingVideoCodecActivate = false;
 }
Beispiel #32
0
        private async Task LogCallAsync(IncomingCall call, CallStatus status, bool isLoadTest = false)
        {
            var callLogMessage = new CallLog(call.CallSid)
            {
                callerNumber = call.From,
                calledNumber = call.To,
                statusId     = (int)status,
                statusName   = status.ToString(),
                routeKey     = string.Empty
            };

            if (isLoadTest)
            {
                callLogMessage.ttl = 300;
            }

            await _callLoggingService.CreateCallLogAsync(callLogMessage);
        }
Beispiel #33
0
        public JsonResult UpdateAccount(Account obj)
        {
            CallStatus status = new CallStatus();

            try
            {
                if (GenericHelper.IsAuthenticToken(obj.LoginId, obj.Token))
                {
                    using (var context = new SpiralDomeDbContext())
                    {
                        var res = (from account in context.Accounts
                                   where account.Name.Trim() == obj.Name.Trim() && account.LoginId == obj.LoginId
                                   select account).SingleOrDefault();

                        if (res != null)
                        {
                            res.Name     = obj.Name;
                            res.Username = obj.Username;
                            res.Password = obj.Password;
                            res.Url      = obj.Url;
                            res.Comment  = obj.Comment;
                            context.SaveChanges();
                        }
                        else
                        {
                            return(InsertNewAccount(obj));
                        }
                    }

                    status.IsSuccess = true;
                }
                else
                {
                    throw new Exception("Invalid Authentication Token");
                }
            }
            catch (Exception ex)
            {
                status.IsSuccess = false;
                status.Message   = ex.Message;
            }

            return(Json(status));
        }
Beispiel #34
0
 public Person(CallStatus status
     ,int id
     ,string lastName
     ,string firstName
     ,string address1
     ,string address2
     ,string city
     ,string state
     ,string zip)
 {
     this.status = status;
     this.id = id;
     this.lastName = lastName;
     this.firstName = firstName;
     this.address1 = address1;
     this.address2 = address2;
     this.city = city;
     this.state = state;
     this.zip = zip;
 }
        private void InitializeCallIndicators()
        {
            DomainEvents.Register<CallStatusChanged>(args =>
                {
                    callStatus = args.CallStatus;
                    skypeLightNotifyIcon.Icon = args.CallStatus == CallStatus.NotOnCall
                        ? Resources.NoCallStatusIcon
                        : Resources.OnCallStatusIcon;
                });

            DomainEvents.Register<ToggleStatusRequested>(args => {
                if (callStatus == CallStatus.NotOnCall)
                {
                    DomainEvents.Raise(new CallStatusChanged(CallStatus.OnAudioCall));
                }
                else if (callStatus == CallStatus.OnAudioCall)
                {
                    DomainEvents.Raise(new CallStatusChanged(CallStatus.NotOnCall));
                }
            });

            busylightService = new BusylightService(new BusylightAdapter());
            busylightService.Initialize();
        }
 public virtual void OnCallStatus(string jobID, string callID, CallStatus status)
 {
 }
Beispiel #37
0
 public ClientCallException(CallStatus status, string message, Exception inner)
     : base(message, inner)
 {
     m_Status = status;
 }
 public CallStatusChanged(CallStatus callStatus)
 {
     CallStatus = callStatus;
 }
 public void PublishCallStatus(CallStatus status)
 {
     MessageRouter.Publish(new SkypeCallStatusMessage
     {
         Status = status
     });
 }
Beispiel #40
0
 /// <summary>
 /// Create a Call object with still unknown parameters.
 /// </summary>
 /// <param name="id">The unique ID of the call handed over from the phone.</param>
 /// <param name="status">The current status of the call.</param>
 /// <param name="type">The type of the call.</param>
 public Call(int id, CallStatus status, CallType type)
 {
     this.id = id;
     Status = status;
     Type = type;
 }
        protected virtual void OnSkypeCallStatusMessage(IMessage message)
        {
            var callStatusMessage = message as SkypeCallStatusMessage;
            if (callStatusMessage != null)
            {
                blyncLighteManager.Logger.Info("Call Status " + callStatusMessage.Status);

                if (callStatusMessage.Status == CallStatus.Missed)
                {
                    //TODO handle missed calls
                }
                else
                {
                    CallStatus = callStatusMessage.Status;
                    UpdateBlyncLight();
                }
            }
        }
Beispiel #42
0
 public CallStatusForm(CallStatus status)
 {
     InitializeComponent();
     SetImagesFor(status);
 }
Beispiel #43
0
 public void SetCallStatusNone()
 {
     call_status = CallStatus.None;
 }
Beispiel #44
0
 public void FlagCallInactive(string callSid, CallStatus? callStatus)
 {
     _callRepository.Update(new Call {Sid = callSid, CallStatus = callStatus ?? CallStatus.Completed, EndTime = DateTime.Now});
 }
Beispiel #45
0
 public CallStatusForm(CallStatus status)
 {
     InitializeComponent();
     SetImagesFor(status);
     pbCallStatus.Click += (sender, args) => ToggleStatus();
 }
Beispiel #46
0
 public CallRecord(DateTime callDateTime, CallStatus callState, String numberOrUsername, decimal callDuration)
 {
     this.CallDateTime = callDateTime;
     this.CallState = callState;
     this.NumberOrUsername = numberOrUsername;
     this.CallDuration = callDuration;
 }
Beispiel #47
0
 public ClientCallException(CallStatus status)
     : base(StringConsts.GLUE_CLIENT_CALL_ERROR + status.ToString())
 {
     m_Status = status;
 }
Beispiel #48
0
 public void SetCallStatusVCall()
 {
     call_status = CallStatus.VCall;
 }
Beispiel #49
0
        /// <summary>
        /// The call status has changed
        /// </summary>
        /// <param name="newStatus"></param>
        public virtual void OnCallStatusChanged(CallStatus newStatus)
        {
            // Note, this call is called on some IPC thread - dispatch to the UI thread before doing anything else
            this.Page.Dispatcher.BeginInvoke(() =>
            {
                BackEnd.CallStatus oldStatus = this.CallStatus;

                if (newStatus != oldStatus)
                {
                    // The call status has changed
                    this.CallStatus = newStatus;

                    // Check if a call has just started
                    if ((oldStatus == BackEnd.CallStatus.None) && (oldStatus != newStatus))
                    {
                        this.OnNewCallStarted();
                    }
                }
            });
        }