[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "resample" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Aug 22 16:52:16 CDT 2011


branch "resample" has been created
        at  953289a66556d717384244c36f73acc945562099 (commit)

- Log -----------------------------------------------------------------
commit 953289a66556d717384244c36f73acc945562099
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 22 15:24:20 2011 -0500

    Add some more format operations services for convenience.

diff --git a/slice/AsteriskSCF/Media/MediaIf.ice b/slice/AsteriskSCF/Media/MediaIf.ice
index f9bb522..97e512c 100644
--- a/slice/AsteriskSCF/Media/MediaIf.ice
+++ b/slice/AsteriskSCF/Media/MediaIf.ice
@@ -339,6 +339,33 @@ module V1
     };
 
     /**
+     * Represents the payload of a media frame.
+     */
+    class FramePayload
+    {
+    };
+
+    /**
+     * A payload represented as a byte sequence.
+     * This is useful for formats whose payload consists
+     * of bytes, such as the G711 audio formats.
+     */
+    class ByteSeqPayload extends FramePayload
+    {
+        Ice::ByteSeq payload;
+    };
+
+    /**
+     * A payload represented as a sequence of 16-bit quantities.
+     * This is useful for formats whose payload consists
+     * of 16-bit quantities, such as signed linear audio.
+     */
+    class ShortSeqPayload extends FramePayload
+    {
+        Ice::ShortSeq payload;
+    };
+
+    /**
      * A generic frame class that contains common details about frames. Additional classes should extend this to provide
      * additional details about the frame.
      */
@@ -350,9 +377,9 @@ module V1
         Format mediaFormat;
 
         /**
-         * A sequence of bytes which contain the actual data payload of this frame.
+         * The payload of the frame.
          */
-        Ice::ByteSeq payload;
+        FramePayload payload;
     };
 
     /**
@@ -400,6 +427,22 @@ module V1
          * @return bool True if compatible, false if not.
          */
         idempotent bool checkCompatible(Format format1, Format format2);
+
+        /**
+         * Method that decodes a frame payload from the network.
+         *
+         * @param toDecode Raw bytes from the network.
+         * @return An AsteriskSCF Frame payload that encapsulates the data
+         */
+        FramePayload decodePayload(Ice::ByteSeq toDecode);
+
+        /**
+         * Method that encodes a frame for the network to use.
+         *
+         * @param toDecode The frame payload to encode
+         * @return A byte sequence directly writeable to the network
+         */
+        Ice::ByteSeq encodePayload(FramePayload toEncode);
     };
 
     /**
@@ -428,6 +471,11 @@ module V1
     class AudioFormat extends Format
     {
         /**
+         * Numerical sample size in bits
+         */
+        int sampleSize;
+
+        /**
          * Numerical sample rate specified in Hz.
          */
         int sampleRate;

commit 91f56f1e7a481e13a0b42d0fb1d323ac3ad3cb91
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Aug 17 13:57:31 2011 -0500

    Add constants for locating media operations.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index e7dfe95..9dfcd96 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -28,6 +28,20 @@ module Media
 module V1
 {
 
+/**
+ * This is meant to be used in ServiceLocatorParams as the
+ * "category" for all media operations.
+ */
+const string MediaOperationDiscoveryCategory = "MediaOperation";
+
+/**
+ * This is Meant to be used in ServiceLocatorParams as the "service"
+ * when a translator is needed. The service set by media operations
+ * that do not perform translation may use a descriptive term for
+ * their service instead, like "pitch shifter" or "volume adjustment."
+ */
+const string MediaOperationDiscoveryTranslatorService = "Translator";
+
 interface MediaOperation
 {
     StreamSource* getSource();

commit ce9020326cff79fc41acb596241ff6641ea5af5f
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Aug 17 13:38:58 2011 -0500

    Create a constant to use for the format names for ulaw and alaw.

diff --git a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
index 349f1b7..645c427 100644
--- a/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
+++ b/slice/AsteriskSCF/Media/Formats/AudioFormats.ice
@@ -46,6 +46,8 @@ module V1
          */
     };
 
+    const string G711uLAWName = "ulaw";
+
     /**
      * G.711 a-Law Audio Format
      */
@@ -56,6 +58,8 @@ module V1
          */
     };
 
+    const string G711aLAWName = "alaw";
+
 }; /*  end module V1 */
 
 }; /*  end module Audio */

commit c1a96c506d66c71c874b2107c187bc5a28e8b4c3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 15 11:56:45 2011 -0500

    Allow createMediaOperation to throw an exception if bad formats are given.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 05eae31..e7dfe95 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -44,7 +44,7 @@ interface MediaOperationFactory
      */
     MediaOperation* createMediaOperation(
             StreamSource* source,
-            StreamSink* sink);
+            StreamSink* sink) throws UnsupportedMediaFormatException;
 };
 
 struct MediaOperationAttributes

commit 8e5e1f624b5fb5e498bb7d84a1172fa337e8bee3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 17:24:01 2011 -0500

    Fix a typo.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 5e42c8c..05eae31 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -44,7 +44,7 @@ interface MediaOperationFactory
      */
     MediaOperation* createMediaOperation(
             StreamSource* source,
-            StreamSource* sink);
+            StreamSink* sink);
 };
 
 struct MediaOperationAttributes

commit 1a56884ce4ac84e41ab64499a635834f6cd71f63
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 14:48:21 2011 -0500

    Return a proxy to a media operation.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
index 3c50a68..5e42c8c 100644
--- a/slice/AsteriskSCF/Media/MediaOperationIf.ice
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -42,7 +42,7 @@ interface MediaOperationFactory
      * @param source optional source of media that will enter the operation
      * @param sink optional source of media that the operation will write to
      */
-    MediaOperation createMediaOperation(
+    MediaOperation* createMediaOperation(
             StreamSource* source,
             StreamSource* sink);
 };

commit 990dd70ce8143d48a2064b0100f4f34a9ec1d344
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 11 14:05:48 2011 -0500

    Create slice definitions for media operations.

diff --git a/slice/AsteriskSCF/Media/MediaOperationIf.ice b/slice/AsteriskSCF/Media/MediaOperationIf.ice
new file mode 100644
index 0000000..3c50a68
--- /dev/null
+++ b/slice/AsteriskSCF/Media/MediaOperationIf.ice
@@ -0,0 +1,77 @@
+/*
+ * 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 <AsteriskSCF/Media/MediaIf.ice>
+#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
+
+module AsteriskSCF
+{
+
+module Media
+{
+
+module V1
+{
+
+interface MediaOperation
+{
+    StreamSource* getSource();
+    StreamSink* getSink();
+    void destroy();
+};
+
+interface MediaOperationFactory
+{
+    /**
+     * Create a new instance of a media operation.
+     * @param source optional source of media that will enter the operation
+     * @param sink optional source of media that the operation will write to
+     */
+    MediaOperation createMediaOperation(
+            StreamSource* source,
+            StreamSource* sink);
+};
+
+struct MediaOperationAttributes
+{
+    /**
+     * The input format for a specific operation
+     */
+    Format inputFormat;
+    /**
+     * The output format for a specific operation
+     */
+    Format outputFormat;
+    /**
+     * The cost of the operation.
+     * Lower cost indicates an "easier" translation,
+     * either because it is faster or uses fewer resources.
+     */
+    int cost;
+};
+
+sequence<MediaOperationAttributes> MediaOperationAttributesSeq;
+
+unsliceable class MediaOperationServiceLocatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+{
+    MediaOperationAttributesSeq attributes;
+};
+
+}; /* end module V1 */
+}; /* end module Media */
+}; /* end module AsteriskSCF */

commit 705e8430d13ea8dd8f7e19e78ce87efba4a10e8d
Merge: 95d9346 863f719
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 18 12:34:53 2011 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/slice


commit 863f7198cb53dd4c60b11f8bfe3d2e8a8b8f7160
Author: David M. Lee <dlee at digium.com>
Date:   Thu Aug 18 11:28:41 2011 -0500

    Duplicates are bad

diff --git a/AsteriskSCF/SIP/SIPRegistrarIf.ice b/AsteriskSCF/SIP/SIPRegistrarIf.ice
deleted file mode 100644
index 508871c..0000000
--- a/AsteriskSCF/SIP/SIPRegistrarIf.ice
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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>
-
-module AsteriskSCF
-{
-
-module SIP
-{
-
-module Registration
-{
-
-["suppress"]
-module V1
-{
-
-class Binding
-{
-    /**
-     * The contact URI associated with this particular Binding.
-     */
-     string contact;
-     /**
-      * The Call-ID from the latest successful Binding.
-      */
-     string callid;
-     /**
-      * The CSeq from the latest successful Binding.
-      */
-     int cseq;
-     /**
-      * A UNIX timestamp indicating when the Binding is set
-      * to expire
-      */
-     int expiration;
-};
-
-sequence<Binding> BindingSeq;
-
-dictionary<string, BindingSeq> BindingDict;
-
-struct BindingUpdate
-{
-    /**
-     * The AoR for which bindings have been updated
-     */
-    string aor;
-    /**
-     * The contacts from all bindings for this AoR
-     */
-    Ice::StringSeq contacts;
-};
- 
-/**
- * A RegistrarListener is updated when a binding changes.
- * Typical RegistrarListeners will be SIP services that
- * require up-to-date information.
- */
-interface RegistrarListener
-{
-    /**
-     * Alerts the listener that contacts have been added.
-     * The AoR may be new or it may have previous
-     * bindings.
-     */
-    void contactsAdded(BindingUpdate contacts);
-    /**
-     * Alerts the listener that contacts have been removed.
-     * There is no specific call for indicating that an AoR
-     * no longer has contacts associated with it. After this
-     * method has been called, listeners should take
-     * appropriate action if the AoR has no bound contacts.
-     */
-     void contactsRemoved(BindingUpdate contacts);
-};
-
-/**
- * A dictionary mapping
- * AoRs to their bound contacts
- */
-dictionary<string, Ice::StringSeq> ContactDict;
-
-interface Registrar
-{
-    /**
-     * Add a new listener to the registrar.
-     * The return value is the map of all AoRs and their
-     * bindings.
-     */
-     ContactDict addListener(RegistrarListener *listener);
-     /**
-      * Remove a listener.
-      */
-     void removeListener(RegistrarListener *listener);
-     /**
-      * Get the mapping of all active registrations.
-      */
-     BindingDict getAllBindings();
-     /**
-      * Get all bindings associated with a particular AoR
-      */
-     BindingSeq getAORBindings(string aor);
-};
-
-}; // end module V1
-}; // end module Registration
-}; // end module SIP
-}; // end module AsteriskSCF

commit 95d9346329391ea7d497cc8bf8d76b634d5f313b
Merge: 01d2120 e752509
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Aug 18 09:30:19 2011 -0500

    Merge branch 'oneshot-hooks'


commit e7525092f2e56e26419aad5e9a43dcae4ac6fe1e
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Jul 28 13:11:00 2011 -0500

    Add cookies to the session creation hook.

diff --git a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
index cad714b..0ddc97b 100644
--- a/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
+++ b/slice/AsteriskSCF/SessionCommunications/SessionCommunicationsExtensionPointsIf.ice
@@ -38,6 +38,7 @@ module V1
     {
         AsteriskSCF::SessionCommunications::V1::Session *session;
         AsteriskSCF::SessionCommunications::V1::SessionListenerSeq listeners;
+        AsteriskSCF::SessionCommunications::V1::SessionCookies cookies;
     };
 
     interface SessionCreationHook

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.

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/slice.git



More information about the asterisk-scf-commits mailing list