|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.signal.DesktopSignaling
The primary Signaling Object that allows the application to access all telephony services.
Inner Class Summary | |
class |
DesktopSignaling.Result
Inner Class containing the result of a Dial Sequence. |
Field Summary | |
protected static int |
globalPhoneValue
the number of digits that define a long distance phone call |
protected SignalingObserver |
myApp
Application's (that implements SignalingObserver) Handle |
protected java.util.Hashtable |
myConnectionList
Hashtable of all Signal connections |
protected long |
myConnSeqNumber
Unique sequence number |
protected java.lang.String |
myDesc
Description of application |
protected cnrg.itx.ds.DirectoryService |
myDirS
Directory Service Handle |
protected DesktopSignalingServer |
myDSS
DesktopSignalingServer Handle |
protected java.net.InetAddress |
myIAdd
IP Address in InetAddress format |
protected cnrg.itx.ds.Location |
myLoc
Location of this machine; Used by Server Thread, DS & App. |
protected java.lang.String |
myName
String representation of IP Address |
protected cnrg.itx.ds.Password |
myPassword
user's password |
protected int |
myServerPort
Port Server Thread will listen on. |
protected cnrg.itx.ds.UserID |
myUID
email address or phone number |
protected static java.lang.String |
SIPContentType
the type of media used for the body |
protected static java.lang.String |
SIPTransport
the transport protocol used when sending SIP packets |
protected static java.lang.String |
SIPVersion
the SIP version this DesktopSignaling implements |
protected static int |
TIMEOUT
Timeout value for all Signaling Sockets using TCP |
protected static boolean |
useSIP
true if this DesktopSignaling implements SIP; false otherwise |
Constructor Summary | |
DesktopSignaling(SignalingObserver so)
Constructor for DesktopSignaling for applications that run without a Directory Service - i.e. |
|
DesktopSignaling(SignalingObserver so,
int port)
Constructor for DesktopSignaling for applications that run without a Directory Service - i.e. |
|
DesktopSignaling(SignalingObserver so,
java.lang.String uid,
int port)
Constructor for DesktopSignaling for applications that run without a Directory Service - i.e. |
|
DesktopSignaling(SignalingObserver so,
java.lang.String uid,
java.lang.String pass)
Constructor for a DesktopSignaling component for an application with no specified description and config file. |
|
DesktopSignaling(SignalingObserver so,
java.lang.String uid,
java.lang.String pass,
java.lang.String desc,
java.lang.String config)
Constructor for DesktopSignaling with an app description and config file for Directory Service |
|
DesktopSignaling(SignalingObserver so,
java.lang.String uid,
java.lang.String pass,
java.lang.String desc,
java.lang.String config,
boolean ifSIP)
Constructor for DesktopSignaling as above with a boolean stating if this uses the SIP protocol |
Method Summary | |
SignalConnection |
Dial(cnrg.itx.ds.Location peerLoc)
Returns a SignalConnection containing the data connection object to be used to transferring sound data. |
SignalConnection |
Dial(cnrg.itx.ds.Location peerLoc,
cnrg.itx.datax.Channel cInput,
cnrg.itx.datax.Channel cOutput)
Returns a SignalConnection containing the data connection object to be used to transferring sound data. |
SignalConnection |
Dial(cnrg.itx.ds.Location peerLoc,
cnrg.itx.datax.Channel cInput,
cnrg.itx.datax.Channel cOutput,
SignalConnectionObserver sco)
Returns a SignalConnection containing the data connection object to be used to transferring sound data. |
SignalConnection |
Dial(cnrg.itx.ds.Location peerLoc,
SignalConnectionObserver sco)
Returns a SignalConnection containing the data connection object to be used to transferring sound data. |
SignalConnection |
Dial(java.lang.String userid)
Dials a peer application and returns a SignalConnection containing the connection object to use for communication. |
SignalConnection |
Dial(java.lang.String userid,
cnrg.itx.datax.Channel cInput,
cnrg.itx.datax.Channel cOutput)
Returns a SignalConnection containing the connection object to use for communication. |
SignalConnection |
Dial(java.lang.String userid,
cnrg.itx.ds.Location peerLoc)
Returns a SignalConnection containing the data connection object to be used to transferring sound data. |
SignalConnection |
Dial(java.lang.String userid,
cnrg.itx.ds.Location destAdd,
cnrg.itx.datax.Channel cInput,
cnrg.itx.datax.Channel cOutput)
This is the primary Location-based, blocking, Dial method. |
SignalConnection |
Dial(java.lang.String userid,
cnrg.itx.ds.Location userLoc,
cnrg.itx.datax.Channel cInput,
cnrg.itx.datax.Channel cOutput,
SignalConnectionObserver sco)
Returns a SignalConnection containing the connection object to use for communication. |
SignalConnection |
Dial(java.lang.String userid,
cnrg.itx.ds.Location userLoc,
SignalConnectionObserver sco)
Returns a SignalConnection containing the connection object to use for communication. |
private SignalConnection |
getConnection(java.lang.Long seq)
Gets the SignalConnection object from the hashtable corresponding with a sequence number. |
private cnrg.itx.datax.Channel |
getDefaultInputChannel()
returns the default input channel for data communications which is NetworkSource to speakers |
private cnrg.itx.datax.Channel |
getDefaultOutputChannel()
returns the default output channel for data communications which is microphone to NetworkDestination |
cnrg.itx.ds.DirectoryService |
getDirectory()
This method allows application to get a handle to a ready-to-use Directory Service. |
cnrg.itx.ds.LocationList |
getLocationList(java.lang.String userid)
This method allows an application to get a list of possible locations for a given user. |
java.lang.String |
getName()
Returns the name of the computer on which we are running |
int |
getPort()
This method returns the port on which the SignalingServer is listening |
private java.lang.Long |
getSequence()
Gets the current connection's sequence number. |
int |
getTimeout()
This method returns the timeout value currently being used for socket connections by Signaling. |
protected void |
handleAliveInvite(AliveSignalEvent ase,
java.net.Socket s)
This method is used to handle an alive request. |
protected void |
handleDialInvite(InviteSignalEvent ise,
java.net.Socket so)
This method is used to handle an incoming call. |
protected void |
handleHangupInvite(HangupSignalEvent hse,
java.net.Socket s)
This method is used to handle a hangup request. |
protected void |
handlePeerNotAlive(SignalConnection sc)
This method is used to clear up resources if the peer application is no longer active. |
protected void |
handleSendDTMFInvite(DTMFSignalEvent dtmfse,
java.net.Socket s)
This method is used to handle an incoming DTMF tone. |
void |
Hangup(SignalConnection sc)
Hangs up a given SignalConnection being used for a call. |
private void |
initDeskSig(SignalingObserver so)
Sets up selected fields in the DesktopSignaling object. |
boolean |
isAlive(SignalConnection sc)
This method queries a peer application to check if it is still running. |
void |
logout()
This method unregisters the Signaling Component with Directory Services (if myDirS is not null) and kills the server thread. |
private SignalConnection |
processResult(DesktopSignaling.Result ret,
cnrg.itx.datax.AudioConnection ac,
boolean outLast,
boolean busyFlag,
java.lang.String userid)
processes the Result from tryDialSequence, which encapsulates our peer's reaction to our Invite. |
private void |
putConnection(java.lang.Long seq,
SignalConnection sc)
Places a SignalConnection object into the hashtable. |
protected void |
Register()
This method registers the DesktopSignaling Component with DirectoryService. |
private void |
removeConnection(java.lang.Long seq)
Removes a SignalConnection object from the hashtable. |
void |
sendDTMF(java.lang.String s,
SignalConnection sc)
This method sends a DTMF tone, as a string, to the destination on a given SignalConnection |
protected java.net.Socket |
sendNewPacket(SigPacket send,
java.lang.String ip,
int p)
This method sends a packet over a TCP connection. |
protected void |
sendPacket(SigPacket send,
java.net.Socket sock,
java.lang.String topHeader,
java.lang.String method)
This method sends a packet over an TCP socket. |
protected void |
setServerPort(int p)
The DesktopSignalingServer thread uses this method to register its port with DesktopSignaling. |
void |
setTimeout(int t)
This method allows the application to set the timeout value to use for socket connections. |
protected DesktopSignaling.Result |
tryDialSequence(cnrg.itx.ds.UserID destUID,
cnrg.itx.ds.Location destAdd,
cnrg.itx.datax.Connection ac)
This method performs a Dial Sequence including the 3-way handshake. |
protected int |
unRegister()
This method Unregisters the DesktopSignaling Component on DirectoryService. |
protected SigPacket |
waitForPacket(java.net.Socket sock)
This method waits for a packet on a given TCP socket. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected cnrg.itx.ds.UserID myUID
protected cnrg.itx.ds.Password myPassword
protected java.lang.String myDesc
protected java.lang.String myName
protected cnrg.itx.ds.DirectoryService myDirS
protected DesktopSignalingServer myDSS
protected SignalingObserver myApp
protected java.util.Hashtable myConnectionList
protected long myConnSeqNumber
protected java.net.InetAddress myIAdd
protected cnrg.itx.ds.Location myLoc
protected int myServerPort
protected static int TIMEOUT
protected static boolean useSIP
protected static java.lang.String SIPVersion
protected static java.lang.String SIPTransport
protected static java.lang.String SIPContentType
protected static int globalPhoneValue
Constructor Detail |
public DesktopSignaling(SignalingObserver so, java.lang.String uid, java.lang.String pass) throws cnrg.itx.ds.DirectoryServiceException
so
- the SignalingObserver handle for the Applicationuid
- the UserID of the userpass
- the password of the userDirectoryServiceException
public DesktopSignaling(SignalingObserver so, java.lang.String uid, java.lang.String pass, java.lang.String desc, java.lang.String config) throws cnrg.itx.ds.DirectoryServiceException
so
- the SignalingObserver handle for the Applicationuid
- the UserID of the userpass
- the password of the userdesc
- the String representing the type of application instantiating this componentconfig
- is the name of the configuration file to use for Directory ServiceDirectoryServiceException
public DesktopSignaling(SignalingObserver so, java.lang.String uid, java.lang.String pass, java.lang.String desc, java.lang.String config, boolean ifSIP) throws cnrg.itx.ds.DirectoryServiceException
so
- the SignalingObserver handle for the Applicationuid
- the UserID of the userpass
- the password of the userdesc
- the String representing the type of application instantiating this componentconfig
- is the name of the configuration file to use for Directory ServiceifSIP
- true if DesktopSignaling uses SIP; false otherwiseDirectoryServiceException
public DesktopSignaling(SignalingObserver so)
so
- - SignalingObserver that will handle SigEventspublic DesktopSignaling(SignalingObserver so, int port)
this
- - SignalingObserver that will handle SigEventsport
- - the port on which the server should listen. (If 0,
the server will listen on any free port)public DesktopSignaling(SignalingObserver so, java.lang.String uid, int port)
this
- - SignalingObserver that will handle SigEventsuid
- - String representing the identity of the client.port
- - the port on which the server should listen. (If 0,
the server will listen on any free port)Method Detail |
private void initDeskSig(SignalingObserver so)
so
- - SignalingObserver that will handle SigEventspublic SignalConnection Dial(java.lang.String userid) throws cnrg.itx.datax.DataException, DesktopSignalingException, cnrg.itx.ds.DirectoryServiceException
userid
- the String representing the email address or phone number or userID to callSignalConnection
,
DataException
,
DesktopSignalingException
,
DirectoryServiceException
public SignalConnection Dial(java.lang.String userid, cnrg.itx.datax.Channel cInput, cnrg.itx.datax.Channel cOutput) throws cnrg.itx.datax.DataException, DesktopSignalingException, cnrg.itx.ds.DirectoryServiceException
userid
- the String representing the email address or phone number or userID to callcInput
- Input Channel to add to resultcOutput
- Output Channel to add to resultSignalConnection
,
DataException
,
DesktopSignalingException
,
DirectoryServiceException
public SignalConnection Dial(java.lang.String userid, cnrg.itx.ds.Location userLoc, SignalConnectionObserver sco) throws cnrg.itx.datax.DataException, DesktopSignalingException
userid
- the String representing the email address or phone number or userID to calluserLoc
- the Location object that needs to be dialed.sco
- the SignalConnectionObserver object that is used by the application to control the dial processSignalConnectionObserver
,
SignalConnection
,
DataException
,
DesktopSignalingException
public SignalConnection Dial(java.lang.String userid, cnrg.itx.ds.Location userLoc, cnrg.itx.datax.Channel cInput, cnrg.itx.datax.Channel cOutput, SignalConnectionObserver sco) throws cnrg.itx.datax.DataException, DesktopSignalingException
userid
- the String representing the email address or phone number or userID to calluserLoc
- the Location object that needs to be dialedcInput
- the input channel to use for data exchangecOutput
- the output channel to use for data exchangesco
- the SignalConnectionObserver object that is used by the application to control the dial processSignalConnectionObserver
,
SignalConnection
,
DataException
,
DesktopSignalingException
public SignalConnection Dial(cnrg.itx.ds.Location peerLoc) throws cnrg.itx.datax.DataException, DesktopSignalingException
peerLoc
- - the Location of our peerpublic SignalConnection Dial(cnrg.itx.ds.Location peerLoc, cnrg.itx.datax.Channel cInput, cnrg.itx.datax.Channel cOutput) throws cnrg.itx.datax.DataException, DesktopSignalingException
peerLoc
- - the Location of our peercInput
- - Input channel to be used for data communicationscOuput
- - output channel to be used for data communicationspublic SignalConnection Dial(java.lang.String userid, cnrg.itx.ds.Location peerLoc) throws cnrg.itx.datax.DataException, DesktopSignalingException
userid
- - name for server app, our peerpeerLoc
- - the Location of our peerpublic SignalConnection Dial(java.lang.String userid, cnrg.itx.ds.Location destAdd, cnrg.itx.datax.Channel cInput, cnrg.itx.datax.Channel cOutput) throws cnrg.itx.datax.DataException, DesktopSignalingException
userid
- - name for server app, our peerdestAdd
- - the Location of our peercInput
- - Input channel to be used for data communicationscOuput
- - output channel to be used for data communicationspublic SignalConnection Dial(cnrg.itx.ds.Location peerLoc, SignalConnectionObserver sco) throws cnrg.itx.datax.DataException, DesktopSignalingException
peerLoc
- - the Location of our peersco
- the SignalConnectionObserver object that is used by the
application to control the dial processpublic SignalConnection Dial(cnrg.itx.ds.Location peerLoc, cnrg.itx.datax.Channel cInput, cnrg.itx.datax.Channel cOutput, SignalConnectionObserver sco) throws cnrg.itx.datax.DataException, DesktopSignalingException
peerLoc
- - the Location of our peercInput
- - Input channel to be used for data communicationscOutput
- - Output channel to be used for data communicationssco
- the SignalConnectionObserver object that is used by the
application to control the dial processpublic void Hangup(SignalConnection sc) throws ConnectException
sc
- the SignalConnection to hanguppublic void sendDTMF(java.lang.String s, SignalConnection sc) throws ConnectException
s
- is the string representation of the DTMF tone.sc
- is the SignalConnection currently in use with the peer application.public boolean isAlive(SignalConnection sc) throws ConnectException
sc
- is the SignalConnection currently in use with the peer application.public cnrg.itx.ds.DirectoryService getDirectory()
None.
- public cnrg.itx.ds.LocationList getLocationList(java.lang.String userid) throws cnrg.itx.ds.DirectoryServiceException
userid
- is the String representation of a user.public void setTimeout(int t)
t
- is the timeout in milliseconds to be used for Sockets.public int getTimeout()
None
- public int getPort()
None
- public java.lang.String getName()
None
- public void logout()
None.
- protected void handleDialInvite(InviteSignalEvent ise, java.net.Socket so) throws DesktopSignalingException, cnrg.itx.datax.DataException
ise
- is the InviteSignalEvent that contains all the necessary information about the peerso
- is the socket that should be used for communication.InviteSignalEvent
protected void handleHangupInvite(HangupSignalEvent hse, java.net.Socket s)
hse
- is the HangupSignalEvent that contains all the necessary information about the peers
- is the socket that should be used for communication.HangupSignalEvent
protected void handleSendDTMFInvite(DTMFSignalEvent dtmfse, java.net.Socket s)
dtmfse
- is the DTMFSignalEvent that contains all the necessary information about the peers
- is the socket that should be used for communication.DTMFSignalEvent
protected void handleAliveInvite(AliveSignalEvent ase, java.net.Socket s)
ase
- is the AliveSignalEvent that contains all the necessary information about the peers
- is the socket that should be used for communication.AliveSignalEvent
protected void handlePeerNotAlive(SignalConnection sc)
sc
- is the SignalConnection that needs to be closed and removedcnrg.itx.signal.client.SignalConnection
protected void setServerPort(int p)
p
- is the port the Server thread is listening for requests.protected DesktopSignaling.Result tryDialSequence(cnrg.itx.ds.UserID destUID, cnrg.itx.ds.Location destAdd, cnrg.itx.datax.Connection ac) throws ConnectException
destUID
- - the UserID of the calleedestAdd
- - the IP address of the destinationac
- - the data connection that will be used to transmit dataprotected java.net.Socket sendNewPacket(SigPacket send, java.lang.String ip, int p) throws ConnectException
send
- is the SigPacket to send to the peer applicationip
- is the String representation of the IP address of the destinationp
- is the port of the destination applicationprotected void sendPacket(SigPacket send, java.net.Socket sock, java.lang.String topHeader, java.lang.String method) throws ConnectException
send
- is the SigPacket to send to the peer applicationsock
- is the existing socket to usetopHeader
- the header for a SIP response; null if packet is a SIP request or DesktopSignaling does not use SIPmethod
- the SIP method involved; null if DesktopSignaling does not use SIPprotected SigPacket waitForPacket(java.net.Socket sock) throws java.io.InterruptedIOException
sock
- is the existing socket to wait onprotected void Register() throws cnrg.itx.ds.DirectoryServiceException
None.
- protected int unRegister()
None.
- private java.lang.Long getSequence()
private SignalConnection getConnection(java.lang.Long seq)
seq
- the sequence number of the connectionprivate void putConnection(java.lang.Long seq, SignalConnection sc)
seq
- the sequence number of the connectionsc
- the SignalConnection to be placed into the hashtableprivate void removeConnection(java.lang.Long seq)
seq
- the sequence number of the connectionprivate cnrg.itx.datax.Channel getDefaultInputChannel() throws cnrg.itx.datax.DataException
None
- private cnrg.itx.datax.Channel getDefaultOutputChannel() throws cnrg.itx.datax.DataException
None
- private SignalConnection processResult(DesktopSignaling.Result ret, cnrg.itx.datax.AudioConnection ac, boolean outLast, boolean busyFlag, java.lang.String userid) throws DesktopSignalingException
ret
- - the Result of the tryDialSequenceac
- - the AudioConnection we intended to use. This
will be closed if the result is not an Accept and this
is the last location to be triedoutLast
- - true if this is the last Location to be triedbusyFlag
- - true if a previously dialled location was busy.
This parameter carries history from a previous call.userid
- - userid string for use in exception message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |