mkh.sip
Class SipUA

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.application.SUDPApplication
                  extended bymkh.sip.SipUA
All Implemented Interfaces:
java.lang.Cloneable, drcl.ObjectCloneable, drcl.ObjectDuplicable, java.io.Serializable

public class SipUA
extends drcl.inet.application.SUDPApplication

This class is a Session Initiation Protocol User Agent.

Version:
1.0, 14/07/2004
Author:
Masood Khosroshahy ( www.m-kh.info )
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
drcl.comp.Component.Locks
 
Field Summary
 boolean alwaysUseProxyServer
          It is set during initialization through the TCL interface.
 int configuredProxyServerAddress
          All requests of the node first goes to this address which is set during initialization through the TCL interface.
 java.lang.String contentType
          A variable used for setting the content type of the SIP message, typically set to "application/sdp".
 int destination
          Used for storing the other party's address.
 drcl.comp.Port faxPort
          Used for alerting the T.38 fax module to start sending the fax.
 java.lang.String messageType
          An intermediate variable which is used for checking whether a message is a request or it is a response and directing it to the related processor.
 int nodeAddress
          Node address is set during initialization through the TCL interface.
 java.lang.String nodeViaField
          It is set during initialization through the TCL interface.
 SIPMessage receivedMessage
          An intermediate variable which is used for processing.
 int responseMessageClass
          A vaiable to store the response class from one of six possible classes.
 SIPMessage toBeSentMessage
          This is a message which is created by different methods of the class.
 java.lang.String transactionID
          Used for storing the transaction ID so that junk messages can be discarded.
 boolean transactionInitiator
          Used for determining if the node should respond like acknowledging an OK with ACK only if the node is indeed the initiator of the request-response.
 
Fields inherited from class drcl.net.Module
downPort, PortGroup_DOWN, PortGroup_UP, timerPort, upPort
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
SipUA()
          Constructor.
 
Method Summary
 SIPMessage constructMessage(java.lang.String startLine, java.lang.String via, java.lang.String to, java.lang.String from, java.lang.String callID, java.lang.String contentType)
           
protected  void dataArriveAtDownPort(java.lang.Object data, drcl.comp.Port downPort)
          Arrived data first gets processed by this method.
 void duplicate(java.lang.Object source)
           
 java.lang.String info()
           
 void printMessageContent(SIPMessage message)
           
 void processACK(SIPMessage receivedMessage)
           
 void processBYE(SIPMessage receivedMessage)
           
 void processINVITE(SIPMessage receivedMessage)
           
 void processResponse(SIPMessage receivedMessage)
          This method first checks to see whether the message is a valid one then checks to see if it's a response or an unsupported request, after that if the message is a response it goes on to handle each type of response classes.
 void reset()
           
 void sendACK(SIPMessage receivedMessage)
           
 void sendBYE()
           
 void sendINVITE(SIPMessage toBeSentMessage)
           
 void sendOK(SIPMessage receivedMessage)
           
 void setAddress(int address)
           
 void setAlwaysUseProxyServer(boolean x)
           
 void setConfiguredProxyServerAddress(int address)
           
 void setNodeViaField(java.lang.String s)
           
 
Methods inherited from class drcl.inet.application.SUDPApplication
getContent, getPeerAddress, getPeerPort, open, open, recvmsg, recvmsg, recvmsg, sendmsg, sendmsg, sendmsg, sendmsg, sendmsg, sendreceive, sendreceive, sendreceive, sendreceive, sendreceive, timeout
 
Methods inherited from class drcl.net.Module
cancelTimeout, dataArriveAtUpPort, deliver, process, processOther, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
_resume, _start, _stop, addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, componentAdded, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, finishing, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getForkManager, getID, getName, getParent, getPort, getPort, getRoot, getRuntime, getTime, iduplicate, isAncestorOf, isComponentNotificationEnabled, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortNotificationEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, portAdded, portRemoved, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setComponentNotificationEnabled, setContract, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setPortNotificationEnabled, setPortRemovable, setRuntime, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait, yield
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

receivedMessage

public SIPMessage receivedMessage
An intermediate variable which is used for processing.


toBeSentMessage

public SIPMessage toBeSentMessage
This is a message which is created by different methods of the class.


contentType

public java.lang.String contentType
A variable used for setting the content type of the SIP message, typically set to "application/sdp".


responseMessageClass

public int responseMessageClass
A vaiable to store the response class from one of six possible classes.


messageType

public java.lang.String messageType
An intermediate variable which is used for checking whether a message is a request or it is a response and directing it to the related processor.


destination

public int destination
Used for storing the other party's address.


transactionID

public java.lang.String transactionID
Used for storing the transaction ID so that junk messages can be discarded.


nodeAddress

public int nodeAddress
Node address is set during initialization through the TCL interface.


transactionInitiator

public boolean transactionInitiator
Used for determining if the node should respond like acknowledging an OK with ACK only if the node is indeed the initiator of the request-response.


configuredProxyServerAddress

public int configuredProxyServerAddress
All requests of the node first goes to this address which is set during initialization through the TCL interface.


faxPort

public drcl.comp.Port faxPort
Used for alerting the T.38 fax module to start sending the fax.


nodeViaField

public java.lang.String nodeViaField
It is set during initialization through the TCL interface.


alwaysUseProxyServer

public boolean alwaysUseProxyServer
It is set during initialization through the TCL interface.

Constructor Detail

SipUA

public SipUA()
Constructor.

Method Detail

dataArriveAtDownPort

protected void dataArriveAtDownPort(java.lang.Object data,
                                    drcl.comp.Port downPort)
Arrived data first gets processed by this method.


processResponse

public void processResponse(SIPMessage receivedMessage)
This method first checks to see whether the message is a valid one then checks to see if it's a response or an unsupported request, after that if the message is a response it goes on to handle each type of response classes.


sendOK

public void sendOK(SIPMessage receivedMessage)

processINVITE

public void processINVITE(SIPMessage receivedMessage)

sendINVITE

public void sendINVITE(SIPMessage toBeSentMessage)

processACK

public void processACK(SIPMessage receivedMessage)

sendACK

public void sendACK(SIPMessage receivedMessage)

processBYE

public void processBYE(SIPMessage receivedMessage)

sendBYE

public void sendBYE()

constructMessage

public SIPMessage constructMessage(java.lang.String startLine,
                                   java.lang.String via,
                                   java.lang.String to,
                                   java.lang.String from,
                                   java.lang.String callID,
                                   java.lang.String contentType)

printMessageContent

public void printMessageContent(SIPMessage message)

setAddress

public void setAddress(int address)

setConfiguredProxyServerAddress

public void setConfiguredProxyServerAddress(int address)

setNodeViaField

public void setNodeViaField(java.lang.String s)

setAlwaysUseProxyServer

public void setAlwaysUseProxyServer(boolean x)

reset

public void reset()

duplicate

public void duplicate(java.lang.Object source)

info

public java.lang.String info()