aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-19 15:15:03 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-19 15:15:03 +0000
commit14d3d9cceec120f31816cf98f483bc00b4691129 (patch)
tree40c5d7d2249572423f8f4a0ee197150d349c7cba /apps
parentfa37f7b8c6edf016a04e52754e5005aeb1e5c81c (diff)
extract a common condition.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21508 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index c1a790b66..c6e2c6411 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -608,21 +608,21 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (option_debug)
ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass);
}
- } else if (single && (f->frametype == AST_FRAME_VOICE) &&
- !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
- if (ast_write(in, f))
- ast_log(LOG_WARNING, "Unable to forward voice frame\n");
- } else if (single && (f->frametype == AST_FRAME_IMAGE) &&
- !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
- if (ast_write(in, f))
- ast_log(LOG_WARNING, "Unable to forward image\n");
- } else if (single && (f->frametype == AST_FRAME_TEXT) &&
- !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
- if (ast_write(in, f))
- ast_log(LOG_WARNING, "Unable to send text\n");
- } else if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML)) {
- if(ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1)
- ast_log(LOG_WARNING, "Unable to send URL\n");
+ } else if (single) {
+ /* XXX are we sure the logic is correct ? or we should just switch on f->frametype ? */
+ if (f->frametype == AST_FRAME_VOICE && !ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK)) {
+ if (ast_write(in, f))
+ ast_log(LOG_WARNING, "Unable to forward voice frame\n");
+ } else if (f->frametype == AST_FRAME_IMAGE && !ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK)) {
+ if (ast_write(in, f))
+ ast_log(LOG_WARNING, "Unable to forward image\n");
+ } else if (f->frametype == AST_FRAME_TEXT && !ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK)) {
+ if (ast_write(in, f))
+ ast_log(LOG_WARNING, "Unable to send text\n");
+ } else if (f->frametype == AST_FRAME_HTML && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML)) {
+ if (ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1)
+ ast_log(LOG_WARNING, "Unable to send URL\n");
+ }
}
ast_frfree(f);
} /* end for */