Re: CISCO JTAPI and dtmf collection for incoming call

Stephan Steiner <[email protected]>
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <LISTSERV%[email protected]>
Geez

If you have the basic developer support package, one case costs you $500.
For that money, a skilled professional should be able to help you for at
least 1-2 hours. I'd absolutely refuse the closing of the case if I were you.

Anyway, I've never used DTMF detection but I think this'll help:

Here's the class definition of my own CTI Port:

public class CTIPort implements CallControlCallObserver, MediaCallObserver,
        CiscoTerminalObserver, CiscoAddressObserver
{
// code for your class
}

As you can see, I have a CallControlObserver which gets me events related to
call control (like calls being made, calls being picked up, etc). The 2nd
observer is the MediaCallObserver, which gets events that relate to
MediaCalls (all the events definied in javax.telephony.media.events package
.. if you haven't got it yet, download the JTAPI javadoc from java.sun.com
to get a complete overview over all JTAPI capabilities). That package
defines 6 interfaces for events, one of them being MediaTermConnDtmfEv.

You can catch those events in the callChangedEvent() method. So, in your
callChangedEvent method (whose method definition looks something like this:

public void callChangedEvent(CallEv[] eventList)
{
... your method handling code
}
)
you'll put something like this:

if (eventList[i].getID() == MediaTermConnDtmfEv.ID)
{
char digit = ((MediaTermConnDtmfEv)eventList[i]).getDtmfDigit();
System.out.println("caller pressed key " + char + " on the phone");
// do some more processing
}

That's all there is to it. I guess it's not too complex but you gotta know
where to look. Hopefully this, unlike the response for which you're supposed
to pay 500 bucks, will get you where you want.

Regards
Stephan

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.