hp.opencall.media.ccapi
Class SIPCallSpec

java.lang.Object
  extended byhp.opencall.media.platform.connection.InternalCallSpec
      extended byhp.opencall.media.ccapi.CallSpec
          extended byhp.opencall.media.ccapi.SIPCallSpec
All Implemented Interfaces:
CallSpecInterface, SIPCallSpecInterface

public class SIPCallSpec
extends CallSpec
implements SIPCallSpecInterface

The SIPCallSpec allows the user to retrieve incoming SIP messages, and set the outgoing SIP messages.

The following example shows how to set and get the SIP messages.


 Outgoing call sample:

  sipOutSpec = new SIPCallSpec(toAddress, fromAddress);

  // Create the SIP Message and set the required parameters.
  SIPInviteIntf invite = (SIPInviteIntf)info.createSIPMsg(SIPInviteIntf.class) ;
  invite.setTo("sip:conf-service@hp.com") ;
  invite.setRequestURI("sip:conf-service@hp.com");
  ...
  ...
  // Store this SIP Message to be used in SIP call Control
  SIPInfo sipInfo = new SIPInfo();
  sipInfo.putOutgoingDIPMsg(SIPInviteMsg.class, invite);
  sipOutSpec.setSIPInfo(sipInfo) ;


 Incoming call sample:

  CallSpec inSpec = aCP.getTrunkLeg().getCallSpec();

  // Checks that the call is an SIP call 
  if (inSpec.getCallSpecType() == CallSpec.SIP_CALLSPEC) { 

    // Cast can be done
    SIPCallSpec sipInSpec = (SIPCallSpec) inSpec; 

    // Checks that the required information is available and retrieves it
    if (sipInSpec.isSIPInfoPresent()) {
      SIPInfo sipInfo = sipInSpec.getSIPInfo();
      SIPInviteIntf invite = (SIPInviteIntf)sipInfo.getIncomingSIPMsg(SIPInviteIntf.class);
      System.out.println("SIP Info method = "+invite);
    }
  }
 
 


Nested Class Summary
 
Nested classes inherited from class hp.opencall.media.ccapi.CallSpec
CallSpec.CallSpecType
 
Field Summary
static int SIP_CALLSPEC
           
 
Fields inherited from class hp.opencall.media.platform.connection.InternalCallSpec
defaultConnectionType
 
Constructor Summary
SIPCallSpec(Address to)
          Deprecated.  
SIPCallSpec(Address to, Address from)
          Deprecated.  
SIPCallSpec(CallSpec userSpec)
           
SIPCallSpec(SignallingParty to)
          Creates an SIPCallSpec with the specified called address.
SIPCallSpec(SignallingParty to, SignallingParty from)
          Creates an SIPCallSpec with the specified called and calling addresses.
 
Method Summary
 void cleanDummyCallSpec()
          This method sets the Call Spec as a normal Call Spec
 int getCallSpecType()
          Returns the CallSpec Type
 String getProtocolName()
          return the procole name.
 String getProtocolVersion()
          return the procole version.
 String getSANname()
          Gets the SAN name (for outgoing calls routing).
 SIPInfo getSIPInfo()
          Gets the SIPInfo.
 boolean isDummyCallSpec()
          This method checks it's a valid call Spec or a dummy call Spec A dummy call spec can be only used in a SIP context.
 boolean isIncoming()
          Returns the side from which call was originated
 boolean isSANnamePresent()
          Checks if the SAN name has been set.
 boolean isSIPInfoPresent()
          Checks if SIPInfo is available.
 void setDummyCallSpec()
          This method sets the Call Spec as Dummy Call Spec A dummy call spec can be only used in a SIP context.
 void setIncoming()
           
 void setSANname(String aSANname)
          Sets the SAN name (for outgoing calls routing).
 void setSIPInfo(SIPInfo aSIPInfo)
          Sets the SIPInfo.
 
