hp.opencall.media.ccapi
Class CCSession

java.lang.Object
  extended byhp.opencall.media.platform.Capability
      extended byhp.opencall.media.platform.ResourceCapability
          extended byhp.opencall.media.service.Session
              extended byhp.opencall.media.ccapi.CCSession
All Implemented Interfaces:
ExternalEventScheduler

public abstract class CCSession
extends hp.opencall.media.service.Session
implements ExternalEventScheduler

CCSession is the center class of the Call Control API.

Call Control service applications, also referred to as Oclets, are created by extending this class and providing implementation for its abstract methods.

CCSession models the abstraction of a session within the Media Platform and acts as the enclosing object for all the resources that are involved in the session. This means that, when the platform starts up an oclet, the oclet is instantiated in the context of a session.

The Platform starts up an oclet on the occurence of one of the following events:
1. An incoming call addressed to this oclet is received by the platform from the telephony network.
2. The service that corresponds to this oclet is configured and invoked directly from the OCMP Management System.

The Platform starts up an oclet as follows:
1. It initializes a new session for the oclet.
2. It instantiates the oclet.
3. It invokes its newCCSession method.

The newCCSession method is thus the entry point for the oclet as it is the first oclet's method invoked by the platform. Several forms of newCCSession are provided, depending on how the oclet was initiated.

Incoming Calls

Incoming calls are dispatched by the platform to the applications (oclets) depending on their called address. If the called address matches an address which has been configured to map to the oclet in question, the platform starts up the oclet, that is it initializes a new session with all the resource objects (CallParty, TrunkLeg, etc..) associated to the call, instantiates the oclet and invokes its newCCSession method.
In this case, newCCSession is invoked with the CallParty object associated to the incoming call as a parameter.

Direct Invocation from the Management System

An oclet can be started directly from the OCMP management system. This means that such an oclet is not associated to any incoming call.
In this case, the platform instanciates the oclet and invokes its newCCSession method with no parameters.

Session Termination

A session is terminated by invoking the release() method. All the associated resources (such as CallParties) and all associated calls are then released.

Thread Management

The Platform schedules a thread, referred to as a User Thread, to invoke the Call Control API callback methods. For example, newCCSession is invoked on a User Thread.
In order to ensure appropriate synchronization in the platform, most of the API methods, including CCSession methods and AsyncMediaGroup methods can only be called from the User Thread that last called back to the user code.
If it is required to implicitely or explicitely create new threads for the application's own purposes, referred to as Application Threads, care should be taken to not invoke those API methods from these threads.

This is particularly true when it is required to handle external events, i.e. events that are not generated by the Platform, such as timers.
For example, if java timers (Timer class) are used, the actionPerformed method of the timer listener object is called when the timer pops. This method is called on the java event-dispatching thread, which is not a platform's User Thread. Hence, the API methods cannot be called from this thread.

Since:
OCMP 2.0

In order to solve this problem a specific event handling mechanism is provided, as follows:
- A listener object implementing the ExternalEventListener interface has to be created.
- This listener object is registered in the oclet by a call to addExternalEventListener.
- The event handler for external events should invoke notifyExternalEvent. This method schedules a User Thread to invoke onExternalEvent in the listener object previously created. The external event is passed in this call. Since onExternalEvent is invoked on a User Thread, any API methods can be invoked then., Deprecated Another mechanism solves this problem. It enables create a proxy instance with users interfaces, on which every methods can be called from external threads. This mechanism replaces and enhances the external event mechanism., OCMP 2.2


Field Summary
static hp.opencall.media.platform.AccessControlManager acm
          FOR FUTURE USE.
static int ACTIVE
          The session is ACTIVE as long as it is not released, not revoked and at least one of its CallParties is not released.
static int ASR_RECORDER_STREAM_MASK
           
static int IDLE
          The session is IDLE until at least one of its CallParty gets connected.
static int INCOMING_NETWORK_PROXY_STREAM_MASK
           
static int NO_STREAM_MASK
           
static int OUTGOING_NETWORK_PROXY_STREAM_MASK
           
static int RELEASED
          A session goes to the RELEASED state if it is released by the Call Handler, or when it is revoked by the platform.
static String[] stateString
          Table indexed by state value to return state name
static int TTS_PLAYER_STREAM_MASK
           
 
Fields inherited from class hp.opencall.media.service.Session
_defaultStreamsLogMask, myTerminal
 
