aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {