From cd054ab3b4e1d58d69fa06f0ba730f26f80a905f Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Mon, 12 Jul 2010 16:58:39 +0000 Subject: [PATCH] Change ast_write to not stop generator when called from ast_prod. For SIP channels configured with the progressinband option on, the ringback was being immediately stopped. This problem was due to ast_prod being moved for a deadlock fix in 259858. Prodding the channel after setting up the generator triggered the check in ast_write to stop the generator. The fix here should write the frame the same as was done before the call to ast_prod was moved. (closes issue #17372) Reported by: tech_admin git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@275665 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main/channel.c b/main/channel.c index b10c07cfe0..a745aa6cd7 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2893,7 +2893,7 @@ int ast_prod(struct ast_channel *chan) ast_log(LOG_DEBUG, "Prodding channel '%s'\n", chan->name); a.subclass = chan->rawwriteformat; a.data = nothing + AST_FRIENDLY_OFFSET; - a.src = "ast_prod"; + a.src = "ast_prod"; /* this better match check in ast_write */ if (ast_write(chan, &a)) ast_log(LOG_WARNING, "Prodding channel '%s' failed\n", chan->name); } @@ -3044,10 +3044,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr) res = 0; /* XXX explain, why 0 ? */ goto done; } - if (chan->generatordata) { - if (ast_test_flag(chan, AST_FLAG_WRITE_INT)) - ast_deactivate_generator(chan); - else { + if (chan->generatordata && strcasecmp(fr->src, "ast_prod")) { + if (ast_test_flag(chan, AST_FLAG_WRITE_INT)) { + ast_deactivate_generator(chan); + } else { if (fr->frametype == AST_FRAME_DTMF_END) { /* There is a generator running while we're in the middle of a digit. * It's probably inband DTMF, so go ahead and pass it so it can