MjSip Stack
v1.6

org.zoolu.sip.dialog
Class NotifierDialog

java.lang.Object
  |
  +--org.zoolu.sip.dialog.DialogInfo
        |
        +--org.zoolu.sip.dialog.Dialog
              |
              +--org.zoolu.sip.dialog.NotifierDialog
All Implemented Interfaces:
SipProviderListener, TransactionClientListener

public class NotifierDialog
extends Dialog
implements TransactionClientListener

NotifierDialog.


Field Summary
protected static java.lang.String ACTIVE
          String "active"
protected static int D_ACTIVE
          Internal state D_ACTIVE (subscription has been activated)
protected static int D_INIT
          Internal state D_INIT (the starting point)
protected static int D_PENDING
          Internal state D_PENDING (first subscription request has been accepted)
protected static int D_SUBSCRIBED
          Internal state D_SUBSCRIBED (first subscription request arrived)
protected static int D_TERMINATED
          Internal state D_TERMINATED (first subscription request has been refused or subscription has been terminated)
protected static int D_WAITING
          Internal state D_WAITING (listening for the first subscription request)
protected static java.lang.String PENDING
          String "pending"
protected static java.lang.String TERMINATED
          String "terminated"
 
Fields inherited from class org.zoolu.sip.dialog.Dialog
dialog_id, dialog_sqn, log, sip_provider, status, UAC, UAS
 
Constructor Summary
NotifierDialog(SipProvider sip_provider, Message subscribe, NotifierDialogListener listener)
          Creates a new NotifierDialog for the already received SUBSCRIBE request subscribe.
NotifierDialog(SipProvider sip_provider, NotifierDialogListener listener)
          Creates a new NotifierDialog.
 
Method Summary
 void accept(int expires, java.lang.String contact)
          Accepts the subscription request (sends a "202 Accepted" response).
 void activate()
          Activates the subscription (subscription goes into 'active' state).
 void activate(int expires)
          Activates the subscription (subscription goes into 'active' state).
 java.lang.String getEvent()
          Gets event type.
 java.lang.String getId()
          Gets the event "id" parameter.
protected  java.lang.String getStatus()
          Gets the dialog state
 boolean isConfirmed()
          Whether the dialog is in "confirmed" state.
 boolean isEarly()
          Whether the dialog is in "early" state.
 boolean isSubscriptionActive()
          Whether the subscription is "active".
 boolean isSubscriptionPending()
          Whether the subscription is "pending".
 boolean isSubscriptionTerminated()
          Whether the subscription is "terminated".
 boolean isTerminated()
          Whether the dialog is in "active" state.
 void listen()
          Listen for the first subscription request.
 void notify(Message req)
          Sends a NOTIFY.
 void notify(java.lang.String state, int expires, java.lang.String content_type, java.lang.String body)
          Sends a NOTIFY.
 void onReceivedMessage(SipProvider provider, Message msg)
          When a new Message is received by the SipProvider.
 void onTransFailureResponse(TransactionClient tc, Message resp)
          When the TransactionClient goes into the "Completed" state receiving a 300-699 response
 void onTransProvisionalResponse(TransactionClient tc, Message resp)
          When the TransactionClient is (or goes) in "Proceeding" state and receives a new 1xx provisional response
 void onTransSuccessResponse(TransactionClient tc, Message resp)
          When the TransactionClient goes into the "Completed" state receiving a 2xx response
 void onTransTimeout(TransactionClient tc)
          When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
 void pending()
          Makes the subscription pending (subscription goes into 'pending' state).
 void pending(int expires)
          Makes the subscription pending (subscription goes into 'pending' state).
protected  void printLog(java.lang.String str, int level)
          Adds a new string to the default Log
 void refuse()
          Refuses the subscription request.
 void respond(int code, java.lang.String reason, int expires, java.lang.String contact, java.lang.String content_type, java.lang.String body)
          Responds with code and reason.
 void respond(Message resp)
          Responds with resp.
 void terminate()
          Terminates the subscription (subscription goes into 'terminated' state).
 void terminate(java.lang.String reason)
          Terminates the subscription (subscription goes into 'terminated' state).
 
Methods inherited from class org.zoolu.sip.dialog.Dialog
changeStatus, getDialogID, getSipProvider, printException, printWarning, statusIs, update, verifyStatus, verifyThat
 
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

ACTIVE

protected static final java.lang.String ACTIVE
String "active"

PENDING

protected static final java.lang.String PENDING
String "pending"

TERMINATED

