Esempio n. 1
0
 private void btn2Call1_Click(object sender, EventArgs e)
 {
     if (pbxCall1 != null)
     {
         if (pbxCall1.CallStatus == Call.Status.ACTIVE)
         {
             // Send DTMF
             rainbowTelephony.SendDtmf(pbxCall1.Id, cbCall1Dtmf.SelectedIndex.ToString(), callback =>
             {
                 if (!callback.Result.Success)
                 {
                     String output = String.Format("Impossible to sedn DTMF [{0}] - Error:[{1}]", pbxCall1.Id, Util.SerializeSdkError(callback.Result));
                     AddStateLine(output);
                     log.LogError(output);
                 }
             });
         }
         else if (pbxCall1.CallStatus == Call.Status.RINGING_INCOMING)
         {
             // Deflect call to voice mail
             rainbowTelephony.DeflectCallToMevo(pbxCall1.Id, callback =>
             {
                 if (!callback.Result.Success)
                 {
                     String output = String.Format("Impossible to deflect call to voice mail [{0}] - Error:[{1}]", pbxCall1.Id, Util.SerializeSdkError(callback.Result));
                     AddStateLine(output);
                     log.LogError(output);
                 }
             });
         }
     }
 }