Re: JTAPI 1.2 / XTAPI DTMF Tone detection

Kenny Wong <[email protected]> Wed, 7 Sep 2005 15:25:11 +0800
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <[email protected]>
Hi All, 
I am having a problem with the creating a PhoneTerminal.
 I have coded as follows:
  Terminal terminal = myprovider.getTerminal("352");
  ComponentGroup groups[] = null;

if (terminal instanceof PhoneTerminal) {
groups = ((PhoneTerminal)terminal).getComponentGroups(); 
..............
 ..............
 }
 but the if statement is always returning false; hence the code will not 
reach the statement within the if scope.
 Thanks and please advise.
Kenny

 On 8/29/05, Enrico Goosen <[email protected]> wrote: 
> 
> Hi all,
> 
> I'm new to JTAPI and I need help with DTMF tone detection.
> I've got a simple class that makes a call to my mobile phone.
> I get notified on call events:
> 
> Connection to Address: 0 is INPROGRESS
> 
> Connection to Address: 0833055676; is ALERTING
> 
> Connection to Address: 0 is CONNECTED
> 
> Connection to Address: 0833055676; is CONNECTED
> 
> When I receive the ConnConnectedEv I also enable DTMF:
> ...
> mtc.setDtmfDetection(true);
> ...
> 
> and I check for MediaTermConnDtmfEv:
> ...
> else if (evlist[i].getID() == MediaTermConnDtmfEv.ID) {
> System.out.println("MediaTermConnDtmfEv");
> /* Print out the DTMF digits */
> char digit = ((MediaTermConnDtmfEv)evlist[i]).getDtmfDigit();
> System.out.println("detected DTMF: " + digit);
> 
> TerminalConnection tc = ((TermConnEv)evlist
> [i]).getTerminalConnection();
> MediaTerminalConnection mtc = (MediaTerminalConnection)tc;
> 
> try{
> // Echo out the same digit we detected
> mtc.generateDtmf(digit + "");
> }catch(Exception e){
> System.out.println("Exception generateDtmf: " + e.toString
> ());
> }
> }
> ...
> Somehow I'm not getting DTMF events.
> My program doesn't detect when the call has been hung up by remote
> terminal either.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Enrico
> 
> 
> ===========================================================================
> 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".
>

===========================================================================
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".