|
MjSip Stack v1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.zoolu.sip.dialog.DialogInfo
|
+--org.zoolu.sip.dialog.Dialog
|
+--org.zoolu.sip.dialog.InviteDialog
Class InviteDialog can be used to manage invite dialogs. An InviteDialog can be both client or server. (i.e. generating an INVITE request or responding to an incoming INVITE request).
An InviteDialog can be in state inviting/waiting/invited, accepted/refused, call, byed/byeing, and close.
InviteDialog supports the offer/answer model for the sip body, with the following rules:
- both INVITE-offer/2xx-answer and 2xx-offer/ACK-answer modes for incoming calls
- INVITE-offer/2xx-answer mode for outgoing calls.
| Field Summary | |
protected static int |
D_ACCEPTED
|
protected static int |
D_BYED
|
protected static int |
D_BYEING
|
protected static int |
D_CALL
|
protected static int |
D_CLOSE
|
protected static int |
D_INIT
|
protected static int |
D_INVITED
|
protected static int |
D_INVITING
|
protected static int |
D_ReACCEPTED
|
protected static int |
D_REFUSED
|
protected static int |
D_ReINVITED
|
protected static int |
D_ReINVITING
|
protected static int |
D_ReREFUSED
|
protected static int |
D_ReWAITING
|
protected static int |
D_WAITING
|
| Fields inherited from class org.zoolu.sip.dialog.Dialog |
dialog_id, dialog_sqn, log, sip_provider, status, UAC, UAS |
| Constructor Summary | |
InviteDialog(SipProvider sip_provider,
InviteDialogListener listener)
Creates a new InviteDialog. |
|
InviteDialog(SipProvider sip_provider,
Message invite,
InviteDialogListener listener)
Creates a new InviteDialog for the already received INVITE request invite. |
|
| Method Summary | |
void |
accept(java.lang.String contact,
java.lang.String sdp)
Accepts the incoming call. |
void |
ackWithAnswer(Message ack)
Sends the ack when offer/answer is in 2xx/ack |
void |
ackWithAnswer(java.lang.String contact,
java.lang.String session_descriptor)
Sends the ack when offer/answer is in 2xx/ack |
void |
bye()
Termiante the call. |
void |
bye(Message bye)
Termiante the call. |
void |
cancel()
Cancel the ongoing call request or a call listening. |
void |
cancel(Message cancel)
Cancel the ongoing call request or a call listening. |
Message |
getInviteMessage()
Gets the invite message |
protected java.lang.String |
getStatus()
Gets the dialog state |
void |
invite(Message invite)
Starts a new InviteTransactionClient and initializes the dialog state information |
void |
invite(java.lang.String callee,
java.lang.String caller,
java.lang.String contact,
java.lang.String session_descriptor)
Starts a new InviteTransactionClient and initializes the dialog state information. |
void |
inviteWithoutOffer(Message invite)
Starts a new InviteTransactionClient with offer/answer in 2xx/ack and initializes the dialog state information |
void |
inviteWithoutOffer(java.lang.String callee,
java.lang.String caller,
java.lang.String contact)
Starts a new InviteTransactionClient with offer/answer in 2xx/ack and initializes the dialog state information |
boolean |
isConfirmed()
Whether the dialog is in "confirmed" state. |
boolean |
isEarly()
Whether the dialog is in "early" state. |
boolean |
isSessionActive()
Whether the session is "active". |
boolean |
isTerminated()
Whether the dialog is in "terminated" state. |
void |
listen()
Starts a new InviteTransactionServer. |
void |
onReceivedMessage(SipProvider sip_provider,
Message msg)
Inherited from class SipProviderListener. |
void |
onTransAckTimeout(AckTransactionServer ts)
When the AckTransactionServer goes into the "Terminated" state, caused by transaction timeout |
void |
onTransFailureAck(InviteTransactionServer ts,
Message msg)
Inherited from InviteTransactionServerListener. |
void |
onTransFailureResponse(TransactionClient tc,
Message msg)
Inherited from TransactionClientListener. |
void |
onTransProvisionalResponse(TransactionClient tc,
Message msg)
Inherited from TransactionClientListener. |
void |
onTransRequest(TransactionServer ts,
Message req)
Inherited from TransactionServerListener. |
void |
onTransSuccessResponse(TransactionClient tc,
Message msg)
Inherited from TransactionClientListener. |
void |
onTransTimeout(TransactionClient tc)
Inherited from TransactionClientListener. |
protected void |
printLog(java.lang.String str,
int level)
Adds a new string to the default Log |
void |
redirect(int code,
java.lang.String reason,
java.lang.String contact)
Redirects the incoming call , specifing the code and reason. |
void |
refuse()
Refuses the incoming call. |
void |
refuse(int code,
java.lang.String reason)
Refuses the incoming call. |
void |
reInvite(Message invite)
Re-invites the remote user. |
void |
reInvite(java.lang.String contact,
java.lang.String session_descriptor)
Re-invites the remote user. |
void |
reInviteWithoutOffer(Message invite)
Re-invites the remote user with offer/answer in 2xx/ack Starts a new InviteTransactionClient and changes the dialog state information |
void |
reInviteWithoutOffer(java.lang.String contact,
java.lang.String session_descriptor)
Re-invites the remote user with offer/answer in 2xx/ack Starts a new InviteTransactionClient and changes the dialog state information |
void |
respond(int code,
java.lang.String reason,
java.lang.String contact,
java.lang.String sdp)
Responds with code and reason. |
void |
respond(Message resp)
Responds with resp. |
void |
ring()
Signals that the phone is ringing. |
| 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 |
protected static final int D_INIT
protected static final int D_WAITING
protected static final int D_INVITING
protected static final int D_INVITED
protected static final int D_REFUSED
protected static final int D_ACCEPTED
protected static final int D_CALL
protected static final int D_ReWAITING
protected static final int D_ReINVITING
protected static final int D_ReINVITED
protected static final int D_ReREFUSED
protected static final int D_ReACCEPTED
protected static final int D_BYEING
protected static final int D_BYED
protected static final int D_CLOSE
| Constructor Detail |
public InviteDialog(SipProvider sip_provider,
InviteDialogListener listener)
public InviteDialog(SipProvider sip_provider,
Message invite,
InviteDialogListener listener)
| Method Detail |
protected java.lang.String getStatus()
getStatus in class Dialogpublic boolean isEarly()
isEarly in class Dialogpublic boolean isConfirmed()
isConfirmed in class Dialogpublic boolean isTerminated()
isTerminated in class Dialogpublic boolean isSessionActive()
public Message getInviteMessage()
public void listen()
public void invite(java.lang.String callee,
java.lang.String caller,
java.lang.String contact,
java.lang.String session_descriptor)
callee - the callee url (and display name)caller - the caller url (and display name)contact - the contact url OR the contact usernamesession_descriptor - SDP bodypublic void invite(Message invite)
invite - the INVITE message
public void inviteWithoutOffer(java.lang.String callee,
java.lang.String caller,
java.lang.String contact)
public void inviteWithoutOffer(Message invite)
public void reInvite(java.lang.String contact,
java.lang.String session_descriptor)
Starts a new InviteTransactionClient and changes the dialog state information
Parameters:
- contact : the contact url OR the contact username; if null, the previous contact is used
- session_descriptor : the message body
public void reInvite(Message invite)
Starts a new InviteTransactionClient and changes the dialog state information
public void reInviteWithoutOffer(Message invite)
Starts a new InviteTransactionClient and changes the dialog state information
public void reInviteWithoutOffer(java.lang.String contact,
java.lang.String session_descriptor)
Starts a new InviteTransactionClient and changes the dialog state information
public void ackWithAnswer(java.lang.String contact,
java.lang.String session_descriptor)
public void ackWithAnswer(Message ack)
public void respond(Message resp)
If the CSeq method is INVITE and the response is 2xx, it moves to state D_ACCEPTED, adds a new listener to the SipProviderListener, and creates new AckTransactionServer
If the CSeq method is INVITE and the response is not 2xx, it moves to state D_REFUSED, and sends the response.
public void respond(int code,
java.lang.String reason,
java.lang.String contact,
java.lang.String sdp)
public void ring()
public void accept(java.lang.String contact,
java.lang.String sdp)
public void refuse(int code,
java.lang.String reason)
public void refuse()
public void bye()
Increments the Cseq, moves to state D_BYEING, and creates new BYE TransactionClient
public void bye(Message bye)
Increments the Cseq, moves to state D_BYEING, and creates new BYE TransactionClient
public void cancel()
public void cancel(Message cancel)
public void redirect(int code,
java.lang.String reason,
java.lang.String contact)
public void onReceivedMessage(SipProvider sip_provider,
Message msg)
If the message is ACK(2xx/INVITE) request, it moves to D_CALL state, and fires onDlgAck(this,body,msg).
If the message is 2xx(INVITE) response, it create a new AckTransactionClient
If the message is BYE, it moves to D_BYED state, removes the listener from SipProvider, fires onDlgBye(this,msg) then it responds with 200 OK, moves to D_CLOSE state and fires onDlgClose(this)
onReceivedMessage in interface SipProviderListeneronReceivedMessage in class Dialog
public void onTransProvisionalResponse(TransactionClient tc,
Message msg)
For INVITE transaction it fires onFailureResponse(this,code,reason,body,msg).
onTransProvisionalResponse in interface TransactionClientListener
public void onTransFailureResponse(TransactionClient tc,
Message msg)
If called for a INVITE transaction, it moves to D_CLOSE state, removes the listener from SipProvider.
If called for a BYE transaction, it moves to D_CLOSE state, removes the listener from SipProvider, and fires onClose(this,msg).
onTransFailureResponse in interface TransactionClientListener
public void onTransSuccessResponse(TransactionClient tc,
Message msg)
If called for a INVITE transaction, it updates the dialog information, moves to D_CALL state, add a listener to the SipProvider, creates a new AckTransactionClient(ack,this), and fires onSuccessResponse(this,code,body,msg).
If called for a BYE transaction, it moves to D_CLOSE state, removes the listener from SipProvider, and fires onClose(this,msg).
onTransSuccessResponse in interface TransactionClientListenerpublic void onTransTimeout(TransactionClient tc)
onTransTimeout in interface TransactionClientListener
public void onTransRequest(TransactionServer ts,
Message req)
If called for a INVITE transaction, it initializes the dialog information,
moves to D_INVITED state, and add a listener to the SipProvider,
and fires onInvite(caller,body,msg).
onTransRequest in interface TransactionServerListener
public void onTransFailureAck(InviteTransactionServer ts,
Message msg)
It moves to D_CLOSE state and removes the listener from SipProvider.
onTransFailureAck in interface InviteTransactionServerListenerpublic void onTransAckTimeout(AckTransactionServer ts)
onTransAckTimeout in interface AckTransactionServerListener
protected void printLog(java.lang.String str,
int level)
printLog in class Dialog
|
MjSip Stack v1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||