Constructor Summary
CCSession()
           
 
Method Summary
 void activateTrace()
          Activate traces for that CCSession
 void addExternalEventListener(ExternalEventListener listener)
          Adds the specified listener to receive external events.
 CP addTrunkCParty(CallSpec aCallSpec)
          Creates a new CallParty with a TrunkLeg.
 void bridge(CP aCP1)
          Attaches a CallParty to a bridge.
 void bridge(CP aCP1, BridgeDir bDir)
          FOR FUTURE USE
 AsyncMediaGroup bridge(CP aCP, BridgeDir bDir, ConfigSpec aSpec, MediaGroupDir mgDir)
           
 AsyncMediaGroup bridge(CP aCP, ConfigSpec aSpec)
          Attaches a MediaGroup to the CallParty and bridges the CallParty.
abstract  void callPartyStateChange(CP aCP, int aNewCPState)
          Indicates a CallParty state change.
static CCSession createNewServiceSession(String serviceName)
          Creates an empty Service Session with no CallParty attached.
static CCSession createNewServiceSession(String serviceName, Object newCCSessionParam)
          Creates an empty Service Session with no CallParty attached.
 void deactivateTrace()
          Deactivate traces for that CCSession
 void destroyed()
          Excecuted at session end This method may be overwrited by the user to get the session ends and to access to private user CCSession data but cannot be used to execute any ccapi session operation.
 void disconnect(CP aCP)
          t Disconnects a CallParty that was either bridged or looped.It remains registered to conferences.
static int getAndResetMaxLoopCPDuration()
           
 CP[] getCallParties()
          Gets a table of the CallParty objects available in this session.
 Object getProxy(Class aClass)
          Creates a proxy instance on which users methods can be called from external threads.
 Object getProxy(Class[] aInterTab)
          Creates a proxy instance on which users methods can be called from external threads.
 String getServiceName()
          Get the Service Name.
 String getTraceIdentifier()
          Get the prefix identifier used for tracing.
 void interrupt()
          Wakes up the session.
 AsyncMediaGroup loopBridge()
          Creates an AsyncMediaGroup and connects it to the softdspBridge.
 AsyncMediaGroup loopBridge(ConfigSpec aConfigSpec)
          Creates an AsyncMediaGroup and connects it to the softdspBridge.
 AsyncMediaGroup loopCP(CP aCP, ConfigSpec aSpec)
          Causes a CallParty to loop its trunk leg to a media group leg.
abstract  void newCCSession()
          Called by the platform at session/oclet startup.
abstract  void newCCSession(CP aCP)
          Called by the platform at session/oclet startup on incoming call.
 void newCCSession(Object anObject)
          Called by the platform at session/oclet creation with method createNewServiceSession(Name aNem, Object anObject)
 void notifyExternalEvent(EventObject event)
          Notifies an external event to the session/oclet.
 ConferenceIF register(CP aCP, ConferenceSpec acSpec)
          Registers a CP to a conference Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
 ConferenceIF register(CP aCP, ConferenceSpec acSpec, Class aclass)
          Registers a CP to a conference of type class Creates an extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
 ConferenceIF register(CP aCP, ConferenceSpec acSpec, Class aclass, ConferenceListener aconfListener)
          Registers a CP to a conference of type Class and adds a ConferenceListener on this conference Creates a extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
 ConferenceIF register(CP aCP, ConferenceSpec acSpec, ConferenceListener aconfListener)
          Registers a CP to a conference and adds a ConferenceListener on this conference Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
 void release()
          Terminates the session The session and all its associated resources, like CallParties, are released.
 void releaseCP(CP aCP)
          Releases a CallParty.
 void removeExternalEventListener(ExternalEventListener listener)
          Removes the specified listener so it no longer receives external events.
static boolean serviceControlsBackwardAck()
          Excecuted at service startup This method may be overwrited by the user to modify the way backward ack is controlled.
abstract  void sessionStateUpdate(int aNewState)
          Indicates a Session state change.
 void setBridge(BridgeSpec aBridgeSpec)
          Allocates a bridge to connect CallParty's together.
 void setStreamsLogMask(int mask)
          Ask to the Media Group to log some I/O media streams in a file.
 void setTraceIdentifier(String id)
          Add a developer specific prefix identifier in the session name used for tracing.
 void sleep()
          Causes the session to sleep.
 void sleep(long milliseconds)
          Causes the session to sleep for the specified number of ms.
