CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2001
    Location
    MedellĂ­n - Antioquia,Colombia - SurAmerica
    Posts
    86

    Catching the Tones and Digits in Calls (Tapi)

    Hello.

    I am implementing the call using Tapi.
    I already I have the call, Now I want to put posibilities to the Responser (People) in my application.
    Example: I make a ordinal (voice) call and I have a TextToSpeech machine for read my text, I need to know what is the elected option.

    The interaction consist pressing Digit Number or *, #...

    I need to cacth the Digital Tones and Digital Numbers using API (Tapi) Functions.

    How do it?

    Thanks a lot.

    joseluisbz@bigfoot.com
    Please Response to:joseluisbz@bigfoot.com
    http://www.bigfoot.com/~joseluisbz

  2. #2
    Join Date
    Jun 2002
    Location
    Cambridge, UK
    Posts
    28
    So would I like to know. This has been bugging me, folks say I need to open the wave device and interpret the suff comming in.

    That sounds like rocket science to me any other ideas?

  3. #3
    Join Date
    Oct 2002
    Location
    Pakistan
    Posts
    123

    TAPI 3?

    R u using TAPI 3.0 for ur project? if yes then notify me i can help.

    Aamir

  4. #4
    Join Date
    Jun 2002
    Location
    Cambridge, UK
    Posts
    28
    Hi, thanks.
    We are using Unimodem V. I have got a test app at the moment that does not actually give me the tones, but on a port monitor, I can see that the tones are being interpreted by the modem.

    I would do my own research, it just so happens it has taken 3 weeks to get this far. TAPI is not walk in the park. I also have problems deciding what modem to get, do U have any recommendations?

  5. #5
    Join Date
    Oct 2002
    Location
    Pakistan
    Posts
    123

    Smile

    I asked u in advance that r u using TAPI 3.0? because if yes then i may solve ur problem. And assuming if u r using TAPI 3 here is the solution to ur question.

    There is an interface named "ITLegacyCallMediaControl" in tapi, u need to access this interface. Here is the sample code.

    ITLegacyCallMediaControl *gplcmc; //defined global
    ITBasicCallControl *gpCall;// defined global

    // write this code in the part where u r entertaining an incoming call which has just arrieved

    if(gplcmc == NULL)
    {
    gpCall->QueryInterface(IID_ITLegacyCallMediaControl,
    (void **) &gplcmc);
    gplcmc->DetectDigits(LINEDIGITMODE_DTMF);// start listening for digits
    gplcmc->Release();
    gplcmc = NULL;
    }

    u also must tell tapi that u want to listen for DTMF digits, for this purpose register "TE_DIGITEVENT" with other events.

    gpTapi->put_EventFilter( TE_CALLNOTIFICATION | TE_CALLSTATE
    | TE_CALLMEDIA | TE_DIGITEVENT );

    and now u will receive an event "TE_DIGITEVENT" whenever user (on the other end, which may b a telefone or some Telephony software) presses some digit, to get the digit pressed by user use this code in ur application.

    ITDigitDetectionEvent *pdde;
    char dtmf;
    pEvent->QueryInterface(IID_ITDigitDetectionEvent, (void **)&pdde);
    pdde->get_Digit((unsigned char *)&dtmf);
    pdde->Release();

    and now u have the digit pressed by the user in "dtmf" here pEvent is the object associated with this event (in this case it was "ITDigitDetectionEvent").

    if u have any problem in this code just ask 4 it!

    Aamir!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured