Example #1
0
        /// <summary>
        /// Login Interface...
        /// </summary>
        /// <returns></returns>
        public override bool InitAndLogOn()
        {
            TelephonyProvider.CtiType ctiType = TelephonyProvider.CtiType.None;
            string agentNumber = string.Empty;

            try
            {
                ConfigurationValueReader configReader = ConfigurationValueReader.ConfigurationReader();
                ctiType     = (TelephonyProvider.CtiType)Convert.ToInt32(configReader.ReadAppSettings("CtiType"), CultureInfo.InvariantCulture);
                agentNumber = configReader.ReadAppSettings("MachineName");
            }
            catch
            {
            }

            if (ctiType == TelephonyProvider.CtiType.None ||
                string.IsNullOrEmpty(agentNumber))
            {
                return(false);
            }

            // Initialize the CTI class
            ctiProvider = InitializeCti();

            if (ctiProvider != null)
            {
                bool ctiLogin = Init(ctiType);

                // If agentNumber is null, then we aren't supporting CTI.
                if (ctiLogin && !string.IsNullOrEmpty(agentNumber))
                {
                    myLine = InitializeLine(agentNumber);
                    if (myLine == null)
                    {
                        Logging.Error(Application.ProductName, ResourceStrings.UNABLETOCONFIGUREPHONE);
                    }

                    /// this is the new call event for TAPI/TSAPI
                    cti.Cti.CallChanged += new CallEventHandler(Cti_CallChanged);
                }
            }

            if (ctiProvider != null)
            {
                //raise Agent ready Event.
                if (AgentStateChangedEvent != null)
                {
                    AgentStateChangedEvent(this, new CtiCoreEventArgs("AgentStateChange", CtiAgentStates.AVAILABLE, string.Empty));
                }
            }

            // True for success
            return(ctiProvider != null);
        }
        /// <summary>
        /// Initialization Method
        /// </summary>
        /// <param name="type">Type</param>
        /// <param name="user">User</param>
        /// <param name="password">Password</param>
        /// <param name="agentID">Agent ID</param>
        /// <param name="agentPassword">Agent Password</param>
        /// <param name="agentNumber">Agent Number</param>
        /// <returns>Boolean indicating success or failure.</returns>
        public override bool Init(TelephonyProvider.CtiType type, string user, string password, string agentID, string agentPassword, string agentNumber)
        {
            base.Init(type, user, password, agentID, agentPassword, agentNumber);
            if (CtiTapi.Init() != 0)
            {
                Lines = LinesClassProvider.Instance();
                Lines.Init(this, type);
                CtiTapi.CallChanged += new CtiLayerTapiLib._DCtiLayerTapiEvents_CallChangedEventHandler(this.Cti_CallChanged);

                alreadyInited = true;
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Initialization Method
        /// </summary>
        /// <param name="type">Type</param>
        /// <param name="user">User</param>
        /// <param name="password">Password</param>
        /// <param name="agentID">Agent ID</param>
        /// <param name="agentPassword">Agent Password</param>
        /// <param name="agentNumber">Agent Number</param>
        /// <returns>Boolean indicating success or failure.</returns>
        public override bool Init(TelephonyProvider.CtiType type, string user, string password, string agentID, string agentPassword, string agentNumber)
        {
            base.Init(type, user, password, agentID, agentPassword, agentNumber);

            string serverName = CtiTsapi.GetServerNames();

            string [] serverNames = serverName.Split(new char[] { '\n' });
            if (CtiTsapi.Init(serverNames[0], user, password) != 0)
            {
                Lines = LinesClassProvider.Instance();
                Lines.Init(this, type);
                CtiTsapi.CallChanged += new CtiLayerTsapiLib._DCtiLayerTsapiEvents_CallChangedEventHandler(this.Cti_CallChanged);

                alreadyInited = true;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
 /// <summary>
 /// For use in installations using the Avaya SoftPhone product.
 /// </summary>
 /// <param name="type">The type of telephony API to use.</param>
 /// <param name="user"></param>
 /// <param name="password"></param>
 /// <param name="agentId"></param>
 /// <param name="agentPassword"></param>
 /// <param name="agentNumber"></param>
 /// <returns></returns>
 public bool Init(TelephonyProvider.CtiType type, string user, string password, string agentId, string agentPassword, string agentNumber)
 {
     return(cti.Init(type, user, password, agentId, agentPassword, agentNumber));
 }
Example #5
0
 /// <summary>
 /// For backwards compatibility (used for Avaya TSAPI)
 /// </summary>
 /// <param name="type">The type of telephony API to use.</param>
 /// <param name="user"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public bool Init(TelephonyProvider.CtiType type, string user, string password)
 {
     return(cti.Init(type, user, password));
 }
Example #6
0
 /// <summary>
 /// For backwards compatibility (used for TAPI and demos)
 /// </summary>
 /// <param name="type">The type of telephony API to use.</param>
 /// <returns></returns>
 public bool Init(TelephonyProvider.CtiType type)
 {
     return(cti.Init(type));
 }