Beispiel #1
0
        // The actions to take when an outgoing call has reached telco
        private void dialedCall()
        {
            string connectionCallId       = session.ConnectionCallId;
            string connectionDeviceId     = session.ConnectionDeviceId;
            string connectionDeviceIdType = session.ConnectionDeviceIdType;

            // Feed the event back to the user
            if (this.btnLine1.Text == "Idle")
            {
                this.btnLine1.Text      = "On Call";
                this.btnLine1.BackColor = Color.Red;
                FButton.FsButton.ConnectionID_t tempConnectionId = new FButton.FsButton.ConnectionID_t();
                tempConnectionId.callID = Convert.ToUInt32(connectionCallId);
                FButton.FsButton.DeviceID_t tempDeviceId = new FButton.FsButton.DeviceID_t();
                tempDeviceId.device        = strExtension.PadRight(64, '\0').ToCharArray(); //connectionDeviceId.ToCharArray();
                tempConnectionId.deviceID  = tempDeviceId;
                tempConnectionId.devIDType = (FButton.FsButton.ConnectionID_Device_t)Convert.ToUInt32(connectionDeviceIdType);
                this.btnLine1.ActiveCallId = tempConnectionId;
                return;
            }
            else if (this.btnLine2.Text == "Idle")
            {
                this.btnLine2.Text      = "On Call";
                this.btnLine2.BackColor = Color.Red;
                FButton.FsButton.ConnectionID_t tempConnectionId = new FButton.FsButton.ConnectionID_t();
                tempConnectionId.callID = Convert.ToUInt32(connectionCallId);
                FButton.FsButton.DeviceID_t tempDeviceId = new FButton.FsButton.DeviceID_t();
                tempDeviceId.device        = strExtension.PadRight(64, '\0').ToCharArray(); //connectionDeviceId.ToCharArray();
                tempConnectionId.deviceID  = tempDeviceId;
                tempConnectionId.devIDType = (FButton.FsButton.ConnectionID_Device_t)Convert.ToUInt32(connectionDeviceIdType);
                this.btnLine2.ActiveCallId = tempConnectionId;
            }
        }
Beispiel #2
0
        // The actions to take when an alerting call is present
        private void ringingCall()
        {
            string connectionCallId       = session.ConnectionCallId;
            string connectionDeviceId     = session.ConnectionDeviceId;
            string connectionDeviceIdType = session.ConnectionDeviceIdType;
            string callerId = session.CallingDeviceId;

            // Pop up the caller ID *** if the calling party isn't the device itself ***
            if (callerId != this.tbExtension.Text)
            {
                this.tbCallerId.Text = callerId;
                string now = System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString();
                this.tbCalledAt.Text = now;

                // Feed the event back to the user
                if (this.btnLine1.Text == "Idle")
                {
                    this.btnLine1.Text = "Ring";
                    this.btnLine1.FlasherButtonColorOn  = Color.Gray;
                    this.btnLine1.FlasherButtonColorOff = Color.Red;
                    this.btnLine1.FlasherButtonStart(FButton.FlashIntervalSpeed.BlipFast);
                    FButton.FsButton.ConnectionID_t tempConnectionId = new FButton.FsButton.ConnectionID_t();
                    tempConnectionId.callID = Convert.ToUInt32(connectionCallId);
                    FButton.FsButton.DeviceID_t tempDeviceId = new FButton.FsButton.DeviceID_t();
                    tempDeviceId.device        = connectionDeviceId.ToCharArray();
                    tempConnectionId.deviceID  = tempDeviceId;
                    tempConnectionId.devIDType = (FButton.FsButton.ConnectionID_Device_t)Convert.ToUInt32(connectionDeviceIdType);
                    this.btnLine1.ActiveCallId = tempConnectionId;
                    this.WindowState           = FormWindowState.Normal;
                    if (!muted)
                    {
                        player.SoundLocation = @"ring.wav";
                        player.Play();
                    }
                    return;
                }
                else if (this.btnLine2.Text == "Idle")
                {
                    this.btnLine2.Text = "Ring";
                    this.btnLine2.FlasherButtonColorOn  = Color.Gray;
                    this.btnLine2.FlasherButtonColorOff = Color.Red;
                    this.btnLine2.FlasherButtonStart(FButton.FlashIntervalSpeed.BlipFast);
                    FButton.FsButton.ConnectionID_t tempConnectionId = new FButton.FsButton.ConnectionID_t();
                    tempConnectionId.callID = Convert.ToUInt32(connectionCallId);
                    FButton.FsButton.DeviceID_t tempDeviceId = new FButton.FsButton.DeviceID_t();
                    tempDeviceId.device        = connectionDeviceId.ToCharArray();
                    tempConnectionId.deviceID  = tempDeviceId;
                    tempConnectionId.devIDType = (FButton.FsButton.ConnectionID_Device_t)Convert.ToUInt32(connectionDeviceIdType);
                    this.btnLine2.ActiveCallId = tempConnectionId;
                    this.WindowState           = FormWindowState.Normal;
                    if (!muted)
                    {
                        player.SoundLocation = @"ring.wav";
                        player.Play();
                    }
                }
            }
        }