[asterisk-commits] file: branch 1.4 r90548 - in /branches/1.4: ./ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 3 12:40:56 CST 2007


Author: file
Date: Mon Dec  3 12:40:56 2007
New Revision: 90548

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90548
Log:
Preserve the indication currently playing on a channel when a masquerade operation happens. (issue #BE-88)

Modified:
    branches/1.4/.cleancount
    branches/1.4/include/asterisk/channel.h
    branches/1.4/main/channel.c

Modified: branches/1.4/.cleancount
URL: http://svn.digium.com/view/asterisk/branches/1.4/.cleancount?view=diff&rev=90548&r1=90547&r2=90548
==============================================================================
--- branches/1.4/.cleancount (original)
+++ branches/1.4/.cleancount Mon Dec  3 12:40:56 2007
@@ -1,1 +1,1 @@
-29
+30

Modified: branches/1.4/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/channel.h?view=diff&rev=90548&r1=90547&r2=90548
==============================================================================
--- branches/1.4/include/asterisk/channel.h (original)
+++ branches/1.4/include/asterisk/channel.h Mon Dec  3 12:40:56 2007
@@ -436,6 +436,8 @@
 	char emulate_dtmf_digit;			/*!< Digit being emulated */
 	unsigned int emulate_dtmf_duration;	/*!< Number of ms left to emulate DTMF for */
 	struct timeval dtmf_tv;       /*!< The time that an in process digit began, or the last digit ended */
+
+	int visible_indication;                         /*!< Indication currently playing on the channel */
 
 	/*! \brief Data stores on the channel */
 	AST_LIST_HEAD_NOLOCK(datastores, ast_datastore) datastores;

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=90548&r1=90547&r2=90548
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Dec  3 12:40:56 2007
@@ -1817,6 +1817,7 @@
 	default:
 		break;
 	}
+	chan->visible_indication = 0;
 	ast_channel_unlock(chan);
 	return res;
 }
@@ -2608,6 +2609,7 @@
 					ast_log(LOG_DEBUG, "Driver for channel '%s' does not support indication %d, emulating it\n", chan->name, condition);
 				ast_playtones_start(chan,0,ts->data, 1);
 				res = 0;
+				chan->visible_indication = condition;
 			} else if (condition == AST_CONTROL_PROGRESS) {
 				/* ast_playtones_stop(chan); */
 			} else if (condition == AST_CONTROL_PROCEEDING) {
@@ -2624,7 +2626,9 @@
 				res = -1;
 			}
 		}
-	}
+	} else
+		chan->visible_indication = condition;
+
 	return res;
 }
 
@@ -3837,6 +3841,10 @@
 	} else
 		ast_log(LOG_WARNING, "Channel type '%s' does not have a fixup routine (for %s)!  Bad things may happen.\n",
 			original->tech->type, original->name);
+
+	/* If an indication is currently playing maintain it on the channel that is taking the place of original */
+	if (original->visible_indication)
+		ast_indicate(original, original->visible_indication);
 	
 	/* Now, at this point, the "clone" channel is totally F'd up.  We mark it as
 	   a zombie so nothing tries to touch it.  If it's already been marked as a




More information about the asterisk-commits mailing list