MjSip Stack
v1.6

org.zoolu.sip.call
Class Call

java.lang.Object
  |
  +--org.zoolu.sip.call.Call
All Implemented Interfaces:
InviteDialogListener
Direct Known Subclasses:
ExtendedCall

public class Call
extends java.lang.Object
implements InviteDialogListener

Class Call implements SIP calls.

It handles both outgoing or incoming calls.

Both offer/answer models are supported, that is:
i) offer/answer in invite/2xx, or
ii) offer/answer in 2xx/ack


Field Summary
protected  java.lang.String contact_url
          The user contact url
protected  InviteDialog dialog
          The invite dialog (sip.dialog.InviteDialog)
protected  java.lang.String from_url
          The user url
protected  java.lang.String local_sdp
          The local sdp
protected  java.lang.String remote_sdp
          The remote sdp
protected  SipProvider sip_provider
          The SipProvider used for the call
 
Constructor Summary
Call(SipProvider sip_provider, java.lang.String from_url, java.lang.String contact_url, CallListener call_listener)
          Creates a new Call.
 
Method Summary
 void accept(java.lang.String sdp)
          Accepts the incoming call
 void ackWithAnswer(java.lang.String sdp)
          Answers at the 2xx/offer (in the ack message)
 void bye()
          Close the ongoing call
 void call(Message invite)
          Starts a new call with the invite message request
 void call(java.lang.String callee)
          Starts a new call, inviting a remote user (callee)
 void call(java.lang.String callee, java.lang.String sdp)
          Starts a new call, inviting a remote user (callee)
 void call(java.lang.String callee, java.lang.String from, java.lang.String contact, java.lang.String sdp)
          Starts a new call, inviting a remote user (callee)
 void cancel()
          Cancels the outgoing call
 java.lang.String getLocalSessionDescriptor()
          Gets the current local session descriptor
 java.lang.String getRemoteSessionDescriptor()
          Gets the current remote session descriptor
 void hangup()
          Closes an ongoing or incoming/outgoing call It trys to fires refuse(), cancel(), and bye() methods
 boolean isOnCall()
          Whether the call is on (active).
 void listen()
          Waits for an incoming call
 void modify(java.lang.String contact, java.lang.String sdp)
          Modify the current call
 void onDlgAck(InviteDialog d, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgBye(InviteDialog d, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgByeFailureResponse(InviteDialog d, int code, java.lang.String reason, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgByeSuccessResponse(InviteDialog d, int code, java.lang.String reason, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgCall(InviteDialog dialog)
          When the INVITE handshake is successful terminated
 void onDlgCancel(InviteDialog d, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgClose(InviteDialog dialog)
          When the dialog is finally closed
 void onDlgInvite(InviteDialog d, NameAddress callee, NameAddress caller, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgInviteFailureResponse(InviteDialog d, int code, java.lang.String reason, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgInviteProvisionalResponse(InviteDialog d, int code, java.lang.String reason, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgInviteRedirectResponse(InviteDialog d, int code, java.lang.String reason, MultipleHeader contacts, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgInviteSuccessResponse(InviteDialog d, int code, java.lang.String reason, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgReInvite(InviteDialog d, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgReInviteFailureResponse(InviteDialog d, int code, java.lang.String reason, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgReInviteProvisionalResponse(InviteDialog d, int code, java.lang.String reason, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgReInviteSuccessResponse(InviteDialog d, int code, java.lang.String reason, java.lang.String sdp, Message msg)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgReInviteTimeout(InviteDialog d)
          Inherited from class InviteDialogListener and called by an InviteDialag.
 void onDlgTimeout(InviteDialog d)
          Inherited from class InviteDialogListener and called by an InviteDialag.
protected  void printLog(java.lang.String str, int level)
          Adds a new string to the default Log
 void redirect(java.lang.String redirect_url)
          Redirects the incoming call
 void refuse()
          Refuses the incoming call
 void respond(Message resp)
          Respond to a incoming call (invite) with resp
 void ring()
          Rings back for the incoming call
 void setLocalSessionDescriptor(java.lang.String sdp)
          Sets a new local session descriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sip_provider

protected SipProvider sip_provider
The SipProvider used for the call

dialog

protected InviteDialog dialog
The invite dialog (sip.dialog.InviteDialog)

from_url

protected java.lang.String from_url
The user url

contact_url

protected java.lang.String contact_url
The user contact url

local_sdp

protected java.lang.String local_sdp
The local sdp

remote_sdp

protected java.lang.String remote_sdp
The remote sdp
Constructor Detail

Call

public Call(SipProvider sip_provider,
            java.lang.String from_url,
            java.lang.String contact_url,
            CallListener call_listener)
Creates a new Call.
Method Detail

getLocalSessionDescriptor

public java.lang.String getLocalSessionDescriptor()
Gets the current local session descriptor

setLocalSessionDescriptor

public void setLocalSessionDescriptor(java.lang.String sdp)
Sets a new local session descriptor

getRemoteSessionDescriptor

public java.lang.String getRemoteSessionDescriptor()
Gets the current remote session descriptor

isOnCall

public boolean isOnCall()
Whether the call is on (active).

listen

public void listen()
Waits for an incoming call

call

public void call(java.lang.String callee)
Starts a new call, inviting a remote user (callee)

call

public void call(java.lang.String callee,
                 java.lang.String sdp)
Starts a new call, inviting a remote user (callee)

call

public void call(java.lang.String callee,
                 java.lang.String from,
                 java.lang.String contact,
                 java.lang.String sdp)
Starts a new call, inviting a remote user (callee)

call

public void call(Message invite)
Starts a new call with the invite message request

ackWithAnswer

public void ackWithAnswer(java.lang.String sdp)
Answers at the 2xx/offer (in the ack message)

ring

public void ring()
Rings back for the incoming call

respond

public void respond(Message resp)
Respond to a incoming call (invite) with resp

accept

public void accept(java.lang.String sdp)
Accepts the incoming call

redirect

public void redirect(java.lang.String redirect_url)
Redirects the incoming call

refuse

public void refuse()
Refuses the incoming call

cancel

public void cancel()
Cancels the outgoing call

bye

public void bye()
Close the ongoing call

modify

public void modify(java.lang.String contact,
                   java.lang.String sdp)
Modify the current call

hangup

public void hangup()
Closes an ongoing or incoming/outgoing call

It trys to fires refuse(), cancel(), and bye() methods


onDlgInvite

public void onDlgInvite(InviteDialog d,
                        NameAddress callee,
                        NameAddress caller,
                        java.lang.String sdp,
                        Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallIncoming()).
Specified by:
onDlgInvite in interface InviteDialogListener

onDlgReInvite

public void onDlgReInvite(InviteDialog d,
                          java.lang.String sdp,
                          Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallModifying()).
Specified by:
onDlgReInvite in interface InviteDialogListener

onDlgInviteProvisionalResponse

public void onDlgInviteProvisionalResponse(InviteDialog d,
                                           int code,
                                           java.lang.String reason,
                                           java.lang.String sdp,
                                           Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallRinging()).
Specified by:
onDlgInviteProvisionalResponse in interface InviteDialogListener

onDlgInviteSuccessResponse

public void onDlgInviteSuccessResponse(InviteDialog d,
                                       int code,
                                       java.lang.String reason,
                                       java.lang.String sdp,
                                       Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallAccepted()).
Specified by:
onDlgInviteSuccessResponse in interface InviteDialogListener

onDlgInviteRedirectResponse

public void onDlgInviteRedirectResponse(InviteDialog d,
                                        int code,
                                        java.lang.String reason,
                                        MultipleHeader contacts,
                                        Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallRedirection()).
Specified by:
onDlgInviteRedirectResponse in interface InviteDialogListener

onDlgInviteFailureResponse

public void onDlgInviteFailureResponse(InviteDialog d,
                                       int code,
                                       java.lang.String reason,
                                       Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallRefused()).
Specified by:
onDlgInviteFailureResponse in interface InviteDialogListener

onDlgTimeout

public void onDlgTimeout(InviteDialog d)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallTimeout()).
Specified by:
onDlgTimeout in interface InviteDialogListener

onDlgReInviteProvisionalResponse

public void onDlgReInviteProvisionalResponse(InviteDialog d,
                                             int code,
                                             java.lang.String reason,
                                             java.lang.String sdp,
                                             Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it.
Specified by:
onDlgReInviteProvisionalResponse in interface InviteDialogListener

onDlgReInviteSuccessResponse

public void onDlgReInviteSuccessResponse(InviteDialog d,
                                         int code,
                                         java.lang.String reason,
                                         java.lang.String sdp,
                                         Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallReInviteAccepted()).
Specified by:
onDlgReInviteSuccessResponse in interface InviteDialogListener

onDlgReInviteFailureResponse

public void onDlgReInviteFailureResponse(InviteDialog d,
                                         int code,
                                         java.lang.String reason,
                                         Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallReInviteRefused()).
Specified by:
onDlgReInviteFailureResponse in interface InviteDialogListener

onDlgReInviteTimeout

public void onDlgReInviteTimeout(InviteDialog d)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallReInviteTimeout()).
Specified by:
onDlgReInviteTimeout in interface InviteDialogListener

onDlgAck

public void onDlgAck(InviteDialog d,
                     java.lang.String sdp,
                     Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallConfirmed()).
Specified by:
onDlgAck in interface InviteDialogListener

onDlgCancel

public void onDlgCancel(InviteDialog d,
                        Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onCallClosing()).
Specified by:
onDlgCancel in interface InviteDialogListener

onDlgBye

public void onDlgBye(InviteDialog d,
                     Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onClosing()).
Specified by:
onDlgBye in interface InviteDialogListener

onDlgByeFailureResponse

public void onDlgByeFailureResponse(InviteDialog d,
                                    int code,
                                    java.lang.String reason,
                                    Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onClosed()).
Specified by:
onDlgByeFailureResponse in interface InviteDialogListener

onDlgByeSuccessResponse

public void onDlgByeSuccessResponse(InviteDialog d,
                                    int code,
                                    java.lang.String reason,
                                    Message msg)
Inherited from class InviteDialogListener and called by an InviteDialag. Normally you should not use it. Use specific callback methods instead (e.g. onClosed()).
Specified by:
onDlgByeSuccessResponse in interface InviteDialogListener

onDlgCall

public void onDlgCall(InviteDialog dialog)
When the INVITE handshake is successful terminated
Specified by:
onDlgCall in interface InviteDialogListener

onDlgClose

public void onDlgClose(InviteDialog dialog)
When the dialog is finally closed
Specified by:
onDlgClose in interface InviteDialogListener

printLog

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

MjSip Stack
v1.6