Methods inherited from class hp.opencall.media.ccapi.CallSpec
addRedirectElement, getCalledAddress, getCalledParty, getCallingAddress, getCallingParty, getOwnerServiceName, getRedirectElements, getRoutingInfo, setRoutingInfo, setUsedProvider, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hp.opencall.media.ccapi.CallSpecInterface
addRedirectElement, getCalledAddress, getCalledParty, getCallingAddress, getCallingParty, getRedirectElements, setUsedProvider
 

Field Detail

SIP_CALLSPEC

public static final int SIP_CALLSPEC
See Also:
Constant Field Values
Constructor Detail

SIPCallSpec

public SIPCallSpec(Address to)
Deprecated.  

Creates an SIPCallSpec with the specified called address.


SIPCallSpec

public SIPCallSpec(Address to,
                   Address from)
Deprecated.  

Creates an SIPCallSpec with the specified called and calling addresses.


SIPCallSpec

public SIPCallSpec(CallSpec userSpec)
Parameters:
userSpec - Retrofit from ISDNcallSpec

SIPCallSpec

public SIPCallSpec(SignallingParty to)
Creates an SIPCallSpec with the specified called address.


SIPCallSpec

public SIPCallSpec(SignallingParty to,
                   SignallingParty from)
Creates an SIPCallSpec with the specified called and calling addresses.

Method Detail

getCallSpecType

public int getCallSpecType()
Returns the CallSpec Type

Specified by:
getCallSpecType in interface CallSpecInterface
Overrides:
getCallSpecType in class CallSpec
Returns:
a CallSpec type value according to the CallSpecType class

isSIPInfoPresent

public boolean isSIPInfoPresent()
Checks if SIPInfo is available.

Specified by:
isSIPInfoPresent in interface SIPCallSpecInterface
Returns:
true if SIPInfo is available.

getSIPInfo

public SIPInfo getSIPInfo()
Gets the SIPInfo.

Specified by:
getSIPInfo in interface SIPCallSpecInterface
Returns:
the SIPInfo

setSIPInfo

public void setSIPInfo(SIPInfo aSIPInfo)
Sets the SIPInfo.

Specified by:
setSIPInfo in interface SIPCallSpecInterface
Parameters:
aSIPInfo - the SIPInfo

setSANname

public void setSANname(String aSANname)
Sets the SAN name (for outgoing calls routing). Accessor for the SIPinfo attrbute... Creates a SipInfo if not exists, because we need a storage area for the SAN name

Parameters:
aSANname - the SAN name

isSANnamePresent

public boolean isSANnamePresent()
Checks if the SAN name has been set. Accessor for the SIPinfo attrbute


getSANname

public String getSANname()
Gets the SAN name (for outgoing calls routing). Accessor for the SIPinfo attrbute


isDummyCallSpec

public boolean isDummyCallSpec()
This method checks it's a valid call Spec or a dummy call Spec A dummy call spec can be only used in a SIP context. It offers a way to receive messages from the stack without having an established call.

Returns:
TRUE - Dummy call spec / FALSE - Normal Call Spec

cleanDummyCallSpec

public void cleanDummyCallSpec()
This method sets the Call Spec as a normal Call Spec


setDummyCallSpec

public void setDummyCallSpec()
This method sets the Call Spec as Dummy Call Spec A dummy call spec can be only used in a SIP context. It offers a way to receive messages from the stack without having an established call.


isIncoming

public final boolean isIncoming()
Description copied from interface: CallSpecInterface
Returns the side from which call was originated

Specified by:
isIncoming in interface CallSpecInterface
Overrides:
isIncoming in class CallSpec
Returns:
true if incoming call, false otherwise

setIncoming

public void setIncoming()

getProtocolName

public String getProtocolName()
Description copied from interface: CallSpecInterface
return the procole name.

Specified by:
getProtocolName in interface CallSpecInterface
Overrides:
getProtocolName in class CallSpec

getProtocolVersion

public String getProtocolVersion()
Description copied from interface: CallSpecInterface
return the procole version.

Specified by:
getProtocolVersion in interface CallSpecInterface
Overrides:
getProtocolVersion in class CallSpec