示例#1
0
        /* private void OnCallStateChanged(int callId, ESessionState callState, string info)
         * {
         *  IStateMachine state = CallManager.CallList[callId];
         *
         *  number = state.CallingNumber;
         *
         *  textBoxCallState.Text = number;
         *
         *  string contact = contacts.lookup(number);
         *  if (contact != "")
         *      number = contact + " (" + number + ")";
         *
         *  notifyIcon1.BalloonTipTitle = "Eingehender Anruf";
         *  notifyIcon1.BalloonTipText = "Von: " + number + "\r\n" + info;
         *  notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
         *  notifyIcon1.ShowBalloonTip(30);
         * } */

        private void OnIncomingCall(int sessionId, string number, string info)
        {
            incall = CallManager.getCall(sessionId);
            string contact = contacts.lookup(number);

            //if (contact != "")
            //number = contact + " (" + number + ")";

            contact = contact.Replace("|", "\r\n");

            // Add to DB
            HistoryDatabase db = HistoryDatabase.getInstance();

            db.Add(number, contact);

            textBoxCallState.Text      = incall.StateId.ToString();
            textBoxLastCallNumber.Text = number;
            textBoxLastCallDate.Text   = DateTime.Now.ToString();

            notifyIcon1.BalloonTipTitle = "Входящий звонок: " + number;
            notifyIcon1.BalloonTipText  = contact;
            notifyIcon1.BalloonTipIcon  = ToolTipIcon.Info;
            notifyIcon1.ShowBalloonTip(30);

            /*
             * // Send Busy
             * ICallProxyInterface proxy = CallManager.StackProxy.createCallProxy();
             * proxy.serviceRequest((int)EServiceCodes.SC_CFB, "");
             * proxy.endCall();
             */
        }