I didn't clarify a few things. First, this is an after hours activity
i.e. 0400 in the morning. Second, we are calling from a central
location to 50+ of our national locations. Tom's suggestion is great.
The vision is to build an application that iterates through a set of
telephone numbers stored in a database. The daily routine would
produce an e-mail message containing any errors that occured on the
"other end of the line". An example of an error is the "three toned"
message - "... the number is busy or has been disconnected. Please
hang up and try your call again."
I know how to pull the list from a database, iterate through the list
and generate the e-mail message. I am reading "Java InstantCode:
Developing Telephony Application" from SkillSoft Press: a code snippet
is below. The problem is that I do not know how to interface with a
physical telephone device (and now going through all of this thought
process - am I posting to the wrong group!?).
import javax.telephony.*;
import javax.telephony.events.*;
/* The MyOutCallObserver class implements the CallObserver interface.
*/
public class JTAPIOutCallObserver implements CallObserver
{
PlacingPhoneCallGUI gui = null;
/* Public constructor takes the object of PlacingPhoneCallGUI
class as parameter. */
public JTAPIOutCallObserver(PlacingPhoneCallGUI gui)
{
this.gui = gui;
}
/* The callChangedEvent() method is invoked every time an event
associated event
with the phone call occurred. */
public void callChangedEvent(CallEv[] evlist)
{
for (int i = 0; i < evlist.length; i++)
{
/* Checking if the event occurred is the connection event.
*/
if (evlist instanceof ConnEv)
{
if (evlist.getID() == ConnAlertingEv.ID)
{
/* This event indicates that the state of the
connection is changed
to the Connection.ALERTING. */
gui.oconn_label.setText("ALERTING");
gui.conn_label.setText("ALERTING");
}
else if (evlist.getID() == ConnInProgressEv.ID)
{
/* This event indicates that the state of the
connection is changed
to Connection.IN_PROGRESS. */
gui.oconn_label.setText("INPROGRESS");
gui.conn_label.setText("INPROGRESS");
}
else if (evlist.getID() == ConnConnectedEv.ID)
{
/* This event indicates that the state of the
connection is changed to
the Connection.CONNECTED. */
gui.oconn_label.setText("CONNECTED");
gui.conn_label.setText("CONNECTED");
}
else if (evlist.getID() == ConnDisconnectedEv.ID)
{
/* This event indicates that the state of the
connection is changed to
the Connection.DISCONNECTED. */
gui.oconn_label.setText("DISCONNECTED");
gui.conn_label.setText("DISCONNECTED");
}
else if (evlist.getID() == ConnUnknownEv.ID)
{
/* This event indicates that the state of the
connection is changed to
the Connection.UNKNOWN. */
gui.oconn_label.setText("UNKNOWN");
gui.conn_label.setText("UNKNOWN");
}
else if (evlist.getID() == ConnCreatedEv.ID)
{
/* This event indicates that the new connection
has been created. */
gui.oconn_label.setText("IDLE");
gui.conn_label.setText("IDLE");
}
}
/* Checking if the event occurred is the terminal
connection event. */
else if (evlist instanceof TermConnEv)
{
if (evlist.getID() == TermConnActiveEv.ID)
{
/* This event indicates that the state of the
terminal connection object is
changed to TerminalConnection.ACTIVE. */
gui.otconn_label.setText("ACTIVE");
gui.tconn_label.setText("ACTIVE");
}
else if (evlist.getID() == TermConnRingingEv.ID)
{
/* This event indicates that the state of the
terminal connection object is
changed to TerminalConnection.RINGING. */
gui.otconn_label.setText("RINGING");
gui.tconn_label.setText("RINGING");
}
else if (evlist.getID() == TermConnDroppedEv.ID)
{
/* This event indicates that the state of the
terminal connection object is
changed to the TerminalConnection.DROPPED. */
gui.otconn_label.setText("DROPPED");
gui.tconn_label.setText("DROPPED");
}
else if (evlist.getID() == TermConnUnknownEv.ID)
{
/* This event indicates that the state of the
terminal connection object is
changed to the TerminalConnection.UNKNOWN. */
gui.otconn_label.setText("UNKNOWN");
gui.tconn_label.setText("UNKNOWN");
}
else if (evlist.getID() == TermConnCreatedEv.ID)
{
/* This event indicates that a new terminal
connection object has been created. */
gui.otconn_label.setText("IDLE");
gui.tconn_label.setText("IDLE");
}
}
}
}
}