I'm trying to write an aplication that makes a modem connection and after that sends a dtmf signal. My application creates a call but it doesnt send that DTMF signal.
I'm writing it in C# using TAPI.
What is wrong in that code ?? At button 3 u can see DTMF function.
My application :
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using TAPI3Lib;
namespace dialer
{
    public partial class MainForm : Form
    {
        private TAPIClass tapi;
        private ITAddress[] adresy = new ITAddress[10]; 
        private ITBasicCallControl polaczenie = null;
        private int wybrany = -1; 
        public MainForm()
        {
            InitializeComponent();
            ZainicjalizujTAPI();
        }
        private void ZainicjalizujTAPI()
        {
            try
            {
                tapi = new TAPIClass();
                tapi.Initialize();
                IEnumAddress ea = tapi.EnumerateAddresses();
                ITAddress adres;
                uint arg = 0;
                for(uint i = 0; i < 10; ++i)
                {
                    ea.Next(1, out adres, ref arg);
                    if(adres == null) break;
                    adresy[i] = adres;
                    listaLinii.Items.Add(adres.AddressName);
                }
            }
            catch(Exception wyj)
            {
                MessageBox.Show(wyj.ToString(), "Błąd!");
            }
        }
        void Button1Click(object sender, EventArgs e)
        {
            if(listaLinii.SelectedIndex < 0)
            {
                MessageBox.Show("Nie wybrano linii", "Błąd!");
                return;
            }
            if(polaczenie != null)
            {
                MessageBox.Show("Połączenie już istnieje", "Błąd!");
                return;
            }
            wybrany = listaLinii.SelectedIndex;
            try
            {
                polaczenie = adresy[wybrany].CreateCall("12345678",
                  TapiConstants.LINEADDRESSTYPE_PHONENUMBER,
                  TapiConstants.TAPIMEDIATYPE_DATAMODEM | TapiConstants.TAPIMEDIATYPE_AUDIO);
                polaczenie.SetQOS(TapiConstants.TAPIMEDIATYPE_DATAMODEM | TapiConstants.TAPIMEDIATYPE_AUDIO, 
              QOS_SERVICE_LEVEL.QSL_BEST_EFFORT);
                polaczenie.Connect(false);
            }
            catch(Exception wyj)
            {
                MessageBox.Show(wyj.ToString(), "Błąd!");
                polaczenie = null;
            }
        }
        void Button2Click(object sender, EventArgs e)
        {
            if(polaczenie == null) return;
            try
            {
                polaczenie.Disconnect(DISCONNECT_CODE.DC_NORMAL);
                polaczenie = null;
            }
            catch(Exception wyj)
            {
                MessageBox.Show(wyj.ToString(), "Błąd!");
            }
        }
        // HERE is the button responsible for sending DTMF signal (doesn't work)
        void Button3Click(object sender, EventArgs e)
        {
            if(polaczenie == null) return;
            try
            {
                ITLegacyCallMediaControl2 cmc = (ITLegacyCallMediaControl2) polaczenie;
                cmc.GenerateDigits("246", TapiConstants.LINEDIGITMODE_DTMF);
            }
            catch(Exception wyj)
            {
                MessageBox.Show(wyj.ToString(), "Błąd!");
            }
        }
        void ListaLiniiSelectedIndexChanged(object sender, EventArgs e)
        {
        }
    }