[asterisk-commits] russell: branch 1.2 r69347 - /branches/1.2/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jun 14 13:56:20 MST 2007


Author: russell
Date: Thu Jun 14 15:56:19 2007
New Revision: 69347

URL: http://svn.digium.com/view/asterisk?view=rev&rev=69347
Log:
Backport rev 69010 from the 1.4 branch ...

In ast_channel_make_compatible(), just return if the channels' read and write
formats already match up.  There are code paths that call this function on a
pair of channels multiple times.  This made calls fail that were using g729
in some cases.  The reason is that codec_g729a will unregister itself from the
list of available translators will all licenses are in use.  So, the first
time the function got called, the right translation path was allocated.
However, the second time it got called, the code would not find a translation
path to/from g729 and make the call fail, even if the channel actually already
had a g729 translation path allocated.

(SPD-32)

Modified:
    branches/1.2/channel.c

Modified: branches/1.2/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channel.c?view=diff&rev=69347&r1=69346&r2=69347
==============================================================================
--- branches/1.2/channel.c (original)
+++ branches/1.2/channel.c Thu Jun 14 15:56:19 2007
@@ -2766,6 +2766,11 @@
 	int src;
 	int dst;
 
+	if (chan->readformat == peer->writeformat && chan->writeformat == peer->readformat) {
+		/* Already compatible!  Moving on ... */
+		return 0;
+	}
+
 	/* Set up translation from the chan to the peer */
 	src = chan->nativeformats;
 	dst = peer->nativeformats;



More information about the asterisk-commits mailing list