[asterisk-commits] tilghman: branch 1.6.2 r278273 - in /branches/1.6.2: ./ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 20 17:30:49 CDT 2010


Author: tilghman
Date: Tue Jul 20 17:30:46 2010
New Revision: 278273

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278273
Log:
Merged revisions 278272 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r278272 | tilghman | 2010-07-20 17:26:23 -0500 (Tue, 20 Jul 2010) | 11 lines
  
  Merged revisions 278167 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r278167 | tilghman | 2010-07-20 15:59:06 -0500 (Tue, 20 Jul 2010) | 4 lines
    
    Do not queue up DTMF frames while a call is on hold.
    
    (Fixes ABE-2110)
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/include/asterisk/channel.h
    branches/1.6.2/main/autoservice.c
    branches/1.6.2/main/features.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/include/asterisk/channel.h?view=diff&rev=278273&r1=278272&r2=278273
==============================================================================
--- branches/1.6.2/include/asterisk/channel.h (original)
+++ branches/1.6.2/include/asterisk/channel.h Tue Jul 20 17:30:46 2010
@@ -1585,6 +1585,18 @@
 int ast_autoservice_stop(struct ast_channel *chan);
 
 /*!
+ * \brief Ignore certain frame types
+ * \note Normally, we cache DTMF, IMAGE, HTML, TEXT, and CONTROL frames
+ * while a channel is in autoservice and queue them up when taken out of
+ * autoservice.  When this is not desireable, this API may be used to
+ * cause the channel to ignore those frametypes after the channel is put
+ * into autoservice, but before autoservice is stopped.
+ * \retval 0 success
+ * \retval -1 channel is not in autoservice
+ */
+int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype);
+
+/*!
  * \brief Enable or disable timer ticks for a channel
  *
  * \param rate number of timer ticks per second

Modified: branches/1.6.2/main/autoservice.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/autoservice.c?view=diff&rev=278273&r1=278272&r2=278273
==============================================================================
--- branches/1.6.2/main/autoservice.c (original)
+++ branches/1.6.2/main/autoservice.c Tue Jul 20 17:30:46 2010
@@ -56,6 +56,7 @@
 	 *  it gets stopped for the last time. */
 	unsigned int use_count;
 	unsigned int orig_end_dtmf_flag:1;
+	unsigned int ignore_frame_types;
 	/*! Frames go on at the head of deferred_frames, so we have the frames
 	 *  from newest to oldest.  As we put them at the head of the readq, we'll
 	 *  end up with them in the right order for the channel's readq. */
@@ -286,7 +287,9 @@
 
 	ast_channel_lock(chan);
 	while ((f = AST_LIST_REMOVE_HEAD(&as->deferred_frames, frame_list))) {
-		ast_queue_frame_head(chan, f);
+		if (!((1 << f->frametype) & as->ignore_frame_types)) {
+			ast_queue_frame_head(chan, f);
+		}
 		ast_frfree(f);
 	}
 	ast_channel_unlock(chan);
@@ -296,6 +299,23 @@
 	return res;
 }
 
+int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
+{
+	struct asent *as;
+	int res = -1;
+
+	AST_LIST_LOCK(&aslist);
+	AST_LIST_TRAVERSE(&aslist, as, list) {
+		if (as->chan == chan) {
+			res = 0;
+			as->ignore_frame_types |= (1 << ftype);
+			break;
+		}
+	}
+	AST_LIST_UNLOCK(&aslist);
+	return res;
+}
+
 void ast_autoservice_init(void)
 {
 	ast_cond_init(&as_cond, NULL);

Modified: branches/1.6.2/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/features.c?view=diff&rev=278273&r1=278272&r2=278273
==============================================================================
--- branches/1.6.2/main/features.c (original)
+++ branches/1.6.2/main/features.c Tue Jul 20 17:30:46 2010
@@ -978,6 +978,7 @@
 	/* First play for caller, put other channel on auto service */
 	if (ast_autoservice_start(callee_chan))
 		return -1;
+	ast_autoservice_ignore(callee_chan, AST_FRAME_DTMF_END);
 	if (ast_stream_and_wait(caller_chan, audiofile, "")) {
 		ast_log(LOG_WARNING, "Failed to play automon message!\n");
 		ast_autoservice_stop(callee_chan);
@@ -988,6 +989,7 @@
 	/* Then play for callee, put other channel on auto service */
 	if (ast_autoservice_start(caller_chan))
 		return -1;
+	ast_autoservice_ignore(caller_chan, AST_FRAME_DTMF_END);
 	if (ast_stream_and_wait(callee_chan, audiofile, "")) {
 		ast_log(LOG_WARNING, "Failed to play automon message !\n");
 		ast_autoservice_stop(caller_chan);
@@ -1130,6 +1132,7 @@
 	if (!ast_strlen_zero(courtesytone)) {
 		if (ast_autoservice_start(callee_chan))
 			return -1;
+		ast_autoservice_ignore(callee_chan, AST_FRAME_DTMF_END);
 		if (ast_stream_and_wait(caller_chan, courtesytone, "")) {
 			ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
 			ast_autoservice_stop(callee_chan);
@@ -1277,6 +1280,7 @@
 	transferer_real_context = real_ctx(transferer, transferee);
 	/* Start autoservice on chan while we talk to the originator */
 	ast_autoservice_start(transferee);
+	ast_autoservice_ignore(transferee, AST_FRAME_DTMF_END);
 	ast_indicate(transferee, AST_CONTROL_HOLD);
 
 	memset(xferto, 0, sizeof(xferto));
@@ -1418,6 +1422,7 @@
 	transferer_real_context = real_ctx(transferer, transferee);
 	/* Start autoservice on chan while we talk to the originator */
 	ast_autoservice_start(transferee);
+	ast_autoservice_ignore(transferee, AST_FRAME_DTMF_END);
 	ast_indicate(transferee, AST_CONTROL_HOLD);
 	
 	/* Transfer */
@@ -1624,6 +1629,7 @@
 			while (!newchan && !atxferdropcall && tries < atxfercallbackretries) {
 				/* Trying to transfer again */
 				ast_autoservice_start(transferee);
+				ast_autoservice_ignore(transferee, AST_FRAME_DTMF_END);
 				ast_indicate(transferee, AST_CONTROL_HOLD);
 
 				newchan = feature_request_and_dial(transferer, transferee, "Local", ast_best_codec(transferer->nativeformats),
@@ -1964,6 +1970,7 @@
 	}
 
 	ast_autoservice_start(idle);
+	ast_autoservice_ignore(idle, AST_FRAME_DTMF_END);
 	
 	if (!ast_strlen_zero(feature->moh_class))
 		ast_moh_start(idle, feature->moh_class, NULL);




More information about the asterisk-commits mailing list