hp.opencall.media.ccapi
Class ISDNCallSpec

java.lang.Object
  extended byhp.opencall.media.platform.connection.InternalCallSpec
      extended byhp.opencall.media.ccapi.CallSpec
          extended byhp.opencall.media.ccapi.ISDNCallSpec
All Implemented Interfaces:
CallSpecInterface, ISDNCallSpecInterface
Direct Known Subclasses:
ISDNCallSpecif

public class ISDNCallSpec
extends CallSpec
implements ISDNCallSpecInterface

An ISDNCallSpec object stores the ISDN call specifications :

 - the addresses, i.e. the calling and the called address
 - the Circuit Identifier Code (CIC) used by the call 
 - the Destination Point Code (DPC) of the call
 - the II Digits in ANSI mode
 - the Original Called Number when a call is redirected
 - the Call Reference
 - the incoming and outgoing ISUP messages, including IAM, ACM, ANM/CON, and REL
 

In the following samples, the ISDNCallSpec is used in order to set the ISDN IIDigits of an outgoing call or to get the CIC, DPC and IIDigits used to deliver a call.

 Outgoing call sample:
 isdnOutSpec = new ISDNCallSpec(toAddress, fromAddress); 
 isdnOutSpec.setIIDigits(ISDNCallSpec.IIDigits.TELCO_OPERATOR);
 ...
 public void trunkLegStateChange(int aNewState) {
 ...
 switch (aNewState) {
 case TrunkLeg.CONNECTED:
 // Checks that the required information is available and retrieves it
 if (isdnOutSpec.isCICPresent()) {
 System.out.println("isdnOutSpec: CIC = "+isdnOutSpec.getCIC()); 
 } 
 if (isdnOutSpec.isDPCPresent()) {
 System.out.println("isdnOutSpec: DPC = "+isdnOutSpec.getDPC()); 
 }
 break;
 ...
 }
 Incoming call sample:
 CallSpec inSpec = aCP.getTrunkLeg().getCallSpec();
 // Checks that the call is an ISDN call 
 if (inSpec.getCallSpecType() == CallSpecType.ISDN_CALLSPEC) { 
 // Cast can be done
 ISDNCallSpec isdnInSpec = (ISDNCallSpec) inSpec; 
 // Checks that the required information is available and retrieves it
 if (isdnInSpec.isCICPresent()) { 
 System.out.println("isdnInSpec: CIC = "+isdnInSpec.getCIC()); 
 } 
 if (isdnInSpec.isDPCPresent()) { 
 System.out.println("isdnInSpec: DPC = "+isdnInSpec.getDPC()); 
 } 
 if (isdnInSpec.isIIDigitsPresent()) { 
 System.out.println("isdnInSpec: IIDigits ="+isdnInSpec.getIIDigits()); 
 } 
 if (isdnInSpec.isOriginalCalledNumberPresent()) { 
 System.out.println("isdnInSpec: OriginalCalledNumber 
 ="+isdnInSpec.getOriginalCalledNumber()); 
 } 
 if (isdnInSpec.isCallReferencePresent()) { 
 System.out.println("isdnInSpec: CallReference 
 ="+isdnInSpec.getCallReference()); 
 } 
 }
 if (isdnInSpec.isCalledPartyNumberBytesPresent()) {
 System.out.println("isdnInSpec: CalledPartyNumberBytes 
 ="+isdnInSpec.getCalledPartyNumberBytes());
 }
 }
 

The ISDNCallSpec also allows the user to retrieve incoming ISUP messages, and set the outgoing ISUP messages. Supported messages are IAM, ACM, CON, ANM, and REL. The user can also set the DPC on which to carry the call. This is useful for Local Number Portability, where the DPC associated with a called number can change. The messages are the actual objects described in HP Opencall ISUP Application Developers Guide, but accessed via JNI in Java.

The following example shows how to set and get the ISUP messages, and how to set the DPC for an outgoing call.

 Outgoing call sample:
 isdnOutSpec = new ISDNCallSpec(toAddress, fromAddress);
 // Create IAM message and set the required parameters
 IsupIam iamMsg = new IsupIam((short) 0);   // Need to import 
 com.hp.opencall.isup.message.*;
 ParmValue parmValue = new ParmValue();     // Need to import 
 com.hp.opencall.isup.common.ParmValue;
 parmValue.assign("80x90xa2x", 3);          // Fill in all the required IAM 
 parameters
 isupIam.userServiceInformation(parmValue);
 parmValue.assign("22x00x", 2);
 isupIam.forwardCallIndicators(parmValue);
 parmValue.assign("00x", 1);
 isupIam.natureOfCnxIndicators(parmValue);
 parmValue.assign("81x10x88x77x66xf5x", 6);
 isupIam.calledPartyNumber(parmValue);      // Called number is 8877665
 parmValue.assign("0ax", 1);
 isupIam.callingPartysCategory(parmValue);
 // Store this IAM to be used in ISUP call control
 IsupInfo isupInfo = new IsupInfo();
 isupInfo.putOutgoingIsupMsg(IsupIam.class, iamMsg);
 // Set the DPC to which to send the call
 isdnOutSpec.setDPC(20);  // set DPC to 20
 ...
 Incoming call sample:
 CallSpec inSpec = aCP.getTrunkLeg().getCallSpec();
 // Checks that the call is an ISDN call 
 if (inSpec.getCallSpecType() == CallSpecType.ISDN_CALLSPEC) { 
 // Cast can be done
 ISDNCallSpec isdnInSpec = (ISDNCallSpec) inSpec; 
 // Checks that the required information is available and retrieves it
 if (isdnInSpec.isIsupInfoPresent()) {
 IsupInfo isupInfo = isdnInSpec.getIsupInfo();
 IsupIam iamMsg = (IsupIam) isupInfo.getIncomingIsupMsg(IsupIam.class);
 System.out.println("IAM.calledPartyNumber = " + iamMsg.calledPartyNumber());
 }
 }
 

Since:
OCMP 2.1

Nested Class Summary
 class ISDNCallSpec.IIDigits
          II Digits values The IIDigits class supplies the current IIDigits values used in ANSI mode
 
Nested classes inherited from class hp.opencall.media.ccapi.CallSpec
CallSpec.CallSpecType
 
Field Summary
 
Fields inherited from class hp.opencall.media.platform.connection.InternalCallSpec
defaultConnectionType
 
Constructor Summary
ISDNCallSpec(Address to)
          Deprecated. use ISDNCallSpec(ISDNSignallingParty to) instead
ISDNCallSpec(Address to, Address from)
          Deprecated. use ISDNCallSpec(ISDNSignallingParty to, ISDNSignallingParty from) instead
ISDNCallSpec(CallSpec userSpec)
           
ISDNCallSpec(ISDNSignallingParty to)
          Creates a CallSpec with the specified ISDN called (DNIS) party.
ISDNCallSpec(ISDNSignallingParty to, ISDNSignallingParty from)
          Creates a CallSpec with the specified ISDN called (DNIS) and calling (ANI) parties.
 
Method Summary
 void addISDNRedirectElement(ISDNRedirectElement anElement)
          Add an ISDN call redirection path.
 void addRedirectElement(RedirectElement anElement)
          Add call redirection path.
 void freeIsupInfoMsg()
          Deprecated. IsupMsg memory is handled by the JVM
 byte[] getCalledPartyNumberBytes()
          Gets CalledPartyNumberBytes.
 byte[] getCallReference()
          Gets the Call Reference.
 int getCallSpecType()
          Returns the CallSpec Type
 int getCIC()
          Gets the Circuit Identifier Code (CIC).
 long getDPC()
          Gets the Destination Point Code (DPC).
 int getIIDigits()
          Gets the II Digits.
 ISDNSignallingParty getISDNCalledParty()
          ISDN Called party accessor (DNIS)
 ISDNSignallingParty getISDNCallingParty()
          ISDN Calling party accessor (ANI) OR null if the calling address is not specified in the call associated to this CallSpec
 ISDNRedirectElement[] getISDNRedirectElements()
          Gives access to the redirection paths.
 IsupInfo getIsupInfo()
          Gets the IsupInfo.
 E164Address getOriginalCalledNumber()
          Deprecated. use CallSpec.getRedirectElements()[0] instead
 String getProtocolName()
          return the procole name.
 String getProtocolVersion()
          return the procole version.
 Q850Cause getQ850Cause()
          Get the last received Q850 cause
 char getServiceType()
           
 boolean isCalledPartyNumberBytesPresent()
          Checks if CalledPartyNumberBytes is known.
 boolean isCallReferencePresent()
          Checks if the Call Reference is known.
 boolean isCICPresent()
          Checks if the Circuit Identifier Code is known.
 boolean isDPCPresent()
          Checks if the Destination Point Code is known.
 boolean isIIDigitsPresent()
          Checks if the II Digits are knowns.
 boolean isIncoming()
          (non-Javadoc)
 boolean isIsupInfoPresent()
          Checks if IsupInfo is available.
 boolean isOriginalCalledNumberPresent()
          Checks if the Original Called Number is known.
 void setCalledPartyNumberBytes(byte[] someCalledPartyNumberBytes)
          Sets CalledPartyNumberBytes.
 void setCallReference(byte[] aCallReference)
          Sets the Call Reference.
 void setDPC(long adpc)
          Sets the Destination Point Code (DPC) for an outgoing call.
 void setIIDigits(int aIIDigits)
          Sets the II Digits.
 void setIsupInfo(IsupInfo aIsupInfo)
          Sets the IsupInfo.
 void setOriginalCalledNumber(E164Address aOriginalCalledNumber)
          Deprecated. use addRedirectElement(hp.opencall.media.ccapi.RedirectElement)when CallSpec.getRedirectElements().isEmpty == true instead
 void setQ850Cause(Q850Cause aCause)
          Set the Q850 cause to use for the next ISDN message
 void setServiceType(char stype)
           
 String toString()
           
 
Methods inherited from class hp.opencall.media.ccapi.CallSpec
getCalledAddress, getCalledParty, getCallingAddress, getCallingParty, getOwnerServiceName, getRedirectElements, getRoutingInfo, setRoutingInfo, setUsedProvider
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hp.opencall.media.ccapi.CallSpecInterface
getCalledAddress, getCalledParty, getCallingAddress, getCallingParty, getRedirectElements, setUsedProvider
 

Constructor Detail

ISDNCallSpec

public ISDNCallSpec(ISDNSignallingParty to,
                    ISDNSignallingParty from)
Creates a CallSpec with the specified ISDN called (DNIS) and calling (ANI) parties.

Parameters:
to - ISDN called party (DNIS)
from - ISDN calling party (ANI)

ISDNCallSpec

public ISDNCallSpec(ISDNSignallingParty to)
Creates a CallSpec with the specified ISDN called (DNIS) party.

Parameters:
to - ISDN called party (DNIS)

ISDNCallSpec

public ISDNCallSpec(CallSpec userSpec)
Parameters:
userSpec -

ISDNCallSpec

public ISDNCallSpec(Address to,
                    Address from)
Deprecated. use ISDNCallSpec(ISDNSignallingParty to, ISDNSignallingParty from) instead

Creates an ISDNCallSpec with the specified called and calling addresses.

Parameters:
to -
from -

ISDNCallSpec

public ISDNCallSpec(Address to)
Deprecated. use ISDNCallSpec(ISDNSignallingParty to) instead

Creates an ISDNCallSpec with the specified called address.

Parameters:
to -
Method Detail

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

isCICPresent

public boolean isCICPresent()
Checks if the Circuit Identifier Code is known.

Specified by:
isCICPresent in interface ISDNCallSpecInterface
Returns:
true if the Circuit Identfier Code (CIC) is known.

getCIC

public int getCIC()
Gets the Circuit Identifier Code (CIC).

Specified by:
getCIC in interface ISDNCallSpecInterface
Returns:
the Circuit Identfier Code (CIC) if the isCICPresent() method has returned true.

isDPCPresent

public boolean isDPCPresent()
Checks if the Destination Point Code is known.

Specified by:
isDPCPresent in interface ISDNCallSpecInterface
Returns:
true if the Destination Point Code (DPC) is known.

getDPC

public long getDPC()
Gets the Destination Point Code (DPC).

Specified by:
getDPC in interface ISDNCallSpecInterface
Returns:
the Destination Point Code (DPC) if the isDPCPresent() method has returned true.

setDPC

public void setDPC(long adpc)
Sets the Destination Point Code (DPC) for an outgoing call. Its use allows the oclet to specify the DPC - this is necessary for Local Number Portability (LNP), which cannot route a call to the proper DPC based on the called number.

Specified by:
setDPC in interface ISDNCallSpecInterface
Parameters:
adpc -

isIIDigitsPresent

public boolean isIIDigitsPresent()
Checks if the II Digits are knowns.

Specified by:
isIIDigitsPresent in interface ISDNCallSpecInterface
Returns:
true if the II Digits are knowns.

getIIDigits

public int getIIDigits()
Gets the II Digits.

Specified by:
getIIDigits in interface ISDNCallSpecInterface
Returns:
the II Digits if the isIIDigitsPresent() method has returned true.

setIIDigits

public void setIIDigits(int aIIDigits)
Sets the II Digits.

Specified by:
setIIDigits in interface ISDNCallSpecInterface
Parameters:
aIIDigits - the II Digits.

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

isOriginalCalledNumberPresent

public boolean isOriginalCalledNumberPresent()
Checks if the Original Called Number is known. Information sent in the forward direction when a call is redirected and identifies the original called party.

Specified by:
isOriginalCalledNumberPresent in interface ISDNCallSpecInterface
Returns:
true if the Original Called Number is known.

getOriginalCalledNumber

public E164Address getOriginalCalledNumber()
Deprecated. use CallSpec.getRedirectElements()[0] instead

Gets the Original Called Number.

Specified by:
getOriginalCalledNumber in interface ISDNCallSpecInterface
Returns:
the Original Called Number if the isOriginalCalledNumberPresent() method has returned true.

setOriginalCalledNumber

public void setOriginalCalledNumber(E164Address aOriginalCalledNumber)
Deprecated. use addRedirectElement(hp.opencall.media.ccapi.RedirectElement)when CallSpec.getRedirectElements().isEmpty == true instead

Sets the Original Called Number

Specified by:
setOriginalCalledNumber in interface ISDNCallSpecInterface
Parameters:
aOriginalCalledNumber - the Original Called Number to indicate that the call is redirected.

isCallReferencePresent

public boolean isCallReferencePresent()
Checks if the Call Reference is known.

Specified by:
isCallReferencePresent in interface ISDNCallSpecInterface
Returns:
true if the Call Reference is known.

getCallReference

public byte[] getCallReference()
Gets the Call Reference.

Specified by:
getCallReference in interface ISDNCallSpecInterface
Returns:
the Call Reference if the isCallReferencePresent() method has returned true.

setCallReference

public void setCallReference(byte[] aCallReference)
Sets the Call Reference.

Specified by:
setCallReference in interface ISDNCallSpecInterface
Parameters:
aCallReference - the Call Reference.

isIsupInfoPresent

public boolean isIsupInfoPresent()
Checks if IsupInfo is available.

Specified by:
isIsupInfoPresent in interface ISDNCallSpecInterface
Returns:
true if IsupInfo is available.
Since:
OCMP 2.3

freeIsupInfoMsg

public void freeIsupInfoMsg()
Deprecated. IsupMsg memory is handled by the JVM

free the Incoming Msg IsupInfo.

Specified by:
freeIsupInfoMsg in interface ISDNCallSpecInterface

isCalledPartyNumberBytesPresent

public boolean isCalledPartyNumberBytesPresent()
Checks if CalledPartyNumberBytes is known.

Specified by:
isCalledPartyNumberBytesPresent in interface ISDNCallSpecInterface
Returns:
true if CalledPartyNumberBytes is known, false otherwise.

getCalledPartyNumberBytes

public byte[] getCalledPartyNumberBytes()
Gets CalledPartyNumberBytes.

Specified by:
getCalledPartyNumberBytes in interface ISDNCallSpecInterface
Returns:
CalledPartyNumberBytes if isCalledPartyNumberBytesPresent() method returned true.

setCalledPartyNumberBytes

public void setCalledPartyNumberBytes(byte[] someCalledPartyNumberBytes)
Sets CalledPartyNumberBytes.

Specified by:
setCalledPartyNumberBytes in interface ISDNCallSpecInterface
Parameters:
someCalledPartyNumberBytes - the CalledPartyNumberBytes.

isIncoming

public final boolean isIncoming()
(non-Javadoc)

Specified by:
isIncoming in interface CallSpecInterface
Overrides:
isIncoming in class CallSpec
Returns:
boolean
See Also:
CallSpecInterface.isIncoming()

getIsupInfo

public IsupInfo getIsupInfo()
Gets the IsupInfo.

Specified by:
getIsupInfo in interface ISDNCallSpecInterface
Returns:
the IsupInfo
Since:
OCMP 2.3

setIsupInfo

public void setIsupInfo(IsupInfo aIsupInfo)
Sets the IsupInfo.

Specified by:
setIsupInfo in interface ISDNCallSpecInterface
Parameters:
aIsupInfo - the IsupInfo
Since:
OCMP 2.3

getISDNCalledParty

public ISDNSignallingParty getISDNCalledParty()
Description copied from interface: ISDNCallSpecInterface
ISDN Called party accessor (DNIS)

Specified by:
getISDNCalledParty in interface ISDNCallSpecInterface
Returns:
hp.opencall.media.ccapi.ISDNSignallingParty

getISDNRedirectElements

public ISDNRedirectElement[] getISDNRedirectElements()
Gives access to the redirection paths. FromVXML: This variable is an array representing the connection redirection paths. The first element is the original called number, the last element is the last redirected number.

Specified by:
getISDNRedirectElements in interface ISDNCallSpecInterface
Returns:
hp.opencall.media.ccapi.ISDNRedirectElement[]

addRedirectElement

public void addRedirectElement(RedirectElement anElement)
Add call redirection path. The first element is the original called number, the last element is the last redirected number. WARNING This method is slower than #addISDNRedirectElement

Specified by:
addRedirectElement in interface CallSpecInterface
Overrides:
addRedirectElement in class CallSpec
Parameters:
anElement -

addISDNRedirectElement

public void addISDNRedirectElement(ISDNRedirectElement anElement)
Add an ISDN call redirection path. The first element is the original called number, the last element is the last redirected number.

Specified by:
addISDNRedirectElement in interface ISDNCallSpecInterface
Parameters:
anElement -

getISDNCallingParty

public ISDNSignallingParty getISDNCallingParty()
ISDN Calling party accessor (ANI) OR null if the calling address is not specified in the call associated to this CallSpec

Specified by:
getISDNCallingParty in interface ISDNCallSpecInterface
Returns:
hp.opencall.media.ccapi.ISDNSignallingParty

getQ850Cause

public Q850Cause getQ850Cause()
Get the last received Q850 cause

Specified by:
getQ850Cause in interface ISDNCallSpecInterface
Returns:
Q850Cause

getServiceType

public char getServiceType()

setQ850Cause

public void setQ850Cause(Q850Cause aCause)
Set the Q850 cause to use for the next ISDN message

Specified by:
setQ850Cause in interface ISDNCallSpecInterface
Parameters:
aCause -

setServiceType

public void setServiceType(char stype)

toString

public String toString()
Overrides:
toString in class CallSpec