コード例 #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);
        }
コード例 #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);
        }