mkh.sip
Class SipPS

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

public class SipPS
extends drcl.inet.application.SUDPApplication

This class is an SIP Proxy Server.

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
 java.lang.String contentType
          A variable used for setting the content type of the SIP message, typically set to "application/sdp".
 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.
 int otherNetworkProxyServerAddress
          It is set during initialization through the TCL interface.
 SIPMessage receivedMessage
          An intermediate variable which is used for processing.
 int registeredNode
          All requests of the set node first goes to this proxy server and it is set during initialization through the TCL interface.
 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.
 
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
SipPS()
          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, int nextHop)
           
 void sendBYE(SIPMessage toBeSentMessage, int nextHop)
           
 void sendINVITE(SIPMessage toBeSentMessage, int nextHop)
           
 void sendOK(SIPMessage receivedMessage, int address)
           
 void setAddress(int address)
           
 void setNodeViaField(java.lang.String s)
           
 void setOtherNetworkProxyServerAddress(int address)
           
 void setRegisteredNode(int address)
           
 
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.


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.


registeredNode

public int registeredNode
All requests of the set node first goes to this proxy server and it is set during initialization through the TCL interface.


nodeViaField

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


otherNetworkProxyServerAddress

public int otherNetworkProxyServerAddress
It is set during initialization through the TCL interface.

Constructor Detail

SipPS

public SipPS()
Constructor.

Method Detail

dataArriveAtDownPort

protected void dataArriveAtDownPort(java.lang.Object data,
                                    drcl.comp.Port downPort)
Arrived data first gets processed by this method. The proxy server in this version only can accept/direct SIP packets. Fax data itself should be directed using other routers.


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,
                   int address)

processINVITE

public void processINVITE(SIPMessage receivedMessage)

sendINVITE

public void sendINVITE(SIPMessage toBeSentMessage,
                       int nextHop)

processACK

public void processACK(SIPMessage receivedMessage)

sendACK

public void sendACK(SIPMessage receivedMessage,
                    int nextHop)

processBYE

public void processBYE(SIPMessage receivedMessage)

sendBYE

public void sendBYE(SIPMessage toBeSentMessage,
                    int nextHop)

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)

setOtherNetworkProxyServerAddress

public void setOtherNetworkProxyServerAddress(int address)

setRegisteredNode

public void setRegisteredNode(int address)

setNodeViaField

public void setNodeViaField(java.lang.String s)

reset

public void reset()

duplicate

public void duplicate(java.lang.Object source)

info

public java.lang.String info()