[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "oneshot-hooks" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Jul 25 17:57:37 CDT 2011
branch "oneshot-hooks" has been created
at af94ee80bbe26b3dc287a156e1d856c2f09a6226 (commit)
- Log -----------------------------------------------------------------
commit af94ee80bbe26b3dc287a156e1d856c2f09a6226
Author: Mark Michelson <mmichelson at digium.com>
Date: Mon Jul 25 15:56:20 2011 -0500
Initial changes to allow for one-shot hooks from routing operations.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index 8131772..896bd22 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -29,6 +29,18 @@ module AsteriskSCF
module SessionCommunications
{
+module ExtensionPoints
+{
+
+module V1
+{
+
+ interface SessionCreationHook;
+
+}; //module V1
+
+}; //module ExtensionPoints
+
["suppress"]
module V1
{
@@ -557,7 +569,8 @@ module V1
* @throws BridgingException if the bridge could not be setup properly.
*/
["amd"]
- void routeSession(string operationId, Session* source, string destination)
+ void routeSession(string operationId, Session* source, string destination,
+ AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHook* oneShotHook)
throws AsteriskSCF::Core::Routing::V1::DestinationNotFoundException,
EndpointUnreachableException, SessionCreationException,
SourceTerminatedPreBridgingException, BridgingException ;
@@ -586,7 +599,8 @@ module V1
* @throws NotBridged if the provided session is not currently in a bridge.
*/
["amd"]
- void connectBridgedSessionsWithDestination(string operationId, Session* sessionToReplace, string destination)
+ void connectBridgedSessionsWithDestination(string operationId, Session* sessionToReplace, string destination,
+ AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHook* oneShotHook)
throws AsteriskSCF::Core::Routing::V1::DestinationNotFoundException,
SessionCreationException,
SourceTerminatedPreBridgingException, BridgingException, NotBridged ;
@@ -639,7 +653,8 @@ module V1
* @return A newly created session object for the destination.
*
*/
- Session* createSession(string destination, SessionListener* callback);
+ Session* createSession(string destination, SessionListener* callback,
+ AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHook* oneShotHook);
/**
* Returns the active sessions for this session endpoint.
commit 084e46ffda7556c95fae03bebb2043360cbbab6e
Merge: 70c5318 ba6560f
Author: Mark Michelson <mmichelson at digium.com>
Date: Thu Jul 21 10:10:40 2011 -0500
Merge branch 'master' into sip-auth-hook
commit ba6560f6ed82d3d3ba516f0edc701fc76137a4be
Merge: 0e0fe97 5f3b948
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 20 16:11:18 2011 -0500
Merge branch 'session-decorator'
commit 0e0fe974f7a7dd7334086130c66a69fe4b94fa69
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 20 14:31:40 2011 -0500
Make changes suggested by Kevin on CR-ASTSCF-115.
* decorateSession -> modifySession
* SessionDecorator -> SessionCreationHook
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 9455692..cad714b 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -32,7 +32,7 @@ module ExtensionPoints
module V1
{
- const string SessionCreationHookLocatorCategory = "SessionDecorator";
+ const string SessionCreationHookLocatorCategory = "SessionCreationHook";
class SessionCreationHookData
{
@@ -58,7 +58,7 @@ module V1
* @param[out] replacementData Modified data for the session
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
+ AsteriskSCF::System::Hook::V1::HookResult modifySession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
};
sequence<SessionCreationHook*> SessionCreationHookSeq;
commit c84291bee35dfbedfd168ba7ec05a9359f7138f2
Author: Mark Michelson <mmichelson at digium.com>
Date: Fri Jul 15 13:23:36 2011 -0500
Change the "decorator" hook to a "session creation" hook.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index c20e031..9455692 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -32,56 +32,51 @@ module ExtensionPoints
module V1
{
- const string SessionDecoratorLocatorCategory = "SessionDecorator";
+ const string SessionCreationHookLocatorCategory = "SessionDecorator";
- interface SessionDecoratorHook
+ class SessionCreationHookData
+ {
+ AsteriskSCF::SessionCommunications::V1::Session *session;
+ AsteriskSCF::SessionCommunications::V1::SessionListenerSeq listeners;
+ };
+
+ interface SessionCreationHook
{
/**
- * Decorate a Session.
+ * Hook into session creation.
*
* This method is called by a session gateway at the time a new
* session is created. The session gateway provides a proxy to the
- * session it just created. In return, this method provides a proxy
- * (presumably) to a decorator.
- *
- * The session gateway will store this proxy to the decorator and provide
- * it to all external entities that request a proxy to the session. This way,
- * the decorator can intercept all commands to the session, thereby allowing
- * for customization beyond what the session gateway would do on its own.
+ * session it just created. In return, this method provides information
+ * to replace or augment the original data.
*
- * In addition, the session provides to the decorator all session listeners
- * currently on the session. The decorator will store this session on itself
- * and provide in return a different listener proxy for the session to use
- * for all session listener operations.
+ * For instance, this method may replace the session proxy with a decorator
+ * session proxy so that all session methods may be hooked into. The hook may
+ * instead modify the session by adding or removing cookies.
*
- * @param realSession A proxy to the session created by the session gateway
- * @param realListeners The session listeners currently set for the session
- * @param[out] decorator The proxy to the decorator created by the hook
- * @param[out] decoratorListener The proxy to the decorator listener created by the hook
+ * @param originalData Data that the session gateway has for the session
+ * @param[out] replacementData Modified data for the session
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession,
- AsteriskSCF::SessionCommunications::V1::SessionListenerSeq realListeners,
- out AsteriskSCF::SessionCommunications::V1::Session* decorator,
- out AsteriskSCF::SessionCommunications::V1::SessionListener* decoratorListener);
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
};
- sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
+ sequence<SessionCreationHook*> SessionCreationHookSeq;
- interface SessionDecoratorExtensionPoint
+ interface SessionCreationExtensionPoint
{
/**
* Add a new session decorator hook
*/
- void addDecorator(SessionDecoratorHook* hook);
+ void addSessionCreationHook(SessionCreationHook* hook);
/**
* Remove a session decorator hook
*/
- void removeDecorator(SessionDecoratorHook* hook);
+ void removeSessionCreationHook(SessionCreationHook* hook);
/**
* Remove all session decorator hooks
*/
- void clearDecorators();
+ void clearSessionCreationHooks();
};
}; /* End of module V1 */
commit 4141894df15013891636c53d85259b2990b1f9df
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Jul 12 17:53:58 2011 -0500
Make adjustments suggested by Kevin on CR-ASTSCF-115.
Add a listener sequence and listener output paramater to the hook.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 2b88216..c20e031 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -49,11 +49,21 @@ module V1
* the decorator can intercept all commands to the session, thereby allowing
* for customization beyond what the session gateway would do on its own.
*
+ * In addition, the session provides to the decorator all session listeners
+ * currently on the session. The decorator will store this session on itself
+ * and provide in return a different listener proxy for the session to use
+ * for all session listener operations.
+ *
* @param realSession A proxy to the session created by the session gateway
+ * @param realListeners The session listeners currently set for the session
* @param[out] decorator The proxy to the decorator created by the hook
+ * @param[out] decoratorListener The proxy to the decorator listener created by the hook
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession,
+ AsteriskSCF::SessionCommunications::V1::SessionListenerSeq realListeners,
+ out AsteriskSCF::SessionCommunications::V1::Session* decorator,
+ out AsteriskSCF::SessionCommunications::V1::SessionListener* decoratorListener);
};
sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index 3ad3bc3..8131772 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -308,6 +308,8 @@ module V1
void indicated(Session* source, Indication event, SessionCookies cookies);
};
+ sequence<SessionListener*> SessionListenerSeq;
+
/**
* Exception used to indicate that a session is not currently in any bridge.
*/
commit 3106bf50bdeb121c64f91629a0a0d97e8f2b5178
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 6 14:04:14 2011 -0500
Add documentation for session decorator as suggested in CR-ASTSCF-115.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 6fccbde..2b88216 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -1,7 +1,7 @@
/*
* Asterisk SCF -- An open-source communications framework.
*
- * Copyright (C) 2010, Digium, Inc.
+ * Copyright (C) 2011, Digium, Inc.
*
* See http://www.asterisk.org for more information about
* the Asterisk SCF project. Please do not directly contact
@@ -36,6 +36,23 @@ module V1
interface SessionDecoratorHook
{
+ /**
+ * Decorate a Session.
+ *
+ * This method is called by a session gateway at the time a new
+ * session is created. The session gateway provides a proxy to the
+ * session it just created. In return, this method provides a proxy
+ * (presumably) to a decorator.
+ *
+ * The session gateway will store this proxy to the decorator and provide
+ * it to all external entities that request a proxy to the session. This way,
+ * the decorator can intercept all commands to the session, thereby allowing
+ * for customization beyond what the session gateway would do on its own.
+ *
+ * @param realSession A proxy to the session created by the session gateway
+ * @param[out] decorator The proxy to the decorator created by the hook
+ * @return A HookResult indicating whether the hook was successful
+ */
AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
};
@@ -43,8 +60,17 @@ module V1
interface SessionDecoratorExtensionPoint
{
+ /**
+ * Add a new session decorator hook
+ */
void addDecorator(SessionDecoratorHook* hook);
+ /**
+ * Remove a session decorator hook
+ */
void removeDecorator(SessionDecoratorHook* hook);
+ /**
+ * Remove all session decorator hooks
+ */
void clearDecorators();
};
commit f7cf79616da10d9a930bde78671c374746d85f00
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Jun 28 17:59:16 2011 -0500
Add slice for session decorators.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
new file mode 100644
index 0000000..6fccbde
--- /dev/null
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -0,0 +1,54 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice>
+#include <AsteriskSCF/System/Hook/HookIf.ice>
+
+module AsteriskSCF
+{
+
+module SessionCommunications
+{
+
+module ExtensionPoints
+{
+
+["suppress"]
+module V1
+{
+
+ const string SessionDecoratorLocatorCategory = "SessionDecorator";
+
+ interface SessionDecoratorHook
+ {
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
+ };
+
+ sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
+
+ interface SessionDecoratorExtensionPoint
+ {
+ void addDecorator(SessionDecoratorHook* hook);
+ void removeDecorator(SessionDecoratorHook* hook);
+ void clearDecorators();
+ };
+
+}; /* End of module V1 */
+}; /* End of module ExtensionPoints */
+}; /* End of module SessionCommunications */
+}; /* End of module AsteriskSCF */
commit 5f3b94870308be2ea63413e2b1515efbb948ec4b
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 20 14:31:40 2011 -0500
Make changes suggested by Kevin on CR-ASTSCF-115.
* decorateSession -> modifySession
* SessionDecorator -> SessionCreationHook
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 9455692..cad714b 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -32,7 +32,7 @@ module ExtensionPoints
module V1
{
- const string SessionCreationHookLocatorCategory = "SessionDecorator";
+ const string SessionCreationHookLocatorCategory = "SessionCreationHook";
class SessionCreationHookData
{
@@ -58,7 +58,7 @@ module V1
* @param[out] replacementData Modified data for the session
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
+ AsteriskSCF::System::Hook::V1::HookResult modifySession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
};
sequence<SessionCreationHook*> SessionCreationHookSeq;
commit f1052695108533af3df3e4ff0054a60dd968598b
Author: Brent Eagles <beagles at digium.com>
Date: Thu Jul 14 20:02:29 2011 -0230
Slice changes for bridge cookie support
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index e57a7c3..8131772 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -122,7 +122,7 @@ module V1
*
* @see SessionCookies
*/
- ["preserved"] class SessionCookie
+ unsliceable class SessionCookie
{
};
@@ -697,6 +697,32 @@ module V1
};
/**
+ * Generic base class for bridge 'cookies', opaque data items that can be
+ * stored on a Bridge and retrieved via the BridgeListener
+ * interface when events occur on that Bridge.
+ *
+ * @see BridgeListener
+ *
+ * @see BridgeCookies
+ */
+ unsliceable class BridgeCookie
+ {
+ };
+
+ /**
+ * A sequence of bridge cookies, allowing for a variable number of them
+ * to be passed in a single operation or event.
+ *
+ * @see BridgeListener
+ */
+ sequence <BridgeCookie> BridgeCookies;
+
+ /**
+ * A dictionary of bridge cookies, used for storing them.
+ */
+ dictionary<string, BridgeCookie> BridgeCookieDict;
+
+ /**
* Forward declaration for the BridgeListener interface.
*/
interface BridgeListener;
@@ -791,6 +817,42 @@ module V1
["amd"]
void replaceSession(Session* sessionToReplace, SessionSeq newSessions)
throws InvalidSessions, SessionNotFound, BridgeSessionOperationFailed;
+
+ /**
+ * Set (or replace) cookies on the Bridge.
+ *
+ * @param cookies A sequence of one or more concrete objects,
+ * each of which are of a type derived from BridgeCookie. The
+ * bridge will store these cookies on the bridge, replacing any
+ * existing cookies with matching types.
+ *
+ * @note There can only be one cookie of a given type associated
+ * with a Bridge.
+ **/
+ void setCookies(BridgeCookies cookies);
+
+ /**
+ * Remove cookies from the Bridge.
+ *
+ * @param cookies A sequence of one or more concrete objects,
+ * each of which are of a type derived from BridgeCookie.
+ * The bridge will remove any cookies on the bridge
+ * with types that match the ones in this sequence; the
+ * content of the supplied cookies is not compared.
+ **/
+ void removeCookies(BridgeCookies cookies);
+
+ /**
+ * Get cookies stored on the Bridge.
+ *
+ * @param cookieTypes A sequence of zero or more concrete objects,
+ * each of which are of a type derived from BridgeCookie.
+ *
+ * @return A sequence of zero or more cookies from the bridge,
+ * with types that match the types of the template cookies
+ * provided in the cookieTypes parameter.
+ **/
+ BridgeCookies getCookies(BridgeCookies cookieTypes);
};
/**
@@ -808,8 +870,10 @@ module V1
* @param sessionBridge The bridge object the sessions were added to.
*
* @param sessions A sequence of session proxies that were added to the bridge.
+ *
+ * @param cookies A sequence of bridge cookies that are associated with the bridge.
*/
- void sessionsAdded(Bridge* sessionBridge, SessionSeq sessions);
+ void sessionsAdded(Bridge* sessionBridge, SessionSeq sessions, BridgeCookies cookies);
/**
* Called when sessions have been removed from a bridge.
@@ -818,22 +882,28 @@ module V1
*
* @param sessions A sequence of session proxies that were removed from
* the bridge.
+ *
+ * @param cookies A sequence of bridge cookies that are associated with the bridge.
*/
- void sessionsRemoved(Bridge* sessionBridge, SessionSeq sessions);
+ void sessionsRemoved(Bridge* sessionBridge, SessionSeq sessions, BridgeCookies cookies);
/**
* Called when a bridge has completed shutdown/destruction.
*
* @param sessionBridge The bridge that was stopped.
+ *
+ * @param cookies A sequence of bridge cookies that are associated with the bridge.
*/
- void stopped(Bridge* sessionBridge);
+ void stopped(Bridge* sessionBridge, BridgeCookies cookies);
/**
* Called when a bridge has started shutdown/destruction operations.
*
* @param sessionBrdige The bridge that is stopping.
+ *
+ * @param cookies A sequence of bridge cookies that are associated with the bridge.
*/
- void stopping(Bridge* sessionBridge);
+ void stopping(Bridge* sessionBridge, BridgeCookies cookies);
};
/**
commit 57ab22659d7829b6b4ef6c4e966beab848273282
Author: Mark Michelson <mmichelson at digium.com>
Date: Fri Jul 15 13:23:36 2011 -0500
Change the "decorator" hook to a "session creation" hook.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index c20e031..9455692 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -32,56 +32,51 @@ module ExtensionPoints
module V1
{
- const string SessionDecoratorLocatorCategory = "SessionDecorator";
+ const string SessionCreationHookLocatorCategory = "SessionDecorator";
- interface SessionDecoratorHook
+ class SessionCreationHookData
+ {
+ AsteriskSCF::SessionCommunications::V1::Session *session;
+ AsteriskSCF::SessionCommunications::V1::SessionListenerSeq listeners;
+ };
+
+ interface SessionCreationHook
{
/**
- * Decorate a Session.
+ * Hook into session creation.
*
* This method is called by a session gateway at the time a new
* session is created. The session gateway provides a proxy to the
- * session it just created. In return, this method provides a proxy
- * (presumably) to a decorator.
- *
- * The session gateway will store this proxy to the decorator and provide
- * it to all external entities that request a proxy to the session. This way,
- * the decorator can intercept all commands to the session, thereby allowing
- * for customization beyond what the session gateway would do on its own.
+ * session it just created. In return, this method provides information
+ * to replace or augment the original data.
*
- * In addition, the session provides to the decorator all session listeners
- * currently on the session. The decorator will store this session on itself
- * and provide in return a different listener proxy for the session to use
- * for all session listener operations.
+ * For instance, this method may replace the session proxy with a decorator
+ * session proxy so that all session methods may be hooked into. The hook may
+ * instead modify the session by adding or removing cookies.
*
- * @param realSession A proxy to the session created by the session gateway
- * @param realListeners The session listeners currently set for the session
- * @param[out] decorator The proxy to the decorator created by the hook
- * @param[out] decoratorListener The proxy to the decorator listener created by the hook
+ * @param originalData Data that the session gateway has for the session
+ * @param[out] replacementData Modified data for the session
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession,
- AsteriskSCF::SessionCommunications::V1::SessionListenerSeq realListeners,
- out AsteriskSCF::SessionCommunications::V1::Session* decorator,
- out AsteriskSCF::SessionCommunications::V1::SessionListener* decoratorListener);
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(SessionCreationHookData originalData, out SessionCreationHookData replacementData);
};
- sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
+ sequence<SessionCreationHook*> SessionCreationHookSeq;
- interface SessionDecoratorExtensionPoint
+ interface SessionCreationExtensionPoint
{
/**
* Add a new session decorator hook
*/
- void addDecorator(SessionDecoratorHook* hook);
+ void addSessionCreationHook(SessionCreationHook* hook);
/**
* Remove a session decorator hook
*/
- void removeDecorator(SessionDecoratorHook* hook);
+ void removeSessionCreationHook(SessionCreationHook* hook);
/**
* Remove all session decorator hooks
*/
- void clearDecorators();
+ void clearSessionCreationHooks();
};
}; /* End of module V1 */
commit 0826cb24a021ca60e1026932a14f7dbd6a55da09
Merge: 2961fe4 1672cd3
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 13 11:09:41 2011 -0500
Merge branch 'master' into session-decorator
commit 2961fe4437f85e17d62cecf3cd207ad01d5a4ceb
Merge: 7e8760d 3a25fc4
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Jul 12 17:54:44 2011 -0500
Merge branch 'master' into session-decorator
commit 7e8760dd3d7de497fedadf3589c3debd03d35d9d
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Jul 12 17:53:58 2011 -0500
Make adjustments suggested by Kevin on CR-ASTSCF-115.
Add a listener sequence and listener output paramater to the hook.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 2b88216..c20e031 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -49,11 +49,21 @@ module V1
* the decorator can intercept all commands to the session, thereby allowing
* for customization beyond what the session gateway would do on its own.
*
+ * In addition, the session provides to the decorator all session listeners
+ * currently on the session. The decorator will store this session on itself
+ * and provide in return a different listener proxy for the session to use
+ * for all session listener operations.
+ *
* @param realSession A proxy to the session created by the session gateway
+ * @param realListeners The session listeners currently set for the session
* @param[out] decorator The proxy to the decorator created by the hook
+ * @param[out] decoratorListener The proxy to the decorator listener created by the hook
* @return A HookResult indicating whether the hook was successful
*/
- AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession,
+ AsteriskSCF::SessionCommunications::V1::SessionListenerSeq realListeners,
+ out AsteriskSCF::SessionCommunications::V1::Session* decorator,
+ out AsteriskSCF::SessionCommunications::V1::SessionListener* decoratorListener);
};
sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
index 7edc171..467a0c4 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice
@@ -308,6 +308,8 @@ module V1
void indicated(Session* source, Indication event, SessionCookies cookies);
};
+ sequence<SessionListener*> SessionListenerSeq;
+
/**
* Exception used to indicate that a session is not currently in any bridge.
*/
commit 3e3468a598e3dae4fd3047bc95b83d411432e6ca
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 6 14:04:14 2011 -0500
Add documentation for session decorator as suggested in CR-ASTSCF-115.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index 6fccbde..2b88216 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -1,7 +1,7 @@
/*
* Asterisk SCF -- An open-source communications framework.
*
- * Copyright (C) 2010, Digium, Inc.
+ * Copyright (C) 2011, Digium, Inc.
*
* See http://www.asterisk.org for more information about
* the Asterisk SCF project. Please do not directly contact
@@ -36,6 +36,23 @@ module V1
interface SessionDecoratorHook
{
+ /**
+ * Decorate a Session.
+ *
+ * This method is called by a session gateway at the time a new
+ * session is created. The session gateway provides a proxy to the
+ * session it just created. In return, this method provides a proxy
+ * (presumably) to a decorator.
+ *
+ * The session gateway will store this proxy to the decorator and provide
+ * it to all external entities that request a proxy to the session. This way,
+ * the decorator can intercept all commands to the session, thereby allowing
+ * for customization beyond what the session gateway would do on its own.
+ *
+ * @param realSession A proxy to the session created by the session gateway
+ * @param[out] decorator The proxy to the decorator created by the hook
+ * @return A HookResult indicating whether the hook was successful
+ */
AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
};
@@ -43,8 +60,17 @@ module V1
interface SessionDecoratorExtensionPoint
{
+ /**
+ * Add a new session decorator hook
+ */
void addDecorator(SessionDecoratorHook* hook);
+ /**
+ * Remove a session decorator hook
+ */
void removeDecorator(SessionDecoratorHook* hook);
+ /**
+ * Remove all session decorator hooks
+ */
void clearDecorators();
};
commit f1a8af8d8e9ffc51c67e011440147fe7e56f9c10
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Jun 28 17:59:16 2011 -0500
Add slice for session decorators.
diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
new file mode 100644
index 0000000..6fccbde
--- /dev/null
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -0,0 +1,54 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.ice>
+#include <AsteriskSCF/System/Hook/HookIf.ice>
+
+module AsteriskSCF
+{
+
+module SessionCommunications
+{
+
+module ExtensionPoints
+{
+
+["suppress"]
+module V1
+{
+
+ const string SessionDecoratorLocatorCategory = "SessionDecorator";
+
+ interface SessionDecoratorHook
+ {
+ AsteriskSCF::System::Hook::V1::HookResult decorateSession(AsteriskSCF::SessionCommunications::V1::Session* realSession, out AsteriskSCF::SessionCommunications::V1::Session* decorator);
+ };
+
+ sequence<SessionDecoratorHook*> SessionDecoratorHookSeq;
+
+ interface SessionDecoratorExtensionPoint
+ {
+ void addDecorator(SessionDecoratorHook* hook);
+ void removeDecorator(SessionDecoratorHook* hook);
+ void clearDecorators();
+ };
+
+}; /* End of module V1 */
+}; /* End of module ExtensionPoints */
+}; /* End of module SessionCommunications */
+}; /* End of module AsteriskSCF */
commit 70c5318d3f020014d8169508998c23749ecf01b2
Merge: 42649f0 f08f95b
Author: Mark Michelson <mmichelson at digium.com>
Date: Thu Feb 10 17:09:50 2011 -0600
Merge branch 'sip-auth-hook' of git.asterisk.org:asterisk-scf/integration/slice into sip-auth-hook
commit 42649f043da0d2d9f781a4abc1699b930ed23a94
Merge: efd8f9e 047f8c5
Author: Mark Michelson <mmichelson at digium.com>
Date: Mon Feb 7 13:39:10 2011 -0600
Merge branch 'sip-auth-hook' of git.asterisk.org:asterisk-scf/integration/slice into sip-auth-hook
commit efd8f9ec73bca6cd1b092a390555bad7d41d7b90
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Fri Feb 4 16:45:16 2011 +0100
Add an initial version of the basic Hook interface and a SIP
authentication Extension Point. This all came from the relevant
wiki pages on wiki.asterisk.org, with some minor modifications
along the way.
diff --git a/AsteriskSCF/SIP/SIPExtensionPointIf.ice b/AsteriskSCF/SIP/SIPExtensionPointIf.ice
new file mode 100644
index 0000000..dffcd74
--- /dev/null
+++ b/AsteriskSCF/SIP/SIPExtensionPointIf.ice
@@ -0,0 +1,121 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <Ice/BuiltinSequences.ice>
+
+#include <AsteriskSCF/System/Hook/HookIf.ice>
+
+module AsteriskSCF
+{
+
+module SIP
+{
+
+module ExtensionPoint
+{
+
+["suppress"]
+module V1
+{
+
+ dictionary<string, string> ParamDict;
+
+ enum RequestTransport
+ {
+ UDP,
+ TCP,
+ TLS
+ };
+
+ class RequestInfo
+ {
+ // The display name in the From header
+ string fromName;
+ // The URI in the From header
+ string fromURI;
+ // URI parameters in the From header
+ ParamDict fromParams;
+ // The display name in the To header
+ string toName;
+ // The URI in the To header
+ string toURI;
+ // URI parameters in the To header
+ ParamDict toParams;
+ // The request URI
+ string requestURI;
+ // request URI parameters
+ ParamDict requestURIParams;
+ // Source IP address
+ string IPAddr;
+ // Source Port
+ int port;
+ // Transport over which request was received
+ RequestTransport transport;
+ };
+
+ enum DigestAlgorithm
+ {
+ MD5,
+ MD5sess,
+ AKAv1MD5,
+ AKAv1MD5sess,
+ AKAv2MD5,
+ AKAv2MD5sess
+ };
+
+ class DigestChallenge
+ {
+ string username;
+ string password;
+ Ice::StringSeq domain;
+ string realm;
+ Ice::StringSeq nonce;
+ Ice::StringSeq opaque;
+ DigestAlgorithm algorithm;
+ };
+
+ sequence<DigestChallenge> DigestChallengeSeq;
+
+ interface AuthHook
+ {
+ AsteriskSCF::System::Hook::V1::HookResult challengeRequest(RequestInfo info, out DigestChallengeSeq challenges);
+ };
+
+ enum RequestType
+ {
+ DialogEstablishing,
+ NonDialog,
+ InDialog,
+ };
+
+ sequence<RequestType> RequestTypeSeq;
+
+ interface AuthExtensionPoint
+ {
+ AsteriskSCF::System::Hook::V1::HookId addAuthHook(AuthHook *hook, RequestTypeSeq requestTypes);
+ void removeAuthHook(AsteriskSCF::System::Hook::V1::HookId id);
+ void clearAuthHooks();
+ };
+
+}; /* End of module V1 */
+
+}; /* End of module ExtensionPoint */
+
+}; /* End of module SIP */
+
+}; /* End of module AsteriskSCF */
diff --git a/AsteriskSCF/System/Hook/HookIf.ice b/AsteriskSCF/System/Hook/HookIf.ice
new file mode 100644
index 0000000..c9693fa
--- /dev/null
+++ b/AsteriskSCF/System/Hook/HookIf.ice
@@ -0,0 +1,58 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+module AsteriskSCF
+{
+
+module System
+{
+
+module Hook
+{
+
+module V1
+{
+
+ struct HookId
+ {
+ string id;
+ };
+
+ enum HookStatus
+ {
+ /* Hook successfully processed input/returned result */
+ Succeeded,
+ /* Hook failed to process input or return result */
+ Failed,
+ /* Hook declined to process input and return result */
+ Declined
+ };
+
+ struct HookResult
+ {
+ HookStatus status;
+ string info;
+ };
+
+}; /* End of V1 */
+
+}; /* End of Hook */
+
+}; /* End of System */
+
+}; /* End of AsteriskSCF */
-----------------------------------------------------------------------
--
asterisk-scf/integration/slice.git
More information about the asterisk-scf-commits
mailing list