]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't use data outside of its scope.
authorRussell Bryant <russell@russellbryant.com>
Sun, 11 Oct 2009 17:22:52 +0000 (17:22 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 11 Oct 2009 17:22:52 +0000 (17:22 +0000)
The purpose of this code was to have a hangup frame put on the list of deferred
frames.  However, the code that read the hangup frame was outside of the scope
of where the hangup frame was declared.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@223485 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/autoservice.c

index 8bcf81742b7eaed0961d0b258bc0814ebbd8c6f8..2460527841b53c4e636651a2e920ea26274c9b36 100644 (file)
@@ -77,6 +77,11 @@ static int as_chan_list_state;
 
 static void *autoservice_run(void *ign)
 {
+       struct ast_frame hangup_frame = {
+               .frametype = AST_FRAME_CONTROL,
+               .subclass = AST_CONTROL_HANGUP,
+       };
+
        for (;;) {
                struct ast_channel *mons[MAX_AUTOMONS];
                struct asent *ents[MAX_AUTOMONS];
@@ -121,7 +126,6 @@ static void *autoservice_run(void *ign)
                f = ast_read(chan);
        
                if (!f) {
-                       struct ast_frame hangup_frame = { 0, };
                        /* No frame means the channel has been hung up.
                         * A hangup frame needs to be queued here as ast_waitfor() may
                         * never return again for the condition to be detected outside