aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 73dbcca3e..50d784b1c 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -984,7 +984,16 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_deactivate_generator(in);
/* If we are calling a single channel, and not providing ringback or music, */
/* then, make them compatible for in-band tone purpose */
- ast_channel_make_compatible(outgoing->chan, in);
+ if (ast_channel_make_compatible(outgoing->chan, in) < 0) {
+ /* If these channels can not be made compatible,
+ * there is no point in continuing. The bridge
+ * will just fail if it gets that far.
+ */
+ *to = -1;
+ strcpy(pa->status, "CONGESTION");
+ ast_cdr_failed(in->cdr);
+ return NULL;
+ }
}
if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {