aboutsummaryrefslogtreecommitdiffstats
path: root/main/autoservice.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-11 17:25:42 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-11 17:25:42 +0000
commit0fa9b24b8ba0cfda8e9e69b7ab9999a74cd13a98 (patch)
tree00d7957e111cc99dd5cec26af8bf5d1b53fd0726 /main/autoservice.c
parent5f0f1093db817f5a3a1fbaa7028c377b374bcdbc (diff)
Merged revisions 223485-223486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r223485 | russell | 2009-10-11 12:22:52 -0500 (Sun, 11 Oct 2009) | 6 lines Don't use data outside of its scope. 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. ........ r223486 | russell | 2009-10-11 12:25:06 -0500 (Sun, 11 Oct 2009) | 2 lines Remove some unnecessary code. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223487 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/autoservice.c')
-rw-r--r--main/autoservice.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/autoservice.c b/main/autoservice.c
index 7ed271016..4e1cd5203 100644
--- a/main/autoservice.c
+++ b/main/autoservice.c
@@ -72,6 +72,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];
@@ -114,18 +119,14 @@ 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
* of autoservice. So, we'll leave a HANGUP queued up so the
* thread in charge of this channel will know. */
- hangup_frame.frametype = AST_FRAME_CONTROL;
- hangup_frame.subclass = AST_CONTROL_HANGUP;
-
defer_frame = &hangup_frame;
} else {