diff --git a/apps/app_dial.c b/apps/app_dial.c index 73dbcca3e0301a059cbac47263052893aa21fb71..50d784b1c8e8880753020a6426ffe8a2abca7870 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)) { diff --git a/main/channel.c b/main/channel.c index a47aa61c6c61d19670c9f3a4e30d4f2402abd5c8..b0bdede94f3a2a28a5e7ea9ff1272442786f1e2a 100644 --- a/main/channel.c +++ b/main/channel.c @@ -4381,9 +4381,8 @@ int ast_indicate_data(struct ast_channel *chan, int _condition, if (ts) { /* We have a tone to play, yay. */ ast_debug(1, "Driver for channel '%s' does not support indication %d, emulating it\n", chan->name, condition); - ast_playtones_start(chan, 0, ts->data, 1); + res = ast_playtones_start(chan, 0, ts->data, 1); ts = ast_tone_zone_sound_unref(ts); - res = 0; } if (res) { @@ -5001,10 +5000,11 @@ static int set_format(struct ast_channel *chan, format_t fmt, format_t *rawforma else /* writing */ *trans = ast_translator_build_path(*rawformat, *format); + res = *trans ? 0 : -1; ast_channel_unlock(chan); ast_debug(1, "Set channel %s to %s format %s\n", chan->name, direction ? "write" : "read", ast_getformatname(fmt)); - return 0; + return res; } int ast_set_read_format(struct ast_channel *chan, format_t fmt)