diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_chanspy.c | 16 | ||||
-rw-r--r-- | apps/app_dial.c | 6 | ||||
-rw-r--r-- | apps/app_disa.c | 10 | ||||
-rw-r--r-- | apps/app_dumpchan.c | 4 | ||||
-rw-r--r-- | apps/app_externalivr.c | 6 |
5 files changed, 18 insertions, 24 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 608eb6be1..2a472bf44 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -676,9 +676,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto } } - ast_channel_lock(chan); - ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); - ast_channel_unlock(chan); + ast_channel_set_flag(chan, AST_FLAG_END_DTMF_ONLY); csth.volfactor = *volfactor; @@ -808,9 +806,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto else ast_deactivate_generator(chan); - ast_channel_lock(chan); - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); - ast_channel_unlock(chan); + ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY); if (ast_test_flag(flags, OPTION_WHISPER | OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) { ast_audiohook_lock(&csth.whisper_audiohook); @@ -904,7 +900,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, if (ast_channel_state(chan) != AST_STATE_UP) ast_answer(chan); - ast_set_flag(ast_channel_flags(chan), AST_FLAG_SPYING); /* so nobody can spy on us while we are spying */ + ast_channel_set_flag(chan, AST_FLAG_SPYING); waitms = 100; @@ -917,7 +913,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, if (!res) res = ast_waitstream(chan, ""); else if (res < 0) { - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_SPYING); + ast_channel_clear_flag(chan, AST_FLAG_SPYING); break; } if (!ast_strlen_zero(exitcontext)) { @@ -960,7 +956,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, res = ast_waitfordigit(chan, waitms); if (res < 0) { iter = ast_channel_iterator_destroy(iter); - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_SPYING); + ast_channel_clear_flag(chan, AST_FLAG_SPYING); break; } if (!ast_strlen_zero(exitcontext)) { @@ -1179,7 +1175,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, } exit: - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_SPYING); + ast_channel_clear_flag(chan, AST_FLAG_SPYING); ast_channel_setoption(chan, AST_OPTION_TXGAIN, &zero_volume, sizeof(zero_volume), 0); diff --git a/apps/app_dial.c b/apps/app_dial.c index 250340579..9f77cd880 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -2870,7 +2870,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast ast_log(LOG_ERROR, "error streaming file '%s' to callee\n", opt_args[OPT_ARG_ANNOUNCE]); } - ast_set_flag(ast_channel_flags(peer), AST_FLAG_END_DTMF_ONLY); + ast_channel_set_flag(peer, AST_FLAG_END_DTMF_ONLY); while (ast_channel_stream(peer)) { int ms; @@ -2934,13 +2934,13 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast } ast_sched_runq(ast_channel_sched(peer)); } - ast_clear_flag(ast_channel_flags(peer), AST_FLAG_END_DTMF_ONLY); + ast_channel_clear_flag(peer, AST_FLAG_END_DTMF_ONLY); } if (chan && peer && ast_test_flag64(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) { /* chan and peer are going into the PBX; as such neither are considered * outgoing channels any longer */ - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING); + ast_channel_clear_flag(chan, AST_FLAG_OUTGOING); ast_replace_subargument_delimiter(opt_args[OPT_ARG_GOTO]); ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]); diff --git a/apps/app_disa.c b/apps/app_disa.c index 824e8fe55..dbdad94be 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -210,7 +210,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) play_dialtone(chan, args.mailbox); - ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); + ast_channel_set_flag(chan, AST_FLAG_END_DTMF_ONLY); for (;;) { /* if outa time, give em reorder */ @@ -226,7 +226,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) } if (!(f = ast_read(chan))) { - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); + ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY); return -1; } @@ -234,7 +234,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) if (f->data.uint32) ast_channel_hangupcause_set(chan, f->data.uint32); ast_frfree(f); - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); + ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY); return -1; } @@ -263,7 +263,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) fp = fopen(args.passcode,"r"); if (!fp) { ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,ast_channel_name(chan)); - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); + ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY); return -1; } pwline[0] = 0; @@ -359,7 +359,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) } } - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY); + ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY); if (k == 3) { int recheck = 0; diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index 1a5a4469a..14164388d 100644 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -90,8 +90,6 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) ast_channel_lock(c); bridge = ast_channel_get_bridge(c); - ast_channel_unlock(c); - snprintf(buf,size, "Name= %s\n" "Type= %s\n" @@ -168,7 +166,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) ast_channel_appl(c) ? ast_channel_appl(c) : "(N/A)", ast_channel_data(c) ? S_OR(ast_channel_data(c), "(Empty)") : "(None)", (ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING) ? ast_channel_blockproc(c) : "(Not Blocking)")); - + ast_channel_unlock(c); ao2_cleanup(bridge); return 0; } diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 9cb8839db..b661a2ec9 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -645,9 +645,9 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, setvbuf(eivr_errors, NULL, _IONBF, 0); } - while (1) { - if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)) { - ast_chan_log(LOG_ERROR, chan, "Is a zombie\n"); + while (1) { + if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)) { + ast_chan_log(LOG_ERROR, chan, "Is a zombie\n"); break; } if (!hangup_info_sent && !(ast_test_flag(&flags, run_dead)) && ast_check_hangup(chan)) { |