aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 19:13:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 19:13:41 +0000
commit6be25fca557f58806c7a6a841faa28b9bc9e7cf7 (patch)
treee770e35ddfc024387f45894bced011abfd48e25e /main
parentf2f2f9bb5b2d54e9f00d7276cd7112b24285de02 (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@69010 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index defc4b687..7fd58eca9 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3281,6 +3281,11 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe
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;