static void start()
          Excecuted at service start This method may be overwrited by the user to execute service level operation at start of the service.
static void stop()
          Excecuted at service stop This method may be overwrited by the user to execute service level operation at stop of the service
 void unregister(CP aCP, ConferenceIF aconfIF)
          Unregisters a CP from a conference * Pre-conditions:
1.
 
Methods inherited from class hp.opencall.media.service.Session
bindSessionToTerminal, checkObjectInterfaces, getName, getSessionAC, getTerminalAddress, printOut, sessionId, setDefaultStreamsLogMask, toString
 
Methods inherited from class hp.opencall.media.platform.ResourceCapability
checkCapability, revoke
 
Methods inherited from class hp.opencall.media.platform.Capability
addRevocationListener, removeRevocationListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

acm

public static final hp.opencall.media.platform.AccessControlManager acm
FOR FUTURE USE. The Access Control Manager.

Since:
Not supported

NO_STREAM_MASK

public static final int NO_STREAM_MASK
See Also:
Constant Field Values

INCOMING_NETWORK_PROXY_STREAM_MASK

public static final int INCOMING_NETWORK_PROXY_STREAM_MASK
See Also:
Constant Field Values

OUTGOING_NETWORK_PROXY_STREAM_MASK

public static final int OUTGOING_NETWORK_PROXY_STREAM_MASK
See Also:
Constant Field Values

ASR_RECORDER_STREAM_MASK

public static final int ASR_RECORDER_STREAM_MASK
See Also:
Constant Field Values

TTS_PLAYER_STREAM_MASK

public static final int TTS_PLAYER_STREAM_MASK
See Also:
Constant Field Values

IDLE

public static final int IDLE
The session is IDLE until at least one of its CallParty gets connected. From then on, the session is ACTIVE.

See Also:
Constant Field Values

ACTIVE

public static final int ACTIVE
The session is ACTIVE as long as it is not released, not revoked and at least one of its CallParties is not released.

See Also:
Constant Field Values

RELEASED

public static final int RELEASED
A session goes to the RELEASED state if it is released by the Call Handler, or when it is revoked by the platform.

See Also:
Constant Field Values

stateString

public static final String[] stateString
Table indexed by state value to return state name

Constructor Detail

CCSession

public CCSession()
Method Detail

setTraceIdentifier

public void setTraceIdentifier(String id)
Add a developer specific prefix identifier in the session name used for tracing.

Parameters:
id - is the String that will prefixed the session name


getServiceName

public String getServiceName()
Get the Service Name.

Returns:
A string containing the Service Name supplied by OAM

setStreamsLogMask

public void setStreamsLogMask(int mask)
Ask to the Media Group to log some I/O media streams in a file.

Four media streams can be logged thanks to a combination of four masks : - INCOMING_NETWORK_PROXY_STREAM_MASK - OUTGOING_NETWORK_PROXY_STREAM_MASK - ASR_RECORDER_STREAM_MASK - TTS_PLAYER_STREAM_MASK

Parameters:
mask - is the int that combines different stream masks

Since:
OCMP 2.4.C2
See Also:
NO_STREAM_MASK, INCOMING_NETWORK_PROXY_STREAM_MASK, OUTGOING_NETWORK_PROXY_STREAM_MASK, ASR_RECORDER_STREAM_MASK,


getTraceIdentifier

public String getTraceIdentifier()
Get the prefix identifier used for tracing.

Returns:
A string containing the prefix identifier

activateTrace

public void activateTrace()
Activate traces for that CCSession


deactivateTrace

public void deactivateTrace()
Deactivate traces for that CCSession


addTrunkCParty

public CP addTrunkCParty(CallSpec aCallSpec)
                  throws AccessControlException
Creates a new CallParty with a TrunkLeg. The Call Party's initial state is OPENED.

Parameters:
aCallSpec - specifies the call setup parameters that are passed to the signalling system taking care of the call.

Throws:
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

getCallParties

public CP[] getCallParties()
                    throws AccessControlException
Gets a table of the CallParty objects available in this session.

Throws:
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

loopCP

public AsyncMediaGroup loopCP(CP aCP,
                              ConfigSpec aSpec)
                       throws AccessControlException,
                              BadConfigSpecException
Causes a CallParty to loop its trunk leg to a media group leg.

This method creates a media group (AsyncMediaGroup) and an associated media group leg which is looped to the Call Party's trunk leg. The source side of the trunk leg is connected to the sink side of the media group leg and conversely (duplex connection).
The media group can thus be used to play a message, record a message or detect DTMF.

Other CallParties in the session are not involved, even if a bridge has been set.

Pre-conditions:
1. The CP must be in the state OPENED.
This means that if the CP has been previously bridged or looped, it must have been disconnected by a call to disconnect().

Post-conditions:
1. The CP goes to the LOOPING state and then LOOPED. It may already be in the LOOPED state when the call returns.

Throws:
InvalidCPStateException - if the CallParty is not in the proper state.
BadThreadException - if the method is not called on the proper User Thread.

AccessControlException
BadConfigSpecException

loopBridge

public final AsyncMediaGroup loopBridge()
                                 throws AccessControlException,
                                        BadConfigSpecException,
                                        ResourceNotAvailableException
Creates an AsyncMediaGroup and connects it to the softdspBridge.

Uses the ConfigSpec.bridgeGlobalConferenceConfig. This media group can thus be used to play a message to both bridged CallParties, and record the bridge in a file.

Pre-conditions:
1. softdspBridge has been specified for this session by calling setBridge(hp.opencall.media.ccapi.BridgeSpec) with the parameter BridgeSpec.softdspBridgeSpec.

Throws:
ResourceNotAvailableException - if no more MediaGroup resources are available.

AccessControlException
BadConfigSpecException
Since:
OCMP 3.0

loopBridge

public AsyncMediaGroup loopBridge(ConfigSpec aConfigSpec)
                           throws AccessControlException,
                                  BadConfigSpecException,
                                  ResourceNotAvailableException
Creates an AsyncMediaGroup and connects it to the softdspBridge.

The ConfigSpec iused must include ResourceSpec.basicConference. This media group can thus be used perform global media action on both bridged CallParties.

Pre-conditions:
1. softdspBridge has been specified for this session by calling setBridge(hp.opencall.media.ccapi.BridgeSpec) with the parameter BridgeSpec.softdspBridgeSpec.

Throws:
ResourceNotAvailableException - if no more MediaGroup resources are available.

AccessControlException
BadConfigSpecException
Since:
OCMP 3.0

bridge

public void bridge(CP aCP1)
            throws AccessControlException
Attaches a CallParty to a bridge.

Pre-conditions:
1. A bridge must have been setup (call to setBridge()).
2. There must remain space on the bridge to connect the CallParty.
3. The CallParty's streamFormat must be supported by the bridge.
4. The CallParty must be in the OPENED state.

Post-conditions:
1. For tdmBridgeSpec : The CallParty goes to the BRIDGING state and eventually BRIDGED. It is possible it is already in the BRIDGED state when the call returns. For softdspBridgeSpec : The CallParty goes to the LOOPING state and eventually LOOPED. It is possible it is already in the LOOPED state when the call returns.

Throws:
InvalidCPStateException - if the CallParty is not in the proper state.
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

bridge

public void bridge(CP aCP1,
                   BridgeDir bDir)
            throws AccessControlException
FOR FUTURE USE

Throws:
AccessControlException
Since:
Not supported

bridge

public AsyncMediaGroup bridge(CP aCP,
                              ConfigSpec aSpec)
                       throws AccessControlException,
                              BadConfigSpecException
Attaches a MediaGroup to the CallParty and bridges the CallParty.

This creates a MediaGroup and an associated media group leg. The source side of the CallParty's trunk leg is branched to the sink side of the media group leg. The so arranged CallParty is attached to a bridge.

Note that for BridgeSpec.tdmBridgeSpec : only the sink side of the media group leg is attached to the CallParty. This means the so created MediaGroup can only be used to record messages or detect DTMF's received from the CallParty. This cannot be used to play messages or generate signals.

Note that for BridgeSpec.softdspBridgeSpec: Only the MediaGroup defined by ConfigSpec.bridgeCPConfigSpec can be used for the ConfigSpec parameter .

Pre-conditions:
1. A bridge must have been setup (call to setBridge()).
2. There must remain space on the bridge to connect the CallParty.
3. The CallParty's streamFormat must be supported by the bridge.
4. The CallParty must be in the OPENED state.
5. Enough MediaProcessing resources must be available so that a MediaGroup can be allocated.

Post-conditions:
1. For tdmBridgeSpec : The CallParty goes to the BRIDGING state and eventually BRIDGED. It is possible it is already in the BRIDGED state when the call returns. For softdspBridgeSpec : The CallParty goes to the LOOPING state and eventually LOOPED. It is possible it is already in the LOOPED state when the call returns.

Returns:
the associated AsyncMediaGroup object.

Throws:
ResourceNotAvailableException - if no more MediaGroup resources are available.
InvalidCPStateException - if the CallParty is not in the proper state.
BadThreadException - if the method is not called on the proper User Thread.

AccessControlException
BadConfigSpecException

bridge

public AsyncMediaGroup bridge(CP aCP,
                              BridgeDir bDir,
                              ConfigSpec aSpec,
                              MediaGroupDir mgDir)
                       throws AccessControlException,
                              BadConfigSpecException
Throws:
AccessControlException
BadConfigSpecException
Since:
Not supported

register

public ConferenceIF register(CP aCP,
                             ConferenceSpec acSpec)
                      throws AccessControlException
Registers a CP to a conference

Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)

Throws:
ResourceNotAvailableException - if CP cannot be registered to conference.
AccessControlException - if conference cannot be created
BadThreadException - if the method is not called on the proper User Thread.

Since:
OCMP 2.2

register

public ConferenceIF register(CP aCP,
                             ConferenceSpec acSpec,
                             ConferenceListener aconfListener)
                      throws AccessControlException
Registers a CP to a conference and adds a ConferenceListener on this conference

Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)

Throws:
ResourceNotAvailableException - if CP cannot be registered to it.
AccessControlException - if conference cannot be created
BadThreadException - if the method is not called on the proper User Thread.

Since:
OCMP 2.2

register

public ConferenceIF register(CP aCP,
                             ConferenceSpec acSpec,
                             Class aclass)
                      throws AccessControlException
Registers a CP to a conference of type class

Creates an extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)

Pre-conditions:
1. The ConferenceSession class must have been loaded with the service

Post-conditions:
1. A Class instance is created and method newConferenceSession() is called by the framework on a conference User Thread 2. A proxy is created on ConferenceSession with ConferenceIF interface. It allows to call ConferenceIF methods (which usually must be called from a Conference User Thread) from any thread. 3. This proxy is given back through ConferenceIF. It acts as the handler on the conference.

Throws:
ResourceNotAvailableException - if CP cannot be registered to it.
BadThreadException - if the method is not called on the proper User Thread.
CCBadParamsException - if the given Class is not a class or an extended class of ConferenceSession.
AccessControlException - if conference cannot be created or if a conference with the same conferenceSpec already exists but is not an instance of Class.

Since:
OCMP 2.2

register

public ConferenceIF register(CP aCP,
                             ConferenceSpec acSpec,
                             Class aclass,
                             ConferenceListener aconfListener)
                      throws AccessControlException
Registers a CP to a conference of type Class and adds a ConferenceListener on this conference

Creates a extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)

Pre-conditions:
1. The ConferenceSession class must have been loaded with the service

Post-conditions:
1. A Class instance is created and method newConferenceSession() is called by the framework on a conference User Thread 2. A proxy is created on ConferenceSession with ConferenceIF interface. It allows to call ConferenceIF methods (which usually must be called from a Conference User Thread) from any thread. 3. This proxy is given back through ConferenceIF. It acts as the handler on the conference.

Throws:
ResourceNotAvailableException - if CP cannot be registered to it.
BadThreadException - if the method is not called on the proper User Thread.
CCBadParamsException - if the given Class is not a class or an extended class of ConferenceSession
AccessControlException - if conference cannot be created or if a conference with the same conferenceSpec already exists but is not an instance of Class.

Since:
OCMP 2.2

unregister

public void unregister(CP aCP,
                       ConferenceIF aconfIF)
                throws AccessControlException
Unregisters a CP from a conference

* Pre-conditions:
1. The CP must have been registered to this conference

Post-conditions:

Throws:
CCBadParamsException - if the CP has never been registered to this conference
BadThreadException - if the method is not called on the proper User Thread.

AccessControlException
Since:
OCMP 2.2

getProxy

public Object getProxy(Class aClass)
                throws CCBadParamsException
Creates a proxy instance on which users methods can be called from external threads.

The proxy must be created with one interface implemented by the oclet. It gives back a Object. A cast in the interface class is needed to call one of the interface method.

Pre-conditions:
1. The oclet must implement the interface given in parameter
Post-conditions:

Returns:
an Object. A cast is needed to call a method belonging to an interface.
Throws:
CCBadParamsException - if the interface is not implemented by the oclet

Since:
OCMP 2.2

getProxy

public Object getProxy(Class[] aInterTab)
                throws CCBadParamsException
Creates a proxy instance on which users methods can be called from external threads.

The proxy must be created with a list of user interfaces implemented by the oclet. It gives back a Object. A cast in the interface class is needed to call an interface method.

Pre-conditions:
1. The oclet must implement the interfaces given in parameter
Post-conditions:

Returns:
an Object. A cast is needed to call a method belonging to an interface.
Throws:
CCBadParamsException - if one of the given interfaces is not implemented by the oclet

Since:
OCMP 2.2

disconnect

public void disconnect(CP aCP)
                throws AccessControlException
t Disconnects a CallParty that was either bridged or looped.It remains registered to conferences.

All but the CallParty's trunk leg are released. This means that if the CallParty was bridged, with or without a media group, it is detached from the bridge. If the CallParty was bridged with a media group, or looped with a media group, the media group object with its media group leg is discarded.The CallParty remains registered to conferences.

The CallParty object goes back to the OPENED state.

Throws:
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

releaseCP

public void releaseCP(CP aCP)
               throws AccessControlException
Releases a CallParty.

The call associated with the CallParty is released. The CallParty cannot be used anymore, any method call referencing this CallParty will throw a ResourceReleasedException.

Parameters:
aCP - is one of the active CallParties of the CCSession.

Throws:
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

release

public void release()
Terminates the session

The session and all its associated resources, like CallParties, are released. The Calls associated with the CallParties are released.
Any further reference to this session object will throw ResourceReleasedException.


sleep

public void sleep()
           throws AccessControlException,
                  InterruptedException
Causes the session to sleep.

This causes the session to sleep until it is woken up by a call to interrupt() or until the session is terminated by a call to release().

NOTE: Use this method instead of Thread.sleep(). This is because a session runs in platform User Threads. When this method is invoked, the session sleeps, but the User Thread the session was running in is re-used by the platform for other applications.
If Thread.sleep was used, it would cause the session AND its User Thread to sleep and this thread could not be re-used by the platform.

Throws:
InterruptedException - when the CCSession's interrupt method is invoked.
CCAccessException - when CCSession is released.
BadThreadException - if the method is not called on the proper User Thread.
AccessControlException

sleep

public void sleep(long milliseconds)
           throws AccessControlException,
                  InterruptedException
Causes the session to sleep for the specified number of ms.

This causes the session to sleep for the specified number of milliseconds or until the session is terminated by a call to release().

NOTE: Use this method instead of Thread.sleep(). This is because a session runs in platform User Threads. When this method is invoked, the session sleeps, but the User Thread the session was running in is re-used by the platform for other applications.
If Thread.sleep was used, it would cause the session AND its User Thread to sleep and this thread could not be re-used by the platform.

Parameters:
milliseconds - The time to sleep.

Throws:
InterruptedException - when the CCSession's interrupt method is invoked.
CCAccessException - when CCSession is released.
BadThreadException - if the method is not called on the proper User Thread.
CCBadParamsException - if milliseconds is < 0.
AccessControlException

interrupt

public void interrupt()
Wakes up the session.


setBridge

public void setBridge(BridgeSpec aBridgeSpec)
               throws AccessControlException
Allocates a bridge to connect CallParty's together.

The Bridge can be a TDM bridge or a SoftDSP bridge, as specified by BridgeSpec.

Throws:
AccessControlException - if it cannot satisfy the BridgeSpec timeslots.

newCCSession

public abstract void newCCSession()
Called by the platform at session/oclet startup.

This form of the method is used when an oclet is started by direct invocation from the management system or when the oclet is instanciated by createNewService() method

Since:
OCMP 2.2

newCCSession

public void newCCSession(Object anObject)
Called by the platform at session/oclet creation with method createNewServiceSession(Name aNem, Object anObject)

Since:
OCMP 2.2

newCCSession

public abstract void newCCSession(CP aCP)
Called by the platform at session/oclet startup on incoming call.

This form of the method is used when an incoming call whose called address matches one of the addresses which have been configured for this oclet.
When the platform initializes the session for this oclet, it creates a CallParty object with a trunk leg which corresponds to the incoming call.
This CallParty object is passed as a parameter.

Parameters:
aCP - The CallParty that has been created in the session for the incoming call.

Since:
OCMP 2.2

sessionStateUpdate

public abstract void sessionStateUpdate(int aNewState)
Indicates a Session state change.

Called by the framework to inform of a CCSession state change.

Parameters:
aNewState - The new session state. It can be Active, Idle or Released.

callPartyStateChange

public abstract void callPartyStateChange(CP aCP,
                                          int aNewCPState)
Indicates a CallParty state change.

Called by the framework to inform of a callParty state change.

Parameters:
aCP - The Call Party subject to the change.
aNewCPState - The new Call Party state. It can be Bridged, Bridging, Idle, Looped, Looping, Opened or Released.

addExternalEventListener

public void addExternalEventListener(ExternalEventListener listener)
                              throws TooManyListenersException
Description copied from interface: ExternalEventScheduler
Adds the specified listener to receive external events.

External events are generic events of type EventObject. They can be generated from Application Threads, that is any thread which is not a platform User Thread. For example a timer handler.

A listener object implementing the ExternalEventListener interface must be created in the application to receive external events through onExternalEvent. See Thread Management section in CCSession for more details.

NOTE: Only one listener is currently allowed.

Specified by:
addExternalEventListener in interface ExternalEventScheduler
Parameters:
listener - The listener object.
Throws:
TooManyListenersException

removeExternalEventListener

public void removeExternalEventListener(ExternalEventListener listener)
Description copied from interface: ExternalEventScheduler
Removes the specified listener so it no longer receives external events.

Specified by:
removeExternalEventListener in interface ExternalEventScheduler
Parameters:
listener - The listener object.

notifyExternalEvent

public final void notifyExternalEvent(EventObject event)
Description copied from interface: ExternalEventScheduler
Notifies an external event to the session/oclet.

This method must be used whenever an external event, such as a timer, has to be processed by the application. An external event is a generic event generated from any thread, i.e. a thread that has been explicetely or implicitely created by the application and which is not a platform User Thread.

The main purpose of this method is to ensure appropriate platform synchronization for processing external events. It will cause a previously registered listener (registered by addExternalEventListener) to receive the event through invocation of onExternalEvent (see ExternalEventListener) in a platform User Thread. Since onExternalEvent is invoked in a User Thread, any Call-control API method can be called then.

Specified by:
notifyExternalEvent in interface ExternalEventScheduler
Parameters:
event - The external event that must be passed in the call to onExternalEvent.

createNewServiceSession

public static final CCSession createNewServiceSession(String serviceName,
                                                      Object newCCSessionParam)
Creates an empty Service Session with no CallParty attached.

This method can be called from any Application Thread to trigger the creation of a new CCSession.

Once the session has been created and initialized by the platform

Parameters:
newCCSessionParam - a service specific parameter to pass to the new session when newCCSession(Object) is called
Returns:
a CCSession object. null if : the serviceName passed is not a configured service, service classes cannot be found, or the platform is overloaded (calls rejected, as well as CCSession creation).
Since:
OCMP 2.2
See Also:


createNewServiceSession

public static final CCSession createNewServiceSession(String serviceName)
Creates an empty Service Session with no CallParty attached.

This method can be called by any thread to trigger the creation of a CCSession for a given service.

This allows creation of service instances doing only outgoing calls

Parameters:
serviceName - a service specific parameter to pass to the new session when newCCSession(Object) is called
Returns:
a CCSession object. null if : the serviceName passed is not a configured service, service classes cannot be found, or the platform is overloaded (calls rejected, as well as CCSession creation).
Since:
OCMP 2.2
See Also:


start

public static void start()
Excecuted at service start

This method may be overwrited by the user to execute service level operation at start of the service.

Since:
OCMP 2.2

stop

public static void stop()
Excecuted at service stop

This method may be overwrited by the user to execute service level operation at stop of the service

Since:
OCMP 2.2

destroyed

public void destroyed()
Excecuted at session end

This method may be overwrited by the user to get the session ends and to access to private user CCSession data but cannot be used to execute any ccapi session operation.

As this method execution uses a single resource shared with CCSession creation mechanism, its body should stay light and restore the resource quickly.

Since:
OCMP 2.4 C2

serviceControlsBackwardAck

public static boolean serviceControlsBackwardAck()
Excecuted at service startup

This method may be overwrited by the user to modify the way backward ack is controlled. This method is called only one time at service startup.

Since:
OCMP 2.3

getAndResetMaxLoopCPDuration

public static int getAndResetMaxLoopCPDuration()