MjSip Stack
v1.6

org.zoolu.sip.dialog
Class Dialog

java.lang.Object
  |
  +--org.zoolu.sip.dialog.DialogInfo
        |
        +--org.zoolu.sip.dialog.Dialog
All Implemented Interfaces:
SipProviderListener
Direct Known Subclasses:
InviteDialog, NotifierDialog, SubscriberDialog

public abstract class Dialog
extends DialogInfo
implements SipProviderListener

Class Dialog maintains a complete information status of a generic SIP dialog. It has the following attributes:


Field Summary
protected  DialogIdentifier dialog_id
          Dialog identifier
protected  int dialog_sqn
          Dialog sequence number
protected  Log log
          Event logger.
protected  SipProvider sip_provider
          SipProvider
protected  int status
          Internal dialog state.
static int UAC
          Identifier for the transaction client side of a dialog (UAC).
static int UAS
          Identifier for the transaction server side of a dialog (UAS).
 
Constructor Summary
protected Dialog(SipProvider provider)
          Creates a new empty Dialog
 
Method Summary
protected  void changeStatus(int newstatus)
          Changes the internal dialog state
 DialogIdentifier getDialogID()
          Gets the inique Dialog-ID
 SipProvider getSipProvider()
          Gets the SipProvider of this Dialog.
protected abstract  java.lang.String getStatus()
          Gets the dialog state
abstract  boolean isConfirmed()
          Whether the dialog is in "confirmed" state.
abstract  boolean isEarly()
          Whether the dialog is in "early" state.
abstract  boolean isTerminated()
          Whether the dialog is in "terminated" state.
abstract  void onReceivedMessage(SipProvider provider, Message message)
          When a new Message is received by the SipProvider.
protected  void printException(java.lang.Exception e, int level)
          Adds the Exception message to the default Log
protected  void printLog(java.lang.String str, int level)
          Adds a new string to the default Log
protected  void printWarning(java.lang.String str, int level)
          Adds a Warning message to the default Log
protected  boolean statusIs(int st)
          Whether the dialog state is equal to st
 void update(int side, Message msg)
          Updates empty attributes (tags, route set) and mutable attributes (cseqs, contacts), based on a new message.
protected  boolean verifyStatus(boolean expression)
          Verifies the correct status; if not logs the event.
protected  boolean verifyThat(boolean expression, java.lang.String str)
          Verifies an event; if not logs it.
 
Methods inherited from class org.zoolu.sip.dialog.DialogInfo
getCallID, getLocalContact, getLocalCSeq, getLocalName, getLocalTag, getRemoteContact, getRemoteCSeq, getRemoteName, getRemoteTag, getRoute, incLocalCSeq, incRemoteCSeq, setCallID, setLocalContact, setLocalCSeq, setLocalName, setLocalTag, setRemoteContact, setRemoteCSeq, setRemoteName, setRemoteTag, setRoute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UAC

public static final int UAC
Identifier for the transaction client side of a dialog (UAC).

UAS

public static final int UAS
Identifier for the transaction server side of a dialog (UAS).

dialog_sqn

protected int dialog_sqn
Dialog sequence number

log

protected Log log
Event logger.

sip_provider

protected SipProvider sip_provider
SipProvider

status

protected int status
Internal dialog state.

dialog_id

protected DialogIdentifier dialog_id
Dialog identifier
Constructor Detail

Dialog

protected Dialog(SipProvider provider)
Creates a new empty Dialog
Method Detail

getStatus

protected abstract java.lang.String getStatus()
Gets the dialog state

isEarly

public abstract boolean isEarly()
Whether the dialog is in "early" state.

isConfirmed

public abstract boolean isConfirmed()
Whether the dialog is in "confirmed" state.

isTerminated

public abstract boolean isTerminated()
Whether the dialog is in "terminated" state.

onReceivedMessage

public abstract void onReceivedMessage(SipProvider provider,
                                       Message message)
When a new Message is received by the SipProvider.
Specified by:
onReceivedMessage in interface SipProviderListener

changeStatus

protected void changeStatus(int newstatus)
Changes the internal dialog state

statusIs

protected boolean statusIs(int st)
Whether the dialog state is equal to st

getSipProvider

public SipProvider getSipProvider()
Gets the SipProvider of this Dialog.

getDialogID

public DialogIdentifier getDialogID()
Gets the inique Dialog-ID

update

public void update(int side,
                   Message msg)
Updates empty attributes (tags, route set) and mutable attributes (cseqs, contacts), based on a new message.
Parameters:
side - indicates whether the Dialog is acting as transaction client or server for the current message (use constant values Dialog.UAC or Dialog.UAS)
msg - the message that is used to update the Dialog state

printLog

protected void printLog(java.lang.String str,
                        int level)
Adds a new string to the default Log

printWarning

protected final void printWarning(java.lang.String str,
                                  int level)
Adds a Warning message to the default Log

printException

protected final void printException(java.lang.Exception e,
                                    int level)
Adds the Exception message to the default Log

verifyStatus

protected final boolean verifyStatus(boolean expression)
Verifies the correct status; if not logs the event.

verifyThat

protected final boolean verifyThat(boolean expression,
                                   java.lang.String str)
Verifies an event; if not logs it.

MjSip Stack
v1.6