i am a novice to java and netbeans both and complete newbie to java telephony.I am trying to import JTAPI (java telephony api) in netbeans project for past few days but i am unable to do so. I tried a lot of things and searched almost everywhere on internet but couldn't find a solution. I am desperate to find a solution so any help would really be appreciated.
coming to point.
i downloaded Jtapi from
http://download.oracle.com/otndocs/jcp/jtapi-1.4-fr3-spec-oth-JSpec/
and saved the jtapi-1_4-fr3-spec.zip file on desktop
then made a new netbeans java project. then i right clicked on libraries tab under the project->click add zip/folder-> entered the location of downloaded api.
then added a java file named "MyOutCallObserver.java" in the project
i opened the Jtapi specification and copied the code for detecting calls and pasted in the project. this code is provided in the following link too.
http://www.brekeke.com/products/jtapi/JTAPIspecdoc/javax/telephony/package-summary.html
import javax.telephony.*;
import javax.telephony.events.*;
/*
* The MyOutCallObserver class implements the CallObserver
* interface and receives all events associated with the Call.
*/
public class MyOutCallObserver1 implements CallObserver {
public void callChangedEvent(CallEv[] evlist) {
for (int i = 0; i < evlist.length; i++) {
if (evlist[i] instanceof ConnEv) {
String name = null;
try {
Connection connection = ((ConnEv)evlist[i]).getConnection();
Address addr = connection.getAddress();
name = addr.getName();
} catch (Exception excp) {
// Handle Exceptions
}
String msg = "Connection to Address: " + name + " is ";
if (evlist[i].getID() == ConnAlertingEv.ID) {
System.out.println(msg + "ALERTING");
}
else if (evlist[i].getID() == ConnInProgressEv.ID) {
System.out.println(msg + "INPROGRESS");
}
else if (evlist[i].getID() == ConnConnectedEv.ID) {
System.out.println(msg + "CONNECTED");
}
else if (evlist[i].getID() == ConnDisconnectedEv.ID) {
System.out.println(msg + "DISCONNECTED");
}
}
}
}
}
but an compile-time error was generated in the project stating the import statement wasn't working. then i tried shifting the zip file to
C:\Program Files\Java\jdk1.7.0_25
C:\Program Files\Java\jdk1.7.0_25\jre\lib\ext
also i created a new library from tools menu and then added it to project
but nothing seemed to work.
after nothing was working i extracted the zip file and copied it where netbeans project was saved. i thought the problem was solved as there was no compile time error but another blood-sucking issue showed up! now the netbeans won't be able to import the CallObserver interface and appeared in dashed line and i had no clue about how to proceed.!
i will be really grateful to anyone who could tell me what am i not doing right and how to get it right.
i would be really grateful if you can tell me step by step procedure and if possible with screenshots.
thanks a lot in advance. – Sparsh Parnami Oct 14 '14 at 12:52