aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-11 15:59:32 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-11 15:59:32 +0000
commit06734e3a250b0277e563eff5cff0c13c3bdf3b27 (patch)
tree554d89fb9d21f9dc6531a75ea8d51cf4617f5b8a /apps
parenta3aa6173e97650f5647f33d09a1e5315308c67db (diff)
Remove some redundant logic from wait_for_answer. This also let's us get rid of one of
those XXX comments from the code. The redundancy occurs because the 'single' flag implies that the 'r' and 'm' flags are not set, so there's no need to explicitly check them again. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@107530 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index ecc437ba6..ccd30678e 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -751,19 +751,21 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_debug(1, "Dunno what to do with control type %d\n", f->subclass);
}
} 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_flag64(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_flag64(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_flag64(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_flag64(outgoing, DIAL_NOFORWARDHTML)) {
- if (ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1)
- ast_log(LOG_WARNING, "Unable to send URL\n");
+ switch (f->frametype) {
+ case AST_FRAME_VOICE:
+ case AST_FRAME_IMAGE:
+ case AST_FRAME_TEXT:
+ if (ast_write(in, f)) {
+ ast_log(LOG_WARNING, "Unable to write frame\n");
+ }
+ break;
+ case AST_FRAME_HTML:
+ if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1) {
+ ast_log(LOG_WARNING, "Unable to send URL\n");
+ }
+ break;
+ default:
+ break;
}
}
ast_frfree(f);