[svn-commits] tilghman: branch group/cdr_backend_ast_str r110609 - in /team/group/cdr_backe...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Mar 22 12:56:54 CDT 2008


Author: tilghman
Date: Sat Mar 22 12:56:53 2008
New Revision: 110609

URL: http://svn.digium.com/view/asterisk?view=rev&rev=110609
Log:
Merged revisions 110475,110499,110542,110578 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r110475 | qwell | 2008-03-21 09:36:17 -0500 (Fri, 21 Mar 2008) | 15 lines

Merged revisions 110474 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110474 | qwell | 2008-03-21 09:32:52 -0500 (Fri, 21 Mar 2008) | 7 lines

Don't attempt to do optimizations of gsm on mips platforms either.

(closes issue #12270)
Reported by: zandbelt
Patches:
      026-gsm-mips.patch uploaded by zandbelt (license 33)

........

................
r110499 | russell | 2008-03-21 10:24:43 -0500 (Fri, 21 Mar 2008) | 3 lines

Note that the TCP and TLS support is currently considered experimental and
is subject to change while we work out the remaining issues.

................
r110542 | file | 2008-03-21 12:58:59 -0500 (Fri, 21 Mar 2008) | 2 lines

Merge over ast_audiohook_volume branch. This adds API calls for use by developers to adjust the volume on a channel.

................
r110578 | qwell | 2008-03-21 16:52:06 -0500 (Fri, 21 Mar 2008) | 1 line

Update to 1.4.11 core sounds.
................

Modified:
    team/group/cdr_backend_ast_str/   (props changed)
    team/group/cdr_backend_ast_str/CHANGES
    team/group/cdr_backend_ast_str/codecs/gsm/Makefile
    team/group/cdr_backend_ast_str/configs/sip.conf.sample
    team/group/cdr_backend_ast_str/include/asterisk/audiohook.h
    team/group/cdr_backend_ast_str/main/audiohook.c
    team/group/cdr_backend_ast_str/sounds/Makefile

Propchange: team/group/cdr_backend_ast_str/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Mar 22 12:56:53 2008
@@ -1,1 +1,1 @@
-/trunk:1-110471
+/trunk:1-110608

Modified: team/group/cdr_backend_ast_str/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/CHANGES?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/CHANGES (original)
+++ team/group/cdr_backend_ast_str/CHANGES Sat Mar 22 12:56:53 2008
@@ -173,8 +173,8 @@
   * Added SIP Session Timers support (RFC 4028).  This prevents stuck SIP sessions that
      were not properly torn down due to network or endpoint failures during an established
      SIP session.
-  * Added TCP and TLS support for SIP.  See doc/siptls.txt and configs/sip.conf.sample for
-     more information on how it is used.
+  * Added experimental TCP and TLS support for SIP.  See doc/siptls.txt and 
+     configs/sip.conf.sample for more information on how it is used.
   * Added a new configuration option "authfailureevents" that enables manager events when
     a peer can't authenticate properly. 
   * Added DNS manager support to registrations not referencing a peer entry.

Modified: team/group/cdr_backend_ast_str/codecs/gsm/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/codecs/gsm/Makefile?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/codecs/gsm/Makefile (original)
+++ team/group/cdr_backend_ast_str/codecs/gsm/Makefile Sat Mar 22 12:56:53 2008
@@ -38,7 +38,7 @@
 ######### probably require gcc. 
 
 ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
-ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel ))
+ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel mips))
 ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 ))
 OPTIMIZE+=-march=$(PROC)
 endif
@@ -209,7 +209,7 @@
 # XXX should merge with GSM_OBJECTS
 ifeq ($(OSARCH),linux-gnu)
 ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 ))
-ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 s390 bfin mipsel ))
+ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 s390 bfin mipsel mips ))
 GSM_SOURCES+= $(SRC)/k6opt.s
 endif
 endif
@@ -261,7 +261,7 @@
 
 ifeq ($(OSARCH),linux-gnu)
 ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc ))
-ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 bfin mipsel ))
+ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 bfin mipsel mips ))
 GSM_OBJECTS+= $(SRC)/k6opt.o
 endif
 endif

Modified: team/group/cdr_backend_ast_str/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/configs/sip.conf.sample?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/configs/sip.conf.sample (original)
+++ team/group/cdr_backend_ast_str/configs/sip.conf.sample Sat Mar 22 12:56:53 2008
@@ -80,6 +80,12 @@
 				; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 
+;
+; Note that the TCP and TLS support for chan_sip is currently considered
+; experimental.  Since it is new, all of the related configuration options are
+; subject to change in any release.  If they are changed, the changes will
+; be reflected in this sample configuration file, as well as in the UPGRADE.txt file.
+;
 tcpenable=yes                   ; Enable server for incoming TCP connections (default is yes)
 tcpbindaddr=0.0.0.0	        ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
                                 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)

Modified: team/group/cdr_backend_ast_str/include/asterisk/audiohook.h
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/include/asterisk/audiohook.h?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/include/asterisk/audiohook.h (original)
+++ team/group/cdr_backend_ast_str/include/asterisk/audiohook.h Sat Mar 22 12:56:53 2008
@@ -206,6 +206,29 @@
  */
 #define ast_audiohook_unlock(ah) ast_mutex_unlock(&(ah)->lock)
 
+/*! \brief Adjust the volume on frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param direction Direction to set on
+ * \param volume Value to adjust the volume by
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume);
+
+/*! \brief Retrieve the volume adjustment value on frames read from or written to a channel
+ * \param chan Channel to retrieve volume adjustment from
+ * \param direction Direction to retrieve
+ * \return Returns adjustment value
+ */
+int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direction direction);
+
+/*! \brief Adjust the volume on frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param direction Direction to increase
+ * \param volume Value to adjust the adjustment by
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/group/cdr_backend_ast_str/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/main/audiohook.c?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/main/audiohook.c (original)
+++ team/group/cdr_backend_ast_str/main/audiohook.c Sat Mar 22 12:56:53 2008
@@ -712,3 +712,187 @@
 	return count;
 }
 
+/*! \brief Audiohook volume adjustment structure */
+struct audiohook_volume {
+	struct ast_audiohook audiohook; /*!< Audiohook attached to the channel */
+	int read_adjustment;            /*!< Value to adjust frames read from the channel by */
+	int write_adjustment;           /*!< Value to adjust frames written to the channel by */
+};
+
+/*! \brief Callback used to destroy the audiohook volume datastore
+ * \param data Volume information structure
+ * \return Returns nothing
+ */
+static void audiohook_volume_destroy(void *data)
+{
+	struct audiohook_volume *audiohook_volume = data;
+
+	/* Destroy the audiohook as it is no longer in use */
+	ast_audiohook_destroy(&audiohook_volume->audiohook);
+
+	/* Finally free ourselves, we are of no more use */
+	ast_free(audiohook_volume);
+
+	return;
+}
+
+/*! \brief Datastore used to store audiohook volume information */
+static const struct ast_datastore_info audiohook_volume_datastore = {
+	.type = "Volume",
+	.destroy = audiohook_volume_destroy,
+};
+
+/*! \brief Helper function which actually gets called by audiohooks to perform the adjustment
+ * \param audiohook Audiohook attached to the channel
+ * \param chan Channel we are attached to
+ * \param frame Frame of audio we want to manipulate
+ * \param direction Direction the audio came in from
+ * \return Returns 0 on success, -1 on failure
+ */
+static int audiohook_volume_callback(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
+{
+	struct ast_datastore *datastore = NULL;
+	struct audiohook_volume *audiohook_volume = NULL;
+	int *gain = NULL;
+
+	/* If the audiohook is shutting down don't even bother */
+	if (audiohook->status == AST_AUDIOHOOK_STATUS_DONE) {
+		return 0;
+	}
+
+	/* Try to find the datastore containg adjustment information, if we can't just bail out */
+	if (!(datastore = ast_channel_datastore_find(chan, &audiohook_volume_datastore, NULL))) {
+		return 0;
+	}
+
+	audiohook_volume = datastore->data;
+
+	/* Based on direction grab the appropriate adjustment value */
+	if (direction == AST_AUDIOHOOK_DIRECTION_READ) {
+		gain = &audiohook_volume->read_adjustment;
+	} else if (direction == AST_AUDIOHOOK_DIRECTION_WRITE) {
+		gain = &audiohook_volume->write_adjustment;
+	}
+
+	/* If an adjustment value is present modify the frame */
+	if (gain && *gain) {
+		ast_frame_adjust_volume(frame, *gain);
+	}
+
+	return 0;
+}
+
+/*! \brief Helper function which finds and optionally creates an audiohook_volume_datastore datastore on a channel
+ * \param chan Channel to look on
+ * \param create Whether to create the datastore if not found
+ * \return Returns audiohook_volume structure on success, NULL on failure
+ */
+static struct audiohook_volume *audiohook_volume_get(struct ast_channel *chan, int create)
+{
+	struct ast_datastore *datastore = NULL;
+	struct audiohook_volume *audiohook_volume = NULL;
+
+	/* If we are able to find the datastore return the contents (which is actually an audiohook_volume structure) */
+	if ((datastore = ast_channel_datastore_find(chan, &audiohook_volume_datastore, NULL))) {
+		return datastore->data;
+	}
+
+	/* If we are not allowed to create a datastore or if we fail to create a datastore, bail out now as we have nothing for them */
+	if (!create || !(datastore = ast_channel_datastore_alloc(&audiohook_volume_datastore, NULL))) {
+		return NULL;
+	}
+
+	/* Create a new audiohook_volume structure to contain our adjustments and audiohook */
+	if (!(audiohook_volume = ast_calloc(1, sizeof(*audiohook_volume)))) {
+		ast_channel_datastore_free(datastore);
+		return NULL;
+	}
+
+	/* Setup our audiohook structure so we can manipulate the audio */
+	ast_audiohook_init(&audiohook_volume->audiohook, AST_AUDIOHOOK_TYPE_MANIPULATE, "Volume");
+	audiohook_volume->audiohook.manipulate_callback = audiohook_volume_callback;
+
+	/* Attach the audiohook_volume blob to the datastore and attach to the channel */
+	datastore->data = audiohook_volume;
+	ast_channel_datastore_add(chan, datastore);
+
+	/* All is well... put the audiohook into motion */
+	ast_audiohook_attach(chan, &audiohook_volume->audiohook);
+
+	return audiohook_volume;
+}
+
+/*! \brief Adjust the volume on frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param direction Direction to set on
+ * \param volume Value to adjust the volume by
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
+{
+	struct audiohook_volume *audiohook_volume = NULL;
+
+	/* Attempt to find the audiohook volume information, but only create it if we are not setting the adjustment value to zero */
+	if (!(audiohook_volume = audiohook_volume_get(chan, (volume ? 1 : 0)))) {
+		return -1;
+	}
+
+	/* Now based on the direction set the proper value */
+	if (direction == AST_AUDIOHOOK_DIRECTION_READ || direction == AST_AUDIOHOOK_DIRECTION_BOTH) {
+		audiohook_volume->read_adjustment = volume;
+	} else if (direction == AST_AUDIOHOOK_DIRECTION_WRITE || direction == AST_AUDIOHOOK_DIRECTION_BOTH) {
+		audiohook_volume->write_adjustment = volume;
+	}
+
+	return 0;
+}
+
+/*! \brief Retrieve the volume adjustment value on frames read from or written to a channel
+ * \param chan Channel to retrieve volume adjustment from
+ * \param direction Direction to retrieve
+ * \return Returns adjustment value
+ */
+int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direction direction)
+{
+	struct audiohook_volume *audiohook_volume = NULL;
+	int adjustment = 0;
+
+	/* Attempt to find the audiohook volume information, but do not create it as we only want to look at the values */
+	if (!(audiohook_volume = audiohook_volume_get(chan, 0))) {
+		return 0;
+	}
+
+	/* Grab the adjustment value based on direction given */
+	if (direction == AST_AUDIOHOOK_DIRECTION_READ) {
+		adjustment = audiohook_volume->read_adjustment;
+	} else if (direction == AST_AUDIOHOOK_DIRECTION_WRITE) {
+		adjustment = audiohook_volume->write_adjustment;
+	}
+
+	return adjustment;
+}
+
+/*! \brief Adjust the volume on frames read from or written to a channel
+ * \param chan Channel to muck with
+ * \param direction Direction to increase
+ * \param volume Value to adjust the adjustment by
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
+{
+	struct audiohook_volume *audiohook_volume = NULL;
+
+	/* Attempt to find the audiohook volume information, and create an audiohook if none exists */
+	if (!(audiohook_volume = audiohook_volume_get(chan, 1))) {
+		return -1;
+	}
+
+	/* Based on the direction change the specific adjustment value */
+	if (direction == AST_AUDIOHOOK_DIRECTION_READ || direction == AST_AUDIOHOOK_DIRECTION_BOTH) {
+		audiohook_volume->read_adjustment += volume;
+	} else if (direction == AST_AUDIOHOOK_DIRECTION_WRITE || direction == AST_AUDIOHOOK_DIRECTION_BOTH) {
+		audiohook_volume->write_adjustment += volume;
+	}
+
+	return 0;
+}

Modified: team/group/cdr_backend_ast_str/sounds/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/cdr_backend_ast_str/sounds/Makefile?view=diff&rev=110609&r1=110608&r2=110609
==============================================================================
--- team/group/cdr_backend_ast_str/sounds/Makefile (original)
+++ team/group/cdr_backend_ast_str/sounds/Makefile Sat Mar 22 12:56:53 2008
@@ -17,7 +17,7 @@
 
 SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
 MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
-CORE_SOUNDS_VERSION:=1.4.10
+CORE_SOUNDS_VERSION:=1.4.11
 EXTRA_SOUNDS_VERSION:=1.4.7
 SOUNDS_URL:=http://downloads.digium.com/pub/telephony/sounds/releases
 MCS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))




More information about the svn-commits mailing list