Esempio n. 1
0
        private void btMakeCall_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(tbMakeCall.Text))
            {
                // We need to know if a call in already in progress or not and get its CallId
                Boolean callInProgress   = false;
                String  callIdInProgress = "";

                if ((pbxCall1 != null) && (pbxCall1.CallStatus == Call.Status.ACTIVE))
                {
                    callInProgress   = true;
                    callIdInProgress = pbxCall1.Id;
                }
                else if ((pbxCall2 != null) && (pbxCall2.CallStatus == Call.Status.ACTIVE))
                {
                    callInProgress   = true;
                    callIdInProgress = pbxCall2.Id;
                }

                // If there is not a call in progress we make a simple call
                if (!callInProgress)
                {
                    // Make call
                    rainbowTelephony.MakeCall(tbMakeCall.Text, callback =>
                    {
                        if (!callback.Result.Success)
                        {
                            String output = String.Format("Impossible to make a call - Error:[{0}]", Util.SerializeSdkError(callback.Result));
                            AddStateLine(output);
                            log.LogError(output);
                        }
                    });
                }
                else
                {
                    // Need to make a consulation call
                    rainbowTelephony.ConsultationCall(callIdInProgress, tbMakeCall.Text, callback =>
                    {
                        if (!callback.Result.Success)
                        {
                            String output = String.Format("Impossible to make a call - Error:[{0}]", Util.SerializeSdkError(callback.Result));
                            AddStateLine(output);
                            log.LogError(output);
                        }
                    });
                }
            }
        }
Esempio n. 2
0
 private void CallBtn_Click(object sender, EventArgs e)
 {
     pjsipTelephony.MakeCall(NumberTb.Text);
 }