Re: Deactivated java.telephony.phone.Component functionality
Kenny Wong <[email protected]> Wed, 23 Nov 2005 19:53:40 -0700
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Iris,
I have tried to use the package java.telephony.phone by following the
online code found in the Jtapi website. The problem is that I recieve a
Null Exception stating that the variable groups is null. I have tried
putting some print statment for debugging ppurposes and found that the
terminal did not recognize that the terminal is an instance of
PhoneTerminal. Thus it did not enter the if condition. Could you please
advise me on what is causing it?
I wanted to invoke the button on my phone to perform a flash hook
transfer. But I am having trouble creating a logical instance of the
terminal(phone).
The code is as follows:
Address address = provider.getAddress("355");
Terminal terminal = provider.getTerminal("355");
ComponentGroup groups[] = null;
if (terminal instanceof PhoneTerminal) {
groups = ((PhoneTerminal)
terminal).getComponentGroups();
}
Component components[] = groups[0].getComponents();
System.out.println("Component: "+ components);
for (int i = 0; i < components.length; i++) {
if (components[i] instanceof
PhoneMicrophone) {
PhoneMicrophone mic =
(PhoneMicrophone)components[i];
mic.setGain(PhoneMicrophone.FULL);
}
}
} catch (Exception excp) {
excp.printStackTrace();
}
Thanks,
Kenny
===========================================================================
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".