From: Russell Bryant Date: Fri, 15 Aug 2008 15:07:16 +0000 (+0000) Subject: Ensure that when a hangup occurs in autoservice, that a hangup frame gets X-Git-Tag: 1.4.22-rc2~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a55c5427e75ffa401cb88faa2bd4eeb2ce49581;p=thirdparty%2Fasterisk.git Ensure that when a hangup occurs in autoservice, that a hangup frame gets properly deferred to be read from the channel owner when it gets taken out of autoservice. (closes issue #12874) Reported by: dimas Patches: v1-12874.patch uploaded by dimas (license 88) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138027 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/autoservice.c b/main/autoservice.c index a681b0f1d5..d3879b2c53 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -157,14 +157,7 @@ static void *autoservice_run(void *ign) } } - if (!defer_frame) { - if (f) { - ast_frfree(f); - } - continue; - } - - if (f) { + if (defer_frame) { for (i = 0; i < x; i++) { struct ast_frame *dup_f; @@ -172,12 +165,15 @@ static void *autoservice_run(void *ign) continue; } - if ((dup_f = ast_frdup(f))) { + if ((dup_f = ast_frdup(defer_frame))) { AST_LIST_INSERT_TAIL(&ents[i]->deferred_frames, dup_f, frame_list); } break; } + } + + if (f) { ast_frfree(f); } }