예제 #1
0
        void skypeProxy_SkypeResponse(object theSender, SkypeResponseEventArgs theEventArgs)
        {
            string response = theEventArgs.Response;

            if (!(SkypeProxy.IsDurationMessage(response)))
            {
                this.AppendText(string.Format("Response: {0}\r\n", response));
            }
        }
예제 #2
0
 void aSkype_SkypeResponse(object theSender, SkypeResponseEventArgs theEventArgs)
 {
     textBox1.AppendText(string.Format("Response: {0}\r\n", theEventArgs.Response));
 }
예제 #3
0
        void aSkype_SkypeResponse(object theSender, SkypeResponseEventArgs theEventArgs)
        {
            string texto = string.Empty;

            textBox1.AppendText(string.Format("Respuesta: {0}\r\n", theEventArgs.Response));
            texto = textBox1.Text;
            //words = phrase.Split(default(stringo]), StringSplitOptions.RemoveEmptyEntries);
            //texto.Split(default(string[]), StringSplitOptions.RemoveEmptyEntries);
            // Split string on spaces.
            // ... This will separate all the words.
            //
            //string[] words = s.Split(' ');
            string[] words = texto.Split(' ');
            int      num_cont = 1, num_cont2 = 0, num_read = 0, sqlprint = 0;
            long     numero;
            string   temp2 = string.Empty;

            foreach (string word in words)
            {
                //string consoleString = Console.ReadLine();
                Console.WriteLine(word);
                //if (word == "PSTN_NUMBER")
                //{
                //    num_cont2 = 1;
                //    ishangup = false;
                //}
                if (word == "CALL")
                {
                    num_cont = 0;
                }
                if (num_cont2 == 1)
                {
                    if (word == "\r\nRespuesta:")
                    // if (word == "ALTER")
                    {
                        lbl_phone.Text = "Sin Numero";
                        num_cont2      = 0;
                        ishangup       = false;
                        continue;
                        //break;
                    }

                    else
                    {
                        lbl_phone.Text = word;
                        lbl_phone.Text = lbl_phone.Text.Remove(lbl_phone.Text.LastIndexOf(Environment.NewLine));
                        ssss           = lbl_phone.Text;
                        // lbl_phone.Text = lbl_phone.Text.Remove(0, 1);
                        // int length = lbl_phone.Text.Length;


                        if (sqlprint == 0)
                        {
                            fn_AddCall();
                            //frm.Show();
                            ishangup      = false;
                            textBox1.Text = "";
                            aSkype.Conect();
                            sqlprint++;
                        }
                        num_cont2 = 0;
                    }
                }
                if (word == "PSTN_NUMBER")
                {
                    num_cont2 = 1;
                    ishangup  = false;
                    string num = lbl_phone.Text;
                }

                if (num_cont != 1)
                {
                    bool canConvert = long.TryParse(word, out numero);
                    if (canConvert == true)
                    {
                        // Console.WriteLine("number1 now = {0}", word);
                        lbl_call.Text = word;
                        //aSkype.Command("GET CALL " + lbl_call.Text + "PSTN_NUMBER");
                        num_cont = 1;
                        DateTime time   = DateTime.Now;              // Use current time
                        string   format = "MMM ddd d HH:mm:ss yyyy"; // Use this format
                        //Console.WriteLine(time.ToString(format));  // Write to console
                        lbl_date.Text = time.ToString(format);
                        num_read++;
                        // if (lbl_call.Text == word)
                        //   aSkype.Command("GET CALL " + lbl_call.Text + "PSTN_NUMBER");
                    }
                    else
                    {
                        if (num_read == 2)
                        {
                            if (ishangup == false)
                            {
                                aSkype.Command("GET CALL " + lbl_call.Text + " PSTN_NUMBER");

                                // aSkype.Command("GET CONTACT " + lbl_call.Text + " PSTN_NUMBER");
                                // call.Status = SKYPEAPILib.SkypeCallProgress.prgFinished;
                                aSkype.Command("alter call " + lbl_call.Text + " hangup");

                                ishangup = true;
                                temp    += texto;
                                texto    = textBox1.Text;
                                num_read = 0;
                                //textBox1.Text = "";

                                conta31++;
                                continue;

                                //break;
                            }
                            else
                            {
                                //para colgar la llamada
                                ishangup = false;
                                //mdiForm3 frm = new mdiForm3(numeroenviar);
                                //frm.Show();
                                //numeroenviar = lbl_phone.Text;

                                //textBox1.Text = "";
                                //if (conta >= 1)
                                //{
                                //    ventana.Dispose();

                                //}

                                break;
                            }
                        }

                        if (conta31 >= 3)
                        {
                            open(ssss);
                            conta31 = 0;
                            aSkype.Conect();
                        }
                    }
                }
                //fn_AddCall();
            }
        }