protected static final java.lang.String TERMINATED
String "terminated"

D_INIT

protected static final int D_INIT
Internal state D_INIT (the starting point)

D_WAITING

protected static final int D_WAITING
Internal state D_WAITING (listening for the first subscription request)

D_SUBSCRIBED

protected static final int D_SUBSCRIBED
Internal state D_SUBSCRIBED (first subscription request arrived)

D_PENDING

protected static final int D_PENDING
Internal state D_PENDING (first subscription request has been accepted)

D_ACTIVE

protected static final int D_ACTIVE
Internal state D_ACTIVE (subscription has been activated)

D_TERMINATED

protected static final int D_TERMINATED
Internal state D_TERMINATED (first subscription request has been refused or subscription has been terminated)
Constructor Detail

NotifierDialog

public NotifierDialog(SipProvider sip_provider,
                      NotifierDialogListener listener)
Creates a new NotifierDialog.

NotifierDialog

public NotifierDialog(SipProvider sip_provider,
                      Message subscribe,
                      NotifierDialogListener listener)
Creates a new NotifierDialog for the already received SUBSCRIBE request subscribe.
Method Detail

getStatus

protected java.lang.String getStatus()
Gets the dialog state
Overrides:
getStatus in class Dialog

isEarly

public boolean isEarly()
Whether the dialog is in "early" state.
Overrides:
isEarly in class Dialog

isConfirmed

public boolean isConfirmed()
Whether the dialog is in "confirmed" state.
Overrides:
isConfirmed in class Dialog

isTerminated

public boolean isTerminated()
Whether the dialog is in "active" state.
Overrides:
isTerminated in class Dialog

isSubscriptionPending

public boolean isSubscriptionPending()
Whether the subscription is "pending".

isSubscriptionActive

public boolean isSubscriptionActive()
Whether the subscription is "active".

isSubscriptionTerminated

public boolean isSubscriptionTerminated()
Whether the subscription is "terminated".

getEvent

public java.lang.String getEvent()
Gets event type.

getId

public java.lang.String getId()
Gets the event "id" parameter.

listen

public void listen()
Listen for the first subscription request.

accept

public void accept(int expires,
                   java.lang.String contact)
Accepts the subscription request (sends a "202 Accepted" response).

refuse

public void refuse()
Refuses the subscription request.

respond

public void respond(int code,
                    java.lang.String reason,
                    int expires,
                    java.lang.String contact,
                    java.lang.String content_type,
                    java.lang.String body)
Responds with code and reason. This method can be called when the InviteDialog is in D_INVITED, D_ReINVITED states

respond

public void respond(Message resp)
Responds with resp.

activate

public void activate()
Activates the subscription (subscription goes into 'active' state).

activate

public void activate(int expires)
Activates the subscription (subscription goes into 'active' state).

pending

public void pending()
Makes the subscription pending (subscription goes into 'pending' state).

pending

public void pending(int expires)
Makes the subscription pending (subscription goes into 'pending' state).

terminate

public void terminate()
Terminates the subscription (subscription goes into 'terminated' state).

terminate

public void terminate(java.lang.String reason)
Terminates the subscription (subscription goes into 'terminated' state).

notify

public void notify(java.lang.String state,
                   int expires,
                   java.lang.String content_type,
                   java.lang.String body)
Sends a NOTIFY.

notify

public void notify(Message req)
Sends a NOTIFY.

onTransProvisionalResponse

public void onTransProvisionalResponse(TransactionClient tc,
                                       Message resp)
When the TransactionClient is (or goes) in "Proceeding" state and receives a new 1xx provisional response
Specified by:
onTransProvisionalResponse in interface TransactionClientListener

onTransSuccessResponse

public void onTransSuccessResponse(TransactionClient tc,
                                   Message resp)
When the TransactionClient goes into the "Completed" state receiving a 2xx response
Specified by:
onTransSuccessResponse in interface TransactionClientListener

onTransFailureResponse

public void onTransFailureResponse(TransactionClient tc,
                                   Message resp)
When the TransactionClient goes into the "Completed" state receiving a 300-699 response
Specified by:
onTransFailureResponse in interface TransactionClientListener

onTransTimeout

public void onTransTimeout(TransactionClient tc)
When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
Specified by:
onTransTimeout in interface TransactionClientListener

onReceivedMessage

public void onReceivedMessage(SipProvider provider,
                              Message msg)
When a new Message is received by the SipProvider.
Overrides:
onReceivedMessage in class Dialog

printLog

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

MjSip Stack
v1.6