Пример #1
0
        private void btCallFwdSet_Click(object sender, EventArgs e)
        {
            String output = null;

            if (rbCallFwdDisable.Checked)
            {
                rainbowTelephony.DeactivateCallForward(callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = "Call fwd deactivated";
                    }
                    else
                    {
                        output = String.Format("Not possible to deactivate call forward - error:[{0}]", Util.SerializeSdkError(callback.Result));
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
            else if (rbCallFwdToVm.Checked)
            {
                rainbowTelephony.ActivateCallForwardOnVoiceMail(callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = "Call fwd to VM activated";
                    }
                    else
                    {
                        output = String.Format("Not possible to activate call forward to VM - error:[{0}]", Util.SerializeSdkError(callback.Result));
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
            else if (rbCallFwdToPhoneNumber.Checked)
            {
                String phoneNumber = tbCallFwdPhoneNumber.Text;
                rainbowTelephony.ActivateCallForwardOnPhoneNumber(phoneNumber, callback =>
                {
                    if (callback.Result.Success)
                    {
                        output = String.Format("Call fwd to [{0}] activated", phoneNumber);
                    }
                    else
                    {
                        output = String.Format("Not possible to activate call forward to phone number [{1}] - error:[{0}]", Util.SerializeSdkError(callback.Result), phoneNumber);
                        log.LogError(output);
                    }
                    AddStateLine(output);
                });
            }
        }