[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "transfer" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Oct 11 14:53:07 CDT 2010
branch "transfer" has been created
at dd9f77f76241bdb6b7800b84722444421cddaf85 (commit)
- Log -----------------------------------------------------------------
commit dd9f77f76241bdb6b7800b84722444421cddaf85
Author: Ken Hunt <ken.hunt at digium.com>
Date: Mon Oct 11 14:51:00 2010 -0500
Modifications for call transfer. Adds Bridge operations to Session. Adds
SessionRouterEvents interface.
diff --git a/SessionCommunications/Bridging/BridgingIf.ice b/SessionCommunications/Bridging/BridgingIf.ice
deleted file mode 100644
index 768286d..0000000
--- a/SessionCommunications/Bridging/BridgingIf.ice
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-* Asterisk Scalable Communications Framework
-*
-* Copyright (C) 2010 -- Digium, Inc.
-*
-* All rights reserved.
-*/
-
-#pragma once
-
-#include <Core/Endpoint/EndpointIf.ice>
-#include <System/Component/ComponentServiceIf.ice>
-#include <SessionCommunications/SessionCommunicationsIf.ice>
-
-module AsteriskSCF
-{
-module SessionCommunications
-{
-module Bridging
-{
-["suppress"]
-module V1
-{
- //
- // TODO Exceptions?
- //
- const string Version = "V1";
-
- /**
- * Category used for the bridge service.
- */
- const string BridgeServiceDiscoveryCategory = "BridgeService";
-
- /**
- * The bridge throws an InvalidSessions exception if any of the sessions
- * passed as an argument to addSessions or removeSessions are invalid (e.g. nil)
- * It contains a vector of index values that can be used by the caller to
- * isolate the "bad" values.
- */
- exception InvalidSessions
- {
- Ice::LongSeq indexes;
- };
-
- interface BridgeListener;
-
- /**
- * Bridge object manages the association of multiple sessions in the process
- * of communicating with each other.
- */
- interface Bridge
- {
- /**
- * Add a sequence of session proxies to the bridge. Sessions are started
- * if necessary.
- *
- * @param session A sequence of session proxies.
- *
- * @throws InvalidSessions if any of the provided sessions are invalid.
- *
- * @see Session
- * @see InvalidSessions
- *
- */
- void addSessions(V1::SessionSeq session)
- throws InvalidSessions;
-
- /**
- * Abruptly destroy the bridge. Sessions will not be stopped.
- */
- void destroy();
-
- /**
- * List the sessions currently on the bridge.
- *
- * @return a sequence of session proxies participating in the bridge.
- *
- */
- V1::SessionSeq listSessions();
-
- /**
- * Removes one or more sessions from the bridge. Sessions are not stopped
- * as they are removed.
- *
- * @param sessions A sequence of session proxies.
- *
- * @throws InvalidSessions if any of the provided sessions are invalid.
- *
- * @see Session
- * @see InvalidSessions
- *
- */
- void removeSessions(V1::SessionSeq sessions)
- throws InvalidSessions;
-
- /**
- * Nicely shutdown the bridge. Participating sessions are disconnected.
- */
- void shutdown();
-
- /**
- * Adds a listener object to the bridge. The listener will receive notification
- * of future changes to the bridge as they occur.
- *
- * @param listener A reference to a BridgeListener object.
- *
- * @see BridgeListener
- */
- void addListener(BridgeListener* listener);
-
- /**
- * Removes a listener object from the bridge. The listen will cease receiving
- * notifications of changes to the bridge.
- *
- * @param listener A reference to the listener object to be removed.
- *
- * @see BridgeListener
- *
- */
- void removeListener(BridgeListener* listener);
-
- /**
- * Replaces a session that is on the bridge with another session. Useful for transfers, etc.
- * where a participant is replaced as part of the code flow.
- *
- * @param newSession The session replacing the session indicated by oldSession
- * @param oldSession The session being replaced.
- */
- void replaceSession(V1::Session* newSession, V1::Session* oldSession);
- };
-
- /**
- * Instances of BridgeListener are used for monitoring changes in one or
- * more bridges. Bridge objects have an addListener method that allows
- * BridgeListeners objects to be registered with the bridge. The Bridge
- * object then calls the BridgeListener methods to notify listeners of
- * changes as they occur.
- */
- interface BridgeListener
- {
- /**
- * Called when sessions have been added to a bridge.
- *
- * @param sessionBridge The bridge object the sessions were added to.
- *
- * @param sessions A sequence of session proxies that were added to the bridge.
- *
- */
- void sessionsAdded(Bridge* sessionBridge, V1::SessionSeq sessions);
-
- /**
- * Called when sessions have been removed from a bridge.
- *
- * @param sessionBridge The bridge object the sessions were removed from.
- *
- * @param sessions A sequence of session proxies that were removed from
- * the bridge.
- *
- */
- void sessionsRemoved(Bridge* sessionBridge, V1::SessionSeq sessions);
-
- /**
- * Called when a bridge has completed shutdown/destruction.
- *
- * @param sessionBridge The bridge that was stopped.
- *
- */
- void stopped(Bridge* sessionBridge);
-
- /**
- * Called when a bridge has started shutdown/destruction operations.
- *
- * @param sessionBrdige The bridge that is stopping.
- *
- */
- void stopping(Bridge* sessionBridge);
- };
-
- interface BridgeManagerListener;
-
- sequence<Bridge*> BridgeSeq;
-
- /**
- * Instances of BridgeManager allow for the creation and management of bridges.
- */
- interface BridgeManager
- {
- void addListener(BridgeManagerListener* listener);
- Bridge* createBridge(V1::SessionSeq sessions, BridgeListener* listener);
- void removeListener(BridgeManagerListener* listener);
- BridgeSeq listBridges();
- void shutdown();
- };
-
- interface BridgeManagerListener
- {
- void bridgeCreated(BridgeManager* manager, Bridge* newBridge);
- void stopped(BridgeManager* manager);
- void stopping(BridgeManager* manager);
- };
-};
-};
-};
-};
diff --git a/SessionCommunications/Bridging/CMakeLists.txt b/SessionCommunications/Bridging/CMakeLists.txt
deleted file mode 100644
index b85b86e..0000000
--- a/SessionCommunications/Bridging/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# Compile Session Oriented Bridging APIs
-hydra_compile_slice(BridgingIf.ice lib "Session Oriented Bridging API" Bridging)
diff --git a/SessionCommunications/CMakeLists.txt b/SessionCommunications/CMakeLists.txt
index 81bc279..de80e52 100644
--- a/SessionCommunications/CMakeLists.txt
+++ b/SessionCommunications/CMakeLists.txt
@@ -1,4 +1,2 @@
# Compile Session Oriented APIs
hydra_compile_slice(SessionCommunicationsIf.ice lib "Session Oriented Communications API" SessionCommunications)
-
-add_subdirectory(Bridging)
diff --git a/SessionCommunications/SessionCommunicationsIf.ice b/SessionCommunications/SessionCommunicationsIf.ice
index fd0c6e0..bac9aac 100644
--- a/SessionCommunications/SessionCommunicationsIf.ice
+++ b/SessionCommunications/SessionCommunicationsIf.ice
@@ -32,6 +32,9 @@ module V1
*/
interface Session;
interface SessionEndpoint;
+ interface Bridge;
+
+ sequence <Session*> SessionSeq;
/**
* Basic response code value encapsulation.
@@ -165,6 +168,10 @@ module V1
void unheld(Session* source);
};
+ exception NotBridged
+ {
+ };
+
/**
* A Session object encapsulates a session oriented dialogue with a peer
* agent. Registered SessionListener objects are notified of responses from
@@ -274,11 +281,26 @@ module V1
* Send a request to a connected endpoint to remove a "hold".
*/
void unhold();
+
+ /**
+ * Gets the bridge object this Session is associated with.
+ */
+ Bridge* getBridge() throws NotBridged;
+
+ /**
+ * Set the Bridge for this session.
+ * @param bridge The Bridge object this Session should be associated with.
+ * @param listener Listener to add to the Session.
+ */
+ void setBridge(Bridge* newBridge, SessionListener* listener);
+
+ /**
+ * Removes this Session from it's associated Bridge.
+ * @param listener Removes the specified listener from the Session.
+ */
+ void removeBridge(SessionListener* listener) throws NotBridged;
};
- sequence <Session*> SessionSeq;
-
-
exception EndpointUnreachableException
{
string destination;
@@ -328,6 +350,37 @@ module V1
throws AsteriskSCF::Core::Routing::V1::DestinationNotFoundException,
EndpointUnreachableException, SessionCreationException,
SourceTerminatedPreBridgingException, BridgingException ;
+
+ /**
+ * Attempts to replace one session in a Bridge with a new
+ * destination identified by the destination param. Routing is performed
+ * on the specified destination.
+ *
+ * @param sessionToReplace The session that is to be replaced in the
+ * bridge. The bridge obejct is obtained from the accessor on this
+ * proxy.
+ * @param destination The identifier for the destination.
+ */
+ void replaceSessionWithDestination(Session* sessionToReplace, string destination)
+ throws AsteriskSCF::Core::Routing::V1::DestinationNotFoundException,
+ EndpointUnreachableException, SessionCreationException,
+ SourceTerminatedPreBridgingException, BridgingException ;
+
+ /**
+ * Attempts to replace one session in a Bridge with an existing session.
+ * No routing is actually performed. (This operation exists here for consistency,
+ * since replaceSessionWithDestination(...) is implemented by this interface.
+ *
+ * @param sessionToReplace The session that is to be replaced in the
+ * bridge. The bridge obejct is obtained from the accessor on this
+ * proxy.
+ * @param newSession The session to be added to the brige. If this
+ * session is already part of another bridge, it will be removed from
+ * it's current bridge before being added.
+ */
+ void replaceSessionWithSession(Session* sessionToReplace, Session* newSession)
+ throws EndpointUnreachableException, SessionCreationException,
+ SourceTerminatedPreBridgingException, BridgingException ;
};
/**
@@ -358,6 +411,227 @@ module V1
*/
SessionSeq getSessions();
};
+
+ /**
+ * Category used for the bridge service.
+ */
+ const string BridgeServiceDiscoveryCategory = "BridgeService";
+
+ /**
+ * The bridge throws an InvalidSessions exception if any of the sessions
+ * passed as an argument to addSessions or removeSessions are invalid (e.g. nil)
+ * It contains a vector of index values that can be used by the caller to
+ * isolate the "bad" values.
+ */
+ exception InvalidSessions
+ {
+ Ice::LongSeq indexes;
+ };
+
+ interface BridgeListener;
+
+ /**
+ * Bridge object manages the association of multiple sessions in the process
+ * of communicating with each other.
+ */
+ interface Bridge
+ {
+ /**
+ * Add a sequence of session proxies to the bridge. Sessions are started
+ * if necessary.
+ *
+ * @param session A sequence of session proxies.
+ *
+ * @throws InvalidSessions if any of the provided sessions are invalid.
+ *
+ * @see Session
+ * @see InvalidSessions
+ *
+ */
+ void addSessions(SessionSeq session)
+ throws InvalidSessions;
+
+ /**
+ * Abruptly destroy the bridge. Sessions will not be stopped.
+ */
+ void destroy();
+
+ /**
+ * List the sessions currently on the bridge.
+ *
+ * @return a sequence of session proxies participating in the bridge.
+ *
+ */
+ SessionSeq listSessions();
+
+ /**
+ * Removes one or more sessions from the bridge. Sessions are not stopped
+ * as they are removed.
+ *
+ * @param sessions A sequence of session proxies.
+ *
+ * @throws InvalidSessions if any of the provided sessions are invalid.
+ *
+ * @see Session
+ * @see InvalidSessions
+ *
+ */
+ void removeSessions(SessionSeq sessions)
+ throws InvalidSessions;
+
+ /**
+ * Nicely shutdown the bridge. Participating sessions are disconnected.
+ */
+ void shutdown();
+
+ /**
+ * Adds a listener object to the bridge. The listener will receive notification
+ * of future changes to the bridge as they occur.
+ *
+ * @param listener A reference to a BridgeListener object.
+ *
+ * @see BridgeListener
+ */
+ void addListener(BridgeListener* listener);
+
+ /**
+ * Removes a listener object from the bridge. The listen will cease receiving
+ * notifications of changes to the bridge.
+ *
+ * @param listener A reference to the listener object to be removed.
+ *
+ * @see BridgeListener
+ *
+ */
+ void removeListener(BridgeListener* listener);
+
+ /**
+ * Replaces a session that is on the bridge with another session. Useful for transfers, etc.
+ * where a participant is replaced as part of the code flow.
+ *
+ * @param newSession The session replacing the session indicated by oldSession
+ * @param oldSession The session being replaced.
+ */
+ void replaceSession(Session* newSession, Session* oldSession);
+ };
+
+ /**
+ * Instances of BridgeListener are used for monitoring changes in one or
+ * more bridges. Bridge objects have an addListener method that allows
+ * BridgeListeners objects to be registered with the bridge. The Bridge
+ * object then calls the BridgeListener methods to notify listeners of
+ * changes as they occur.
+ */
+ interface BridgeListener
+ {
+ /**
+ * Called when sessions have been added to a bridge.
+ *
+ * @param sessionBridge The bridge object the sessions were added to.
+ *
+ * @param sessions A sequence of session proxies that were added to the bridge.
+ *
+ */
+ void sessionsAdded(Bridge* sessionBridge, SessionSeq sessions);
+
+ /**
+ * Called when sessions have been removed from a bridge.
+ *
+ * @param sessionBridge The bridge object the sessions were removed from.
+ *
+ * @param sessions A sequence of session proxies that were removed from
+ * the bridge.
+ *
+ */
+ void sessionsRemoved(Bridge* sessionBridge, SessionSeq sessions);
+
+ /**
+ * Called when a bridge has completed shutdown/destruction.
+ *
+ * @param sessionBridge The bridge that was stopped.
+ *
+ */
+ void stopped(Bridge* sessionBridge);
+
+ /**
+ * Called when a bridge has started shutdown/destruction operations.
+ *
+ * @param sessionBrdige The bridge that is stopping.
+ *
+ */
+ void stopping(Bridge* sessionBridge);
+ };
+
+ interface BridgeManagerListener;
+
+ sequence<Bridge*> BridgeSeq;
+
+ /**
+ * Instances of BridgeManager allow for the creation and management of bridges.
+ */
+ interface BridgeManager
+ {
+ void addListener(BridgeManagerListener* listener);
+ Bridge* createBridge(SessionSeq sessions, BridgeListener* listener);
+ void removeListener(BridgeManagerListener* listener);
+ BridgeSeq listBridges();
+ void shutdown();
+ };
+
+ interface BridgeManagerListener
+ {
+ void bridgeCreated(BridgeManager* manager, Bridge* newBridge);
+ void stopped(BridgeManager* manager);
+ void stopping(BridgeManager* manager);
+ };
+
+ module Event
+ {
+ const string TopicId = "::asteriskscf::session::sessionrouter::event";
+
+ enum OperationResult
+ {
+ SUCCESS,
+ FAILURE
+ };
+
+ interface SessionRouterEvents
+ {
+ /**
+ * Notice that routeSession operation was called.
+ *
+ * @param source The initiating session.
+ * @param destination The identifier for the destination.
+ * @param result Operation outcome.
+ */
+ void routeSessionEvent(Session* source, string destination, OperationResult result);
+
+ /**
+ * Notice that replaceSessionWithDestination operation was called.
+ *
+ * @param sessionToReplace The session that is to be replaced in the
+ * bridge. The bridge obejct is obtained from the accessor on this
+ * proxy.
+ * @param destination The identifier for the destination.
+ * @param result Operation outcome.
+ */
+ void replaceSessionWithDestinationEvent(Session* sessionToReplace, string destination, OperationResult result);
+
+ /**
+ * Notice that replaceSessionWithSession operation was called.
+ *
+ * @param sessionToReplace The session that is to be replaced in the
+ * bridge. The bridge obejct is obtained from the accessor on this
+ * proxy.
+ * @param newSession The session to be added to the brige. If this
+ * session is already part of another bridge, it will be removed from
+ * it's current bridge before being added.
+ * @param result Operation outcome.
+ */
+ void replaceSessionWithSessionEvent(Session* sessionToReplace, Session* newSession, OperationResult result);
+ };
+
+ }; // End of module Event
}; // End of module V1
}; // End of module SessionCommunications
-----------------------------------------------------------------------
--
asterisk-scf/integration/slice.git
More information about the asterisk-scf-commits
mailing list