|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--cnrg.itx.gtwy.pbx.Dialer
This class handles placing one call in the PBX, from a line in the Gateway to some telephone number specified by a caller
Field Summary | |
private javax.telephony.Call |
call
|
private java.lang.String |
called
|
private java.lang.String |
calling
|
private boolean |
callInP
|
private javax.telephony.CallObserver |
co
|
private javax.telephony.Connection |
destConnection
|
private boolean |
dialingInP
|
private boolean |
LOG
|
private static java.lang.String |
ME
|
private javax.telephony.Connection |
myConnection
|
private java.net.InetAddress |
myIAdd
|
private cnrg.itx.signal.InvitePacket |
myPacket
|
private PBXSignaling |
myPBX
|
private javax.telephony.Provider |
provider
|
private java.net.Socket |
sendSock
|
private javax.telephony.Terminal |
terminal
|
static int |
TIMEOUT
|
private static boolean |
WAIT
|
Fields inherited from class java.lang.Thread |
contextClassLoader,
daemon,
eetop,
group,
inheritedAccessControlContext,
MAX_PRIORITY,
MIN_PRIORITY,
name,
NORM_PRIORITY,
priority,
single_step,
stillborn,
stopThreadPermission,
target,
threadInitNumber,
threadQ,
values |
Constructor Summary | |
Dialer(PBXSignaling p,
boolean logging,
cnrg.itx.signal.InvitePacket sp,
java.lang.String from,
java.lang.String to,
java.net.Socket gs)
Base constructor for Dialer class |
|
Dialer(PBXSignaling p,
cnrg.itx.signal.InvitePacket sp,
java.lang.String from,
java.lang.String to,
java.net.Socket gs)
Constructor with default logging (which is none) |
Method Summary | |
private void |
acceptAndWait()
This method is called to send an accept packet to the gateway and then wait for the call to finish (be hung up). |
boolean |
callInProgress()
This method returns true if the PBX has successfully placed a call and this call is still in progress. |
private boolean |
callPickedUp()
This method is called after a connection has been made and ringing has started. |
boolean |
dialingInProgress()
This method returns true is the PBX is in the act of dialing a destination telephone. |
private void |
finishCall()
This method is called when the phone has started rining. |
private void |
hangup()
hangup() This method calls the disconnect() method of the Connection object to end the call. |
private void |
makeCall(java.lang.String from,
java.lang.String to)
|
private javax.telephony.Connection[] |
makeOneCall(javax.telephony.Terminal t,
javax.telephony.Address a,
java.lang.String s,
javax.telephony.Call c)
This method makes one attempt at building a connection. |
void |
run()
This method runs the thread - this thread continues to run until the call is hungup, or the PBX Server is shut down, or placing the call failed (then we exit right away). |
private void |
sendAcceptPacket(cnrg.itx.signal.InvitePacket ip)
This method sends an ACCEPT Result packet to the Gateway when the Dial is successfully initiated (i.e. |
private void |
sendBusyPacket(cnrg.itx.signal.InvitePacket sp)
This method is called when a busy tone was encountered |
private void |
sendConfirmPacket(cnrg.itx.signal.InvitePacket ip)
This method creates a CONFIRM packet and sends it back to the appropriate gateway to acknowledge that the hangup is complete March 15, 1999 - this routine might not be needed |
private boolean |
sendPacket(cnrg.itx.signal.InvitePacket sp)
This method sends the packet back to the Gateway from which the Invite packet had been received. |
private void |
sendRejectPacket(cnrg.itx.signal.InvitePacket ip)
This method sends a REJECT Result packet when the Dial failed |
private javax.telephony.Connection[] |
tryMoreTimes(int n,
javax.telephony.Terminal t,
javax.telephony.Address a,
java.lang.String s,
javax.telephony.Call c)
This method makes 5 more attempts to place the call before throwing a DialingException |
private void |
waitForPickup()
This method is called to wait for a ringing phone to be picked up before sending an accept packet back to the gateway. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
private static final java.lang.String ME
private boolean LOG
private static final boolean WAIT
public static final int TIMEOUT
private javax.telephony.Connection myConnection
private javax.telephony.Connection destConnection
private javax.telephony.Terminal terminal
private javax.telephony.Provider provider
private javax.telephony.Call call
private javax.telephony.CallObserver co
private java.lang.String calling
private java.lang.String called
private boolean callInP
private boolean dialingInP
private PBXSignaling myPBX
private cnrg.itx.signal.InvitePacket myPacket
private java.net.InetAddress myIAdd
private java.net.Socket sendSock
Constructor Detail |
public Dialer(PBXSignaling p, boolean logging, cnrg.itx.signal.InvitePacket sp, java.lang.String from, java.lang.String to, java.net.Socket gs) throws DialingException
p
- is the PBXSignaling object that is creating this Dialerlogging
- is TRUE if PBX Server is logging to the terminalsp
- is the InvitePacket that contains a dial requestfrom
- is the telephone number from which call will be placeto
- is the telephone number to be calledgs
- is the Socket over which our Gateway is talking to uspublic Dialer(PBXSignaling p, cnrg.itx.signal.InvitePacket sp, java.lang.String from, java.lang.String to, java.net.Socket gs) throws DialingException
p
- is the PBXSignaling object that is creating this Dialersp
- is the InvitePacket that contains a dial requestfrom
- is the telephone number from which call will be placeto
- is the telephone number to be calledgs
- is the Socket over which our Gateway is talking to usMethod Detail |
private void makeCall(java.lang.String from, java.lang.String to) throws DialingException
private javax.telephony.Connection[] tryMoreTimes(int n, javax.telephony.Terminal t, javax.telephony.Address a, java.lang.String s, javax.telephony.Call c) throws DialingException
n
- is the number of tries to maket
- is the Terminal that is making the calla
- is the Address corresponding to t
s
- is the String form of the destination telephone numberc
- is the Call whose connect method we will callprivate javax.telephony.Connection[] makeOneCall(javax.telephony.Terminal t, javax.telephony.Address a, java.lang.String s, javax.telephony.Call c) throws DialingException, javax.telephony.InvalidStateException
t
- is the Terminal that is making the calla
- is the Address corresponding to t
s
- is the String form of the destination telephone numberc
- is the Call whose connect method we will callprivate void hangup()
public void run()
public boolean callInProgress()
public boolean dialingInProgress()
private void sendConfirmPacket(cnrg.itx.signal.InvitePacket ip) throws PBXSignalingException
private void sendBusyPacket(cnrg.itx.signal.InvitePacket sp)
sp
- is the InvitePacket that originally caused us to ring this phoneprivate void sendAcceptPacket(cnrg.itx.signal.InvitePacket ip)
ip
- The InvitePacket that we were using to dial withprivate void sendRejectPacket(cnrg.itx.signal.InvitePacket ip)
ip
- The InvitePacket that we were using to dial withprivate boolean sendPacket(cnrg.itx.signal.InvitePacket sp)
sp
- The packet to be sentprivate boolean callPickedUp()
private void finishCall()
private void waitForPickup()
private void acceptAndWait()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |