[asterisk-commits] twilson: branch 1.4 r282430 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 16 12:06:48 CDT 2010


Author: twilson
Date: Mon Aug 16 12:06:37 2010
New Revision: 282430

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282430
Log:
Send a SRCCHANGE indication when we masquerade

Masquerading a channel means that the src of the audio is potentially
changing, so send a SRCCHANGE so that RTP-based media streams can get
a new SSRC generated to reflect the change. Original patch by addix
(along with lots of testing--thanks!).

(closes issue #17007)
Reported by: addix
Patches: 
      1001-reset-SSRC-original-channel.diff uploaded by addix (license 1006)
      srcchange.diff uploaded by twilson (license 396)
Tested by: addix, twilson

Review:

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/channel.c?view=diff&rev=282430&r1=282429&r2=282430
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Aug 16 12:06:37 2010
@@ -4032,6 +4032,7 @@
 	void *t_pvt;
 	struct ast_callerid tmpcid;
 	struct ast_channel *clone = original->masq;
+	struct ast_channel *bridged;
 	struct ast_cdr *cdr;
 	int rformat = original->readformat;
 	int wformat = original->writeformat;
@@ -4298,6 +4299,15 @@
 		pthread_kill(original->blocker, SIGURG);
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Done Masquerading %s (%d)\n", original->name, original->_state);
+
+	if ((bridged = ast_bridged_channel(original))) {
+		ast_channel_lock(bridged);
+		ast_indicate(bridged, AST_CONTROL_SRCCHANGE);
+		ast_channel_unlock(bridged);
+	}
+
+	ast_indicate(original, AST_CONTROL_SRCCHANGE);
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list