Exemple #1
0
 protected void Cstaeventreport(CstaEventReport data, ATTEvent_t pd, eventTypeCSTA eventType)
 {
     switch (pd.eventType)
     {
     case TypeATTEvent.ATTQueryAgentLoginResp_t_PDU:
         var crid = pd.queryAgentLoginResp.privEventCrossRefID;
         if (pd.queryAgentLoginResp.list.count != 0)
         {
             var list =
                 pd.queryAgentLoginResp.list.list.Take(pd.queryAgentLoginResp.list.count)
                 .Select(_ => _.device)
                 .ToList();
             ReportArray.AddOrUpdate(crid,
                                     list,
                                     (u, o) =>
             {
                 var l = o as List <string>;
                 if (l != null)
                 {
                     l.AddRange(list);
                 }
                 return((object)l);
             });
             CbTaskForToPartNew.UpdateTimeout(crid);
         }
         else
         {
             object obj;
             var    flag = ReportArray.TryRemove(crid, out obj);
             CbTaskForToPartNew.Set(crid, flag ? obj : new List <string>());
         }
         break;
     }
 }
Exemple #2
0
        protected void Cstaunsolicited(CstaUnsolicitedEvent data, ATTEvent_t pd, eventTypeCSTA eventType)
        {
            MonitorEventCollection evnt;

            if (Monitors.TryGetValue((int)data.monitorCrossRefId, out evnt))
            {
                if (eventType == eventTypeCSTA.CSTA_DELIVERED)
                {
                }
                evnt.Invoke(data, eventType, pd, data.monitorCrossRefId);
                if (eventType == eventTypeCSTA.CSTA_MONITOR_STOP || eventType == eventTypeCSTA.CSTA_MONITOR_ENDED)
                {
                    Monitors.TryRemove((int)data.monitorCrossRefId, out evnt);
                    evnt.Dispose();
                }
            }
        }
        public void Invoke(CstaUnsolicitedEvent data, eventTypeCSTA eventType, ATTEvent_t attData, uint monitorCrossRefId)
        {
            switch (eventType)
            {
            case eventTypeCSTA.CSTA_CALL_CLEARED: if (OnCallCleared != null)
                {
                    OnCallCleared(this, new CstaAttEventArgs <CSTACallClearedEvent_t, ATTCallClearedEvent_t>(data.callCleared, attData.callClearedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_CONFERENCED: if (OnConferenced != null)
                {
                    OnConferenced(this, new CstaAttEventArgs <CSTAConferencedEvent_t, ATTConferencedEvent_t>(data.conferenced, attData.conferencedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_CONNECTION_CLEARED: if (OnConnectionCleared != null)
                {
                    OnConnectionCleared(this, new CstaEventArgs <CSTAConnectionClearedEvent_t>(data.connectionCleared), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_DELIVERED: if (OnDelivered != null)
                {
                    OnDelivered(this, new CstaAttEventArgs <CSTADeliveredEvent_t, ATTDeliveredEvent_t>(data.delivered, attData.deliveredEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_DIVERTED: if (OnDiverted != null)
                {
                    OnDiverted(this, new CstaAttEventArgs <CSTADivertedEvent_t, ATTDivertedEvent_t>(data.diverted, attData.divertedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_ESTABLISHED: if (OnEstablished != null)
                {
                    OnEstablished(this, new CstaAttEventArgs <CSTAEstablishedEvent_t, ATTEstablishedEvent_t>(data.established, attData.establishedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_FAILED: if (OnFailed != null)
                {
                    OnFailed(this, new CstaAttEventArgs <CSTAFailedEvent_t, ATTFailedEvent_t>(data.failed, attData.failedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_HELD: if (OnHeld != null)
                {
                    OnHeld(this, new CstaEventArgs <CSTAHeldEvent_t>(data.held), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_NETWORK_REACHED: if (OnNetworkReached != null)
                {
                    OnNetworkReached(this, new CstaAttEventArgs <CSTANetworkReachedEvent_t, ATTNetworkReachedEvent_t>(data.networkReached, attData.networkReachedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_ORIGINATED: if (OnOriginated != null)
                {
                    OnOriginated(this, new CstaAttEventArgs <CSTAOriginatedEvent_t, ATTOriginatedEvent_t>(data.originated, attData.originatedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_QUEUED: if (OnQueued != null)
                {
                    OnQueued(this, new CstaAttEventArgs <CSTAQueuedEvent_t, ATTQueuedEvent_t>(data.queued, attData.queuedEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_RETRIEVED: if (OnRetrieved != null)
                {
                    OnRetrieved(this, new CstaEventArgs <CSTARetrievedEvent_t>(data.retrieved), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_SERVICE_INITIATED: if (OnServiceInitiated != null)
                {
                    OnServiceInitiated(this, new CstaAttEventArgs <CSTAServiceInitiatedEvent_t, ATTServiceInitiatedEvent_t>(data.serviceInitiated, attData.serviceInitiated), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_TRANSFERRED: if (OnTransferred != null)
                {
                    OnTransferred(this, new CstaAttEventArgs <CSTATransferredEvent_t, ATTTransferredEvent_t>(data.transferred, attData.transferredEvent), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_CALL_INFORMATION: if (OnCallInformation != null)
                {
                    OnCallInformation(this, new CstaEventArgs <CSTACallInformationEvent_t>(data.callInformation), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_DO_NOT_DISTURB: if (OnDoNotDisturb != null)
                {
                    OnDoNotDisturb(this, new CstaEventArgs <CSTADoNotDisturbEvent_t>(data.doNotDisturb), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_FORWARDING: if (OnForwarding != null)
                {
                    OnForwarding(this, new CstaEventArgs <CSTAForwardingEvent_t>(data.forwarding), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_MESSAGE_WAITING: if (OnMessageWaiting != null)
                {
                    OnMessageWaiting(this, new CstaEventArgs <CSTAMessageWaitingEvent_t>(data.messageWaiting), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_BACK_IN_SERVICE: if (OnBackInService != null)
                {
                    OnBackInService(this, new CstaEventArgs <CSTABackInServiceEvent_t>(data.backInService), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_OUT_OF_SERVICE: if (OnOutOfService != null)
                {
                    OnOutOfService(this, new CstaEventArgs <CSTAOutOfServiceEvent_t>(data.outOfService), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_PRIVATE_STATUS: if (OnPrivateStatus != null)
                {
                    OnPrivateStatus(this, new CstaEventArgs <CSTAPrivateStatusEvent_t>(data.privateStatus), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_MONITOR_ENDED: MonitorEndedInvoke(data.monitorEnded, monitorCrossRefId); break;

            case eventTypeCSTA.CSTA_LOGGED_ON: if (OnPrivateStatus != null)
                {
                    OnLogOn(this, new CstaEventArgs <CSTALoggedOnEvent_t>(data.loggedOn), monitorCrossRefId);
                }
                break;

            case eventTypeCSTA.CSTA_LOGGED_OFF: if (OnPrivateStatus != null)
                {
                    OnLogOff(this, new CstaEventArgs <CSTALoggedOffEvent_t>(data.loggedOff), monitorCrossRefId);
                }
                break;
            }
        }
Exemple #4
0
 protected void Cstarequest(CstaRequestEvent data, ATTEvent_t pd, eventTypeCSTA eventType)
 {
 }
Exemple #5
0
        protected void Cstaconfirmation(CstaConfirmationEvent data, ATTEvent_t attPd, eventTypeCSTA eventType)
        {
            if (eventType == eventTypeCSTA.CSTA_UNIVERSAL_FAILURE_CONF)
            {
                CbTaskNew.SetError(data.invokeID, data.universalFailure.error);
                return;
            }
            object ret;

            switch (eventType)
            {
            case eventTypeCSTA.CSTA_QUERY_DEVICE_INFO_CONF:
                ret = new QueryDeviceInfoReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_MAKE_CALL_CONF:
                ret = new MakeCallEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_CONSULTATION_CALL_CONF:
                ret = new ConsultationCallEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_MAKE_PREDICTIVE_CALL_CONF:
                ret = new MakePredictiveCallEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_TRANSFER_CALL_CONF:
                ret = new TransferCallEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_QUERY_AGENT_STATE_CONF:
                ret = new QueryAgentStateEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_QUERY_LAST_NUMBER_CONF:
                ret = new QueryLastNumberEventReturn(data);
                break;

            case eventTypeCSTA.CSTA_MONITOR_CONF:
                ret = new SetupMonitorEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_CHANGE_MONITOR_FILTER_CONF:
                ret = new ChangeMonitorFilterEventReturn(data);
                break;

            case eventTypeCSTA.CSTA_SNAPSHOT_DEVICE_CONF:
                ret = new SnapshotDeviceEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_SNAPSHOT_CALL_CONF:
                ret = new SnapshotCallEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_QUERY_CALL_MONITOR_CONF:
                ret = new QueryCallMonitorEventReturn(data);
                break;

            case eventTypeCSTA.CSTA_GET_DEVICE_LIST_CONF:
                ret = new GetDeviceListEventReturn(data);
                break;

            case eventTypeCSTA.CSTA_GETAPI_CAPS_CONF:
                ret = new ApiCapsEventReturn(data, attPd);
                break;

            case eventTypeCSTA.CSTA_ESCAPE_SVC_CONF:
                switch (attPd.eventType)
                {
                case TypeATTEvent.ATTQueryUcidConfEvent_t_PDU:
                    ret = new QueryUcidEventReturn(attPd);
                    break;

                case TypeATTEvent.ATTQueryAcdSplitConfEvent_t_PDU:
                    ret = new QueryAcdSplitEventReturn(attPd);
                    break;

                case TypeATTEvent.ATTQueryAgentLoginConfEvent_t_PDU:
                    ret = new QueryAgentLoginEventReturn(attPd);
                    var task = CbTaskNew.GeTask(data.invokeID);
                    if (task != null)
                    {
                        CbTaskForToPartNew.Add(((QueryAgentLoginEventReturn)ret).Att.privEventCrossRefID, task);
                    }
                    break;

                default:
                    ret = new NullTsapiReturn();
                    break;
                }
                break;

            default:
                ret = new NullTsapiReturn();
                break;
            }

            CbTaskNew.Set(data.invokeID, ret);
        }