Esempio n. 1
0
        /// <summary>
        /// Load/Update the specified service's general info and settings
        /// </summary>
        internal void Load(int key)
        {
            //If already in collection, remove it
            if (base.Contains(key))
            {
                base.RemoveByKey(key);
            }

            Console.WriteLine("Loading service info for ServiceId <{0}>...\t[{1}]", key, this.GetType());

            UDInfo oInfo = new UDInfo {
                listType = (int)AgentInfoType.GET_SERVICE, serviceId = key
            };

            Service oServiceInfo = (Service)mpApp.Portal.WSAgent.getInfo(mpApp.CurrentAgent.AgentArg, oInfo);

            CService oService;

            switch (oServiceInfo.servicetypeid)
            {
            case (int)ServiceType.AOD:
                oService = new CServiceAOD();
                break;

            case (int)ServiceType.CHAT:
                oService = new CServiceChat();
                break;

            default:
                oService = new CService();
                break;
            }

            oService.serviceId   = oServiceInfo.serviceid;
            oService.serviceType = (ServiceType)oServiceInfo.servicetypeid;
            oService.serviceName = oServiceInfo.servicec;
            oService.dialMask    = oServiceInfo.outgoingmask;

            Console.WriteLine("Disposition Plan of ServiceId <{0}>: {1} \t[{2}]", key, oServiceInfo.dispplanid, this.GetType());

            //If this service's disposition plan hasn't yet been loaded then do so
            if (oServiceInfo.dispplanid != 0 && !mpApp.DispositionPlans.Contains(oServiceInfo.dispplanid))
            {
                Console.WriteLine("Loading Disposition Plan <{0}>...\t[{1}]", oServiceInfo.dispplanid, this.GetType());
                mpApp.DispositionPlans.LoadDispositionPlan(oServiceInfo.dispplanid);
            }

            oService.dispositionPlan = mpApp.DispositionPlans.GetByKey(oServiceInfo.dispplanid);

            this.Load(oService);
        }
Esempio n. 2
0
        /// <summary>
        /// Load the specified service's general info and settings
        /// </summary>
        internal void Load(EPEventsWS.UDNewService oNewService)
        {
            //If already in collection, remove it
            if (base.Contains(oNewService.serviceID))
            {
                base.RemoveByKey(oNewService.serviceID);
            }

            Console.WriteLine("Loading service info for ServiceId <{0}>...\t[{1}]", oNewService.serviceID, this.GetType());

            CService oService;

            switch (oNewService.serviceInfo.servicetypeid)
            {
            case (int)ServiceType.AOD:
                oService = new CServiceAOD();
                break;

            case (int)ServiceType.CHAT:
                oService = new CServiceChat();
                break;

            default:
                oService = new CService();
                break;
            }

            oService.serviceId   = oNewService.serviceID;
            oService.serviceType = (ServiceType)oNewService.serviceInfo.servicetypeid;
            oService.serviceName = oNewService.serviceInfo.servicec;
            oService.dialMask    = oNewService.serviceInfo.outgoingmask;

            Console.WriteLine("Disposition Plan of ServiceId <{0}>: {1} \t[{2}]", oNewService.serviceID, oNewService.dispositionPlan.dispplanid, this.GetType());

            //If this service's disposition plan hasn't yet been loaded then do so
            if (oNewService.serviceInfo.dispplanid != 0 && !mpApp.DispositionPlans.Contains(oNewService.serviceInfo.dispplanid))
            {
                Console.WriteLine("Loading Disposition Plan <{0}>...\t[{1}]", oNewService.serviceInfo.dispplanid, this.GetType());
                mpApp.DispositionPlans.LoadDispositionPlan(oNewService);
            }

            oService.dispositionPlan = mpApp.DispositionPlans.GetByKey(oNewService.serviceInfo.dispplanid);

            oService.allowHangup        = Convert.ToBoolean(oNewService.serviceSettings.btnhangupf);
            oService.allowDial          = Convert.ToBoolean(oNewService.serviceSettings.btndialf);
            oService.allow3Way          = Convert.ToBoolean(oNewService.serviceSettings.btnxferf);
            oService.allowConsult       = Convert.ToBoolean(oNewService.serviceSettings.btnconsultf);
            oService.allowConsultHangup = Convert.ToBoolean(oNewService.serviceSettings.btnthreecusthangupf);

            //Hold is not valid for AGD (aka AWD or Workgroup) calls so disable it.
            oService.allowHold = oService.ServiceType != ServiceType.AGD && Convert.ToBoolean(oNewService.serviceSettings.btnholdf);

            //AGD (aka AWD or Workgroup) services don't currently have a blind transfer setting in Director so default to enabled.
            oService.allowBlindXfer = oService.ServiceType == ServiceType.AGD || Convert.ToBoolean(oNewService.serviceSettings.btnblindxferf);

            oService.allowWarmXfer      = Convert.ToBoolean(oNewService.serviceSettings.warmtransfer);
            oService.allowConference    = Convert.ToBoolean(oNewService.serviceSettings.btnthreewayf);
            oService.allowRecord        = Convert.ToBoolean(oNewService.serviceSettings.btnrecordf);
            oService.allowPlay          = Convert.ToBoolean(oNewService.serviceSettings.btnplayf);
            oService.showCallData       = Convert.ToBoolean(oNewService.serviceSettings.showcalldatadialogf);
            oService.showCallDataSecs   = oNewService.serviceSettings.calldatadialogduration;
            oService.callDataDefId      = oNewService.serviceSettings.calldatadefid;
            oService.wrapAlarmSecs      = oNewService.serviceSettings.wrapwarningdelay;
            oService.requireDisposition = Convert.ToBoolean(oNewService.serviceSettings.reqdispositionf);
            oService.requireWrap        = Convert.ToBoolean(oNewService.serviceSettings.reqwrapf);
            oService.allowNextCall      = Convert.ToBoolean(oNewService.serviceSettings.btnnextcall);
            oService.application        = oNewService.serviceSettings.appdesc;

            if (oService is CServiceAOD)
            {
                ((CServiceAOD)oService).allowPreviewNumberChange = Convert.ToBoolean(oNewService.serviceSettings.allowphonechangeinpreview);
                ((CServiceAOD)oService).timedPreview             = Convert.ToBoolean(oNewService.serviceSettings.timedpreviewflag);
                ((CServiceAOD)oService).timedPreviewSecs         = oNewService.serviceSettings.previewtimeoutinsecs;
            }
            else if (oService is CServiceChat)
            {
                ((CServiceChat)oService).allowChatDisconnect = Convert.ToBoolean(oNewService.serviceSettings.chatdisconnectallowed);
            }

            base.Add(oService.serviceId, oService);
        }
Esempio n. 3
0
        /// <summary>
        /// Load/Update the specified service's settings
        /// </summary>
        internal void Load(CService oService)
        {
            //If already in collection, remove it
            if (base.Contains(oService.serviceId))
            {
                base.RemoveByKey(oService.serviceId);
            }

            UDInfo oInfo = new UDInfo
            {
                listType    = (int)AgentInfoType.GET_SERVICE_SETTINGS,
                serviceId   = oService.serviceId,
                serviceType = (int)oService.serviceType
            };

            ServiceSettings oSvcSettings = (ServiceSettings)mpApp.Portal.WSAgent.getInfo(mpApp.CurrentAgent.AgentArg, oInfo);

            oService.allowHangup        = Convert.ToBoolean(oSvcSettings.btnhangupf);
            oService.allowDial          = Convert.ToBoolean(oSvcSettings.btndialf);
            oService.allow3Way          = Convert.ToBoolean(oSvcSettings.btnxferf);
            oService.allowConsult       = Convert.ToBoolean(oSvcSettings.btnconsultf);
            oService.allowConsultHangup = Convert.ToBoolean(oSvcSettings.btnthreecusthangupf);

            //Hold is not valid for AGD (aka AWD or Workgroup) calls so disable it.
            oService.allowHold = oService.ServiceType != ServiceType.AGD && Convert.ToBoolean(oSvcSettings.btnholdf);

            //AGD (aka AWD or Workgroup) services don't currently have a blind transfer setting in Director so default to enabled.
            oService.allowBlindXfer = oService.ServiceType == ServiceType.AGD || Convert.ToBoolean(oSvcSettings.btnblindxferf);

            oService.allowWarmXfer      = Convert.ToBoolean(oSvcSettings.warmtransfer);
            oService.allowConference    = Convert.ToBoolean(oSvcSettings.btnthreewayf);
            oService.allowRecord        = Convert.ToBoolean(oSvcSettings.btnrecordf);
            oService.allowPlay          = Convert.ToBoolean(oSvcSettings.btnplayf);
            oService.showCallData       = Convert.ToBoolean(oSvcSettings.showcalldatadialogf);
            oService.showCallDataSecs   = oSvcSettings.calldatadialogduration;
            oService.callDataDefId      = oSvcSettings.calldatadefid;
            oService.wrapAlarmSecs      = oSvcSettings.wrapwarningdelay;
            oService.requireDisposition = Convert.ToBoolean(oSvcSettings.reqdispositionf);
            oService.requireWrap        = Convert.ToBoolean(oSvcSettings.reqwrapf);
            oService.allowNextCall      = Convert.ToBoolean(oSvcSettings.btnnextcall);
            oService.application        = oSvcSettings.appdesc;

            if (oService is CServiceAOD)
            {
                ((CServiceAOD)oService).allowPreviewNumberChange = Convert.ToBoolean(oSvcSettings.allowphonechangeinpreview);
                ((CServiceAOD)oService).timedPreview             = Convert.ToBoolean(oSvcSettings.timedpreviewflag);
                ((CServiceAOD)oService).timedPreviewSecs         = oSvcSettings.previewtimeoutinsecs;
            }
            else if (oService is CServiceManual)
            {
                ((CServiceManual)oService).allowSelfCallbacks = Convert.ToBoolean(oSvcSettings.cbselfcallbackflag);

                oInfo = new UDInfo {
                    listType = (int)AgentInfoType.GET_AGENT_SETTINGS
                };
                AgentSetting oAgentSettings = (AgentSetting)mpApp.Portal.WSAgent.getInfo(mpApp.CurrentAgent.AgentArg, oInfo);

                ((CServiceManual)oService).showServiceListForManualDial = Convert.ToBoolean(oAgentSettings.displayServicesF);
                ((CServiceManual)oService).requireServiceForManualDial  = Convert.ToBoolean(oAgentSettings.requireServiceF);
            }
            else if (oService is CServiceChat)
            {
                ((CServiceChat)oService).allowChatDisconnect = Convert.ToBoolean(oSvcSettings.chatdisconnectallowed);
            }

            base.Add(oService.serviceId, oService